Skip to content

Commit

Permalink
Rewrote ProfileItem to tsx format (#2226)
Browse files Browse the repository at this point in the history
  • Loading branch information
PavloDolia authored Aug 1, 2024
1 parent 6635ed4 commit abcc8a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import { useTranslation } from 'react-i18next'

import { styles } from '~/components/profile-item/ProfileItem.styles'
import useBreakpoints from '~/hooks/use-breakpoints'
import { ProfileItemType } from '~/components/profile-item/complete-profile.constants'

const ProfileItem = ({ item, isFilled = false }) => {
interface ProfileItemProps {
item: ProfileItemType
isFilled?: boolean
}

const ProfileItem = ({ item, isFilled = false }: ProfileItemProps) => {
const { t } = useTranslation()
const { isMobile } = useBreakpoints()
const { id, icon } = item
Expand All @@ -17,16 +23,10 @@ const ProfileItem = ({ item, isFilled = false }) => {
<Box sx={styles.information}>
{!isMobile && <Box sx={styles.icon}>{icon}</Box>}
<Box sx={styles.text}>
<Typography
sx={styles.title}
variant={isMobile ? 'subtitle2' : 'h6'}
>
<Typography variant={isMobile ? 'subtitle2' : 'h6'}>
{t(`completeProfile.${id}.title`)}
</Typography>
<Typography
sx={styles.subtitle}
variant={isMobile ? 'caption' : 'body2'}
>
<Typography variant={isMobile ? 'caption' : 'body2'}>
{t(`completeProfile.${id}.subtitle`)}
</Typography>
</Box>
Expand Down

0 comments on commit abcc8a1

Please sign in to comment.