diff --git a/client/components/profile/Profile.tsx b/client/components/profile/Profile.tsx new file mode 100644 index 0000000..e22fb2c --- /dev/null +++ b/client/components/profile/Profile.tsx @@ -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 = ({ data }) => { + const [, theme] = useStyletron(); + + return ( + + + + + + {data.name} + + {data.title} + + + {data.employeeEmail} + + + + + + + + + + + + + + + + + + ); +}; diff --git a/client/components/profile/ProfileItem.tsx b/client/components/profile/ProfileItem.tsx new file mode 100644 index 0000000..8db8935 --- /dev/null +++ b/client/components/profile/ProfileItem.tsx @@ -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 = (props) => { + const [css, theme] = useStyletron(); + + return ( + + {props.title} + {props.value} + + ); +}; diff --git a/client/graphql/fragments/employeeProfile.gql b/client/graphql/fragments/employeeProfile.gql index d712742..6baaa32 100644 --- a/client/graphql/fragments/employeeProfile.gql +++ b/client/graphql/fragments/employeeProfile.gql @@ -11,4 +11,8 @@ fragment EmployeeProfile on EmployeesProfiles { employeeEmail mobileNumber costCenter + directManager { + id + name + } } diff --git a/client/graphql/types/index.tsx b/client/graphql/types/index.tsx index 2856162..be0bb28 100644 --- a/client/graphql/types/index.tsx +++ b/client/graphql/types/index.tsx @@ -556,6 +556,10 @@ export type CertficationFragment = ( export type EmployeeProfileFragment = ( { __typename?: 'EmployeesProfiles' } & Pick + & { directManager?: Maybe<( + { __typename?: 'EmployeesProfiles' } + & Pick + )> } ); export type EmployeeSkillFragment = ( @@ -1184,6 +1188,10 @@ export const EmployeeProfileFragmentDoc = gql` employeeEmail mobileNumber costCenter + directManager { + id + name + } } `; export const RegularUserResponseFragmentDoc = gql` diff --git a/client/pages/index.tsx b/client/pages/index.tsx index 84397d9..00ad17f 100644 --- a/client/pages/index.tsx +++ b/client/pages/index.tsx @@ -1,15 +1,46 @@ -import { Heading, HeadingLevel } from "baseui/heading"; +import React from "react"; +import { FlexGrid, FlexGridItem } from "baseui/flex-grid"; +import { FILL, Tab, Tabs } from "baseui/tabs-motion"; +import { Label4 } from "baseui/typography"; -import { useRoleQuery } from "../graphql/types"; +import { Loading } from "../components/common/Loading"; +import { Profile } from "../components/profile/Profile"; +import { EmployeesProfiles, useMeQuery } from "../graphql/types"; import { withAuth } from "../hocs/withAuth"; + const Home: React.FC<{}> = () => { - const [{ data }] = useRoleQuery(); + const [{ data, fetching }] = useMeQuery(); + const [activeKey, setActiveKey] = React.useState("0"); + + if (fetching) return ; + if (!data?.me) return

Something wrong. Please try again later

; return ( - - TPD for ({data?.role!}) - + + + + + + { + setActiveKey(activeKey); + }} + > + + No Skills yet + + + No Certificates yet + + + No Trainings yet + + + + ); }; diff --git a/client/styles/theme.ts b/client/styles/theme.ts index 3262587..b391807 100644 --- a/client/styles/theme.ts +++ b/client/styles/theme.ts @@ -7,7 +7,7 @@ const primitives: Partial = { accent: "#171C8F", // ITWorx Blue accent700: "#101464", mono500: "#D0D3D4", // ITWorx Grey - mono1000: "#101820" // ITWorx Black + mono1000: "#101820", // ITWorx Black }; const overrides = { @@ -17,7 +17,8 @@ const overrides = { buttonSecondaryHover: primitives.accent700, buttonMinimalFill: "#FFF", buttonMinimalText: primitives.primary700, - buttonMinimalHover: "#EEE" + buttonMinimalHover: "#EEE", + borderSelected: primitives.primary, }, };