-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Anomaly42/master
Adding a User Profile panel
- Loading branch information
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters