diff --git a/src/components/CompanyView.jsx b/src/components/CompanyView.jsx new file mode 100644 index 0000000..195a490 --- /dev/null +++ b/src/components/CompanyView.jsx @@ -0,0 +1,25 @@ +import {Tooltip} from 'antd' +import {BankOutlined} from '@ant-design/icons' +import {Grid, GridItem} from './Grid' + +export const CompanyView = ({company}) => { + if(!company) + return - + + const displayName = company?.caption + + const tooltipInfo = + + тип: + + + {company?.companyTypeCaption} + + + + return + + {displayName} + + +} \ No newline at end of file diff --git a/src/components/Grid.jsx b/src/components/Grid.jsx new file mode 100644 index 0000000..d72a77b --- /dev/null +++ b/src/components/Grid.jsx @@ -0,0 +1,30 @@ +export const Grid = ({children, ...other}) => { + const gridContainerStyle = { + display: 'grid', + columnGap: '4px', + rowGap: '4px', + ...other, + } + + return
+ {children} +
+} + +export const GridItem = ({children, row, col, rowSpan, colSpan, ...other}) => { + const localRow = +row + const localCol = +col + const localColSpan = colSpan ? colSpan - 1 : 0 + const localRowSpan = rowSpan ? rowSpan - 1 : 0 + const gridItemStyle = { + gridColumnStart: localCol, + gridColumnEnd: localCol + localColSpan, + gridRowStart: localRow, + gridRowEnd: localRow + localRowSpan, + ...other, + } + + return
+ {children} +
+} \ No newline at end of file diff --git a/src/components/UserView.jsx b/src/components/UserView.jsx index 8d45740..c668cc2 100644 --- a/src/components/UserView.jsx +++ b/src/components/UserView.jsx @@ -1,6 +1,6 @@ import {Tooltip} from 'antd' -import { UserOutlined } from '@ant-design/icons' -import '../styles/grid.css' +import {UserOutlined} from '@ant-design/icons' +import {Grid, GridItem} from './Grid' export const UserView = ({user}) => { if(!user) @@ -8,29 +8,35 @@ export const UserView = ({user}) => { const displayName = user?.login - const tooltipInfo =
-
- Имя -
-
+ const tooltipInfo = + + Имя: + + {user?.name} -
-
- Фамилия -
-
+ + + Фамилия: + + {user?.surname} -
-
- Отчество -
-
+ + + Отчество: + + {user?.patronymic} -
-
+ + + Компания: + + + {user?.company?.caption} + + return - + {displayName}