-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLIENT] Add User's Profile to Home Page (#62)
- Loading branch information
Showing
6 changed files
with
132 additions
and
8 deletions.
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,60 @@ | ||
import React from "react"; | ||
import { useStyletron } from "baseui"; | ||
import { Avatar } from "baseui/avatar"; | ||
import { Block } from "baseui/block"; | ||
import { FlexGrid, FlexGridItem } from "baseui/flex-grid"; | ||
import { Label1, Label2, Label3 } from "baseui/typography"; | ||
|
||
import { EmployeesProfiles } from "../../graphql/types"; | ||
import { ProfileItem } from "./ProfileItem"; | ||
|
||
interface ProfileProps { | ||
data: EmployeesProfiles; | ||
} | ||
|
||
export const Profile: React.FC<ProfileProps> = ({ data }) => { | ||
const [, theme] = useStyletron(); | ||
|
||
return ( | ||
<Block display="flex" flexDirection="column" padding="0 32px"> | ||
<FlexGrid flexGridColumnCount={2} gridColumnGap="24px"> | ||
<Avatar | ||
size="120px" | ||
name={data.name} | ||
src={data.employeeProfilePicture ?? undefined} | ||
/> | ||
|
||
<FlexGridItem | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent="center" | ||
margin="12px 0" | ||
> | ||
<Label1>{data.name}</Label1> | ||
<Label2 $style={{ fontStyle: "italic", opacity: 0.64 }}> | ||
{data.title} | ||
</Label2> | ||
<Label3 color={theme.colors.accent} marginTop="8px"> | ||
{data.employeeEmail} | ||
</Label3> | ||
</FlexGridItem> | ||
</FlexGrid> | ||
|
||
<FlexGrid flexGridColumnCount={2}> | ||
<FlexGridItem> | ||
<ProfileItem | ||
title="Direct Manager" | ||
value={data.directManager?.name ?? "NONE"} | ||
/> | ||
<ProfileItem title="Cost Center" value={data.costCenter} /> | ||
<ProfileItem title="WorkGroup" value={data.workgroup} /> | ||
</FlexGridItem> | ||
<FlexGridItem> | ||
<ProfileItem title="Mobile Number" value={data.mobileNumber} /> | ||
<ProfileItem title="Start Date" value={data.hiringDate} /> | ||
<ProfileItem title="Function" value={data.function} /> | ||
</FlexGridItem> | ||
</FlexGrid> | ||
</Block> | ||
); | ||
}; |
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,20 @@ | ||
import React from "react"; | ||
import { useStyletron } from "baseui"; | ||
import { Block } from "baseui/block"; | ||
import { Label2, Label4 } from "baseui/typography"; | ||
|
||
interface ProfileItemProps { | ||
title: string; | ||
value: string; | ||
} | ||
|
||
export const ProfileItem: React.FC<ProfileItemProps> = (props) => { | ||
const [css, theme] = useStyletron(); | ||
|
||
return ( | ||
<Block display="flex" flexDirection="column" margin="32px 0"> | ||
<Label4 color={theme.colors.accent}>{props.title}</Label4> | ||
<Label2>{props.value}</Label2> | ||
</Block> | ||
); | ||
}; |
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
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
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
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