Skip to content

Commit

Permalink
fix: update homepage content; make links more obvious
Browse files Browse the repository at this point in the history
  • Loading branch information
ericrallen committed Feb 7, 2022
1 parent 9f924fd commit 2083abb
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 47 deletions.
11 changes: 11 additions & 0 deletions src/components/ExternalLink/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Link, LinkProps } from '@chakra-ui/react'

const ExternalLink = ({ href, children, ...props }: LinkProps): React.ReactElement => {
return (
<Link href={href} color="teal" {...props} isExternal>
{children}
</Link>
)
}

export default ExternalLink
17 changes: 8 additions & 9 deletions src/components/ProfileCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Box, Stack, Link, Text, Heading } from '@chakra-ui/react'
import UserAvatar from '../UserAvatar'
import PsychometricTag from '../PsychometricTag'
import InternalLink from '../InternalLink'
import ExternalLink from '../ExternalLink'
import { GITHUB_PROFILE_BASE_URL, APPLICATION_URL } from '../../constants'

import type { UserProfileProps } from '../../pages/[...username]'
Expand Down Expand Up @@ -84,9 +85,7 @@ const ProfileCard = ({
<Stack direction="column" paddingRight="10px">
<Text>
<CardHeader />
<Link href={profile?.website} isExternal>
{profile?.website}
</Link>
<ExternalLink href={profile?.website}>{profile?.website}</ExternalLink>
<Text>{profile?.communicationStyle}</Text>
</Text>
</Stack>
Expand All @@ -97,23 +96,23 @@ const ProfileCard = ({
</Text>
<Stack direction="row" flexWrap="wrap">
{typeof profile?.personality?.type !== 'undefined' && (
<Link href={profile.personality.url} isExternal>
<ExternalLink href={profile.personality.url}>
<PsychometricTag>
{profile?.personality.type} | {profile?.personality.name}
</PsychometricTag>
</Link>
</ExternalLink>
)}
{typeof profile?.enneagram?.number !== 'undefined' && (
<Link href={profile.enneagram.url} isExternal>
<ExternalLink href={profile.enneagram.url}>
<PsychometricTag>
{profile?.enneagram.number} | {profile?.enneagram.name}
</PsychometricTag>
</Link>
</ExternalLink>
)}
{typeof profile?.color?.name !== 'undefined' && (
<Link href={profile.color.url} isExternal>
<ExternalLink href={profile.color.url}>
<PsychometricTag>{profile?.color.name}</PsychometricTag>
</Link>
</ExternalLink>
)}
</Stack>
</Stack>
Expand Down
24 changes: 14 additions & 10 deletions src/components/PsychometricDropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useEffect, useState } from 'react'
import { FormControl, FormLabel, Select, FormHelperText, Link } from '@chakra-ui/react'
import { FormControl, FormLabel, Select, FormHelperText, Text } from '@chakra-ui/react'

import ExternalLink from '../ExternalLink'

import type { definitions } from '../../types/supabase'

Expand Down Expand Up @@ -82,21 +84,23 @@ const PsychometricDropdown = ({
if (psychometric !== null) {
return (
<FormHelperText>
{psychometric.description}
<br />
<br />
<Link href={psychometric.url} isExternal>
Find out more about the {psychometric.type ?? psychometric.name} {label}
</Link>
.
<Text marginBottom="15px">
<blockquote cite={psychometric.url}>{psychometric.description}</blockquote>
</Text>
<Text>
<ExternalLink href={psychometric.url}>
Find out more about the {psychometric.type ?? psychometric.name} {label}
</ExternalLink>
.
</Text>
</FormHelperText>
)
} else if (typeof learnMoreUrl !== 'undefined') {
return (
<FormHelperText>
<Link href={learnMoreUrl} isExternal>
<ExternalLink href={learnMoreUrl}>
Find out more about the {label} psychometric
</Link>
</ExternalLink>
.
</FormHelperText>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/ThemeToggle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ThemeToggle = (): React.ReactElement => {
alignItems="center"
margin="0"
>
<GoLightBulb size={12} />
<GoLightBulb size={12} style={{ marginTop: '2px' }} />
<Switch
id="darkMode"
onChange={toggleColorMode}
Expand Down
36 changes: 24 additions & 12 deletions src/pages/[...username].tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Heading, Text, Link, Box } from '@chakra-ui/react'
import { Heading, Text, Box } from '@chakra-ui/react'

import type { GetServerSidePropsResult, GetServerSidePropsContext } from 'next'
import type { ParsedUrlQuery } from 'querystring'

import Page from '../components/Page'
import ProfileCard from '../components/ProfileCard'
import ExternalLink from '../components/ExternalLink'
import { getFullUserProfile, getUserAvatar } from '../services/user'

import type { definitions } from '../types/supabase'
Expand Down Expand Up @@ -42,10 +43,13 @@ const UserProfile = ({ profile }: UserProfileProps): React.ReactElement => {
Type: {profile.personality.name} ({profile.personality.type})
</Heading>
<Text marginBottom="10px">{profile?.personality.description}</Text>
<Link href={profile?.personality.url} isExternal>
Learn more about the {profile.personality.type} personality type and the{' '}
{profile?.personality.name} archetype
</Link>
<Text>
Learn more about the{' '}
<ExternalLink href={profile?.personality.url}>{profile.personality.type}</ExternalLink>{' '}
personality type and the{' '}
<ExternalLink href={profile?.personality.url}>{profile?.personality.name}</ExternalLink>{' '}
archetype
</Text>
</Box>
)}
{typeof profile?.enneagram?.number !== 'undefined' && (
Expand All @@ -54,10 +58,15 @@ const UserProfile = ({ profile }: UserProfileProps): React.ReactElement => {
Enneagram: {profile?.enneagram.name} ({profile?.enneagram.number})
</Heading>
<Text marginBottom="10px">{profile?.enneagram.description}</Text>
<Link href={profile?.enneagram?.url} isExternal>
Learn more about the {profile?.enneagram.number} enneagram number and the{' '}
{profile?.enneagram.name} archetype
</Link>
<Text>
Learn more about the{' '}
<ExternalLink href={profile?.enneagram.url}>
{profile.enneagram.number} Enneagram Number
</ExternalLink>{' '}
and the{' '}
<ExternalLink href={profile?.enneagram.url}>{profile?.enneagram.name}</ExternalLink>{' '}
archetype
</Text>
</Box>
)}
{typeof profile?.color?.name !== 'undefined' && (
Expand All @@ -66,9 +75,12 @@ const UserProfile = ({ profile }: UserProfileProps): React.ReactElement => {
Color: {profile?.color.name}
</Heading>
<Text marginBottom="10px">{profile?.color.description}</Text>
<Link href={profile?.color.url} isExternal>
Learn more about the {profile?.color.name} personality color
</Link>
<Text>
Learn more about the{' '}
<ExternalLink href={profile?.color.url}>
{profile.color.name} personality color
</ExternalLink>
</Text>
</Box>
)}
</Page>
Expand Down
39 changes: 24 additions & 15 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import Head from 'next/head'
import { Heading, Text, Link, Box } from '@chakra-ui/react'
import { Heading, Text, Box } from '@chakra-ui/react'
import { useEffect, useState } from 'react'

import type { NextPage } from 'next'

import Page from '../components/Page'
import ProfileCard from '../components/ProfileCard'
import ExternalLink from '../components/ExternalLink'
import { getFeaturedProfiles, getFullUserProfile } from '../services/user'
import camelCaseKeys from '../utils/camelCaseKeys'
import { PSYCHOMETRIC_URLS } from '../constants'
Expand Down Expand Up @@ -99,30 +100,38 @@ const Home: NextPage = () => {
</Heading>

<Text marginBottom="20px">
We want to help you get to know how your colleagues communicate and how to understand
their personality.
Personality profiles are a way to distill parts of your personality and life philosophy
into an easily digestible chunk of information.
</Text>

<Text marginBottom="20px">
They are not a perfect measure, by any means, but they are an interesting measure for you
- and anyone else you share the results with - to consider. They can be especially helpful
in the workplace (or in Open Source projects) where personalities, communication styles,
and philosophies can clash in complicated ways.
</Text>

<Text marginBottom="20px">
Work w/ Me wants to help you provide an easy way to show other developers these
personality psychometrics in a way that might help you understand how to collaborate more
effectively.
</Text>

<Text marginBottom="20px">
By using Work w/ Me, you can share a short description of your Communication Style, your{' '}
<Link href={PSYCHOMETRIC_URLS.TYPE} isExternal>
Myers Briggs Personality
</Link>
,{' '}
<Link href={PSYCHOMETRIC_URLS.ENNEAGRAM} isExternal>
Enneagram Number
</Link>
, and{' '}
<Link href={PSYCHOMETRIC_URLS.COLOR} isExternal>
<ExternalLink href={PSYCHOMETRIC_URLS.TYPE}>Myers Briggs Personality</ExternalLink>,{' '}
<ExternalLink href={PSYCHOMETRIC_URLS.ENNEAGRAM}>Enneagram Number</ExternalLink>, and{' '}
<ExternalLink href={PSYCHOMETRIC_URLS.COLOR}>
Hartman Personality Profile Color
</Link>{' '}
so that people who work with you can get a better understanding of who you are.
</ExternalLink>{' '}
so that people who work with you can get a better understanding of who you are, how you
think, and what motivates you.
</Text>
</Box>
{featuredUsers.length > 0 && (
<Box as="aside">
<Heading as="h2" size="sm" marginBottom="40px">
Featured Users
Get to know a random user:
</Heading>
{renderFeaturedProfiles()}
</Box>
Expand Down

0 comments on commit 2083abb

Please sign in to comment.