Skip to content

Commit

Permalink
Merge pull request #37 from Anomaly42/master
Browse files Browse the repository at this point in the history
Adding a User Profile panel
  • Loading branch information
relaxxpls authored Dec 13, 2021
2 parents 63e7be7 + bf853b0 commit 111df19
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
57 changes: 57 additions & 0 deletions src/components/settings/Profile.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { UserOutlined } from '@ant-design/icons'
import { Descriptions } from 'antd'
import { useSelector } from 'react-redux'
import styled from 'styled-components/macro'

import { UserAvatar } from 'components/shared'
import { selectUserProfile } from 'store/userSlice'

const Profile = () => {

const profile = useSelector(selectUserProfile)

return (
<>
<AvatarContainer>
<UserAvatar size={72} src={profile?.profilePicture}/>
</AvatarContainer>

<StyledDescriptions
// title="User Info"
column={1}
>
<Descriptions.Item label="Name">{profile.name}</Descriptions.Item>
<Descriptions.Item label="Department">{profile.department}</Descriptions.Item>
<Descriptions.Item label="LDAP ID">{profile.ldapId}</Descriptions.Item>
<Descriptions.Item label="Email">{profile.email}</Descriptions.Item>
</StyledDescriptions>
</>
)
}

export default Profile


const StyledDescriptions = styled(Descriptions)`
padding-left: 0.5rem;
.ant-descriptions-title{
color: ${({ theme }) => theme.textColor};
}
.ant-descriptions-item{
padding-bottom:0.75rem;
}
.ant-descriptions-item-label{
color: ${({ theme }) => theme.primary};
}
.ant-descriptions-item-content{
color: ${({ theme }) => theme.textColor};
}
`

const AvatarContainer = styled.div`
display: flex;
justify-content: center;
padding-bottom: 1rem;
`

5 changes: 4 additions & 1 deletion src/components/settings/SettingsContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { PageHeading, PageTitle } from 'components/shared/Layout'
import { useTheme } from 'hooks'
import { logoutAction } from 'store/authSlice'

import Profile from './Profile'

const SettingsContainer = () => {
const dispatch = useDispatch()
const { theme, switchTheme } = useTheme()
Expand Down Expand Up @@ -78,7 +80,8 @@ const SettingsContainer = () => {
</Typography.Link>
}
>
<Empty description={<PageSubtitle>Coming soon!</PageSubtitle>} />
{/* <Empty description={<PageSubtitle>Coming soon!</PageSubtitle>} /> */}
<Profile/>
</Aside>
</>
)
Expand Down

0 comments on commit 111df19

Please sign in to comment.