Skip to content

Commit

Permalink
Rewrote ProfileContainerMobile to tsx (#2220)
Browse files Browse the repository at this point in the history
* Rewrote ProfileContainerMobile to tsx

* Refactor doneItems type

* Fix doneItems type
  • Loading branch information
ipasic-softserve authored Aug 2, 2024
1 parent 42c26ce commit ba86982
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ReactNode } from 'react'

import Box from '@mui/material/Box'
import SchoolIcon from '@mui/icons-material/School'
import DoneIcon from '@mui/icons-material/Done'
Expand All @@ -8,6 +10,17 @@ import AppChipList from '~/components/app-chips-list/AppChipList'
import ProfileDoneItemsList from '~/components/icon-with-text-list/ProfileDoneItemsList'

import { styles } from '~/containers/user-profile/profile-info/ProfileInfo.styles'
import { UserResponse } from '~/types'

interface ProfileContainerMobileProps {
actionIcon: ReactNode
accInfo: ReactNode
buttonGroup: ReactNode
defaultQuantity: number
doneItems: { title: string; description: string }[]
userData: UserResponse
chipItems: string[]
}

const ProfileContainerMobile = ({
actionIcon,
Expand All @@ -17,18 +30,15 @@ const ProfileContainerMobile = ({
doneItems,
userData,
chipItems
}) => {
}: ProfileContainerMobileProps) => {
const avatarSrc = userData.photo
? `${import.meta.env.VITE_APP_IMG_USER_URL}${userData.photo}`
: ''
return (
<Box sx={styles.container}>
<Box sx={styles.wrapperForPhoto}>
<Box sx={styles.avatarContainerMobile}>
<Avatar
src={
userData.photo &&
`${import.meta.env.VITE_APP_IMG_USER_URL}${userData.photo}`
}
sx={styles.img}
/>
<Avatar src={avatarSrc} sx={styles.img} />
</Box>

<TitleWithDescription
Expand Down

0 comments on commit ba86982

Please sign in to comment.