From e9d0c8a9287df7b4d18f8bd7767b419fe52ac19f Mon Sep 17 00:00:00 2001 From: apurvagurme <58025903+apurvagurme@users.noreply.github.com> Date: Sun, 15 Oct 2023 21:38:16 +0530 Subject: [PATCH] feat: add about block in object detail page (#2028) --- .../pages/settings/SettingsObjectDetail.tsx | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/front/src/pages/settings/SettingsObjectDetail.tsx b/front/src/pages/settings/SettingsObjectDetail.tsx index 8f1882991..427b9dfc9 100644 --- a/front/src/pages/settings/SettingsObjectDetail.tsx +++ b/front/src/pages/settings/SettingsObjectDetail.tsx @@ -1,5 +1,6 @@ import { useEffect } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; +import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { @@ -13,12 +14,15 @@ import { } from '@/settings/objects/constants/mockObjects'; import { objectSettingsWidth } from '@/settings/objects/constants/objectSettings'; import { AppPath } from '@/types/AppPath'; -import { IconPlus, IconSettings } from '@/ui/display/icon'; +import { IconDotsVertical, IconPlus, IconSettings } from '@/ui/display/icon'; +import { Tag } from '@/ui/display/tag/components/Tag'; import { H2Title } from '@/ui/display/typography/components/H2Title'; import { Button } from '@/ui/input/button/components/Button'; import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer'; import { Table } from '@/ui/layout/table/components/Table'; +import { TableCell } from '@/ui/layout/table/components/TableCell'; import { TableHeader } from '@/ui/layout/table/components/TableHeader'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { TableSection } from '@/ui/layout/table/components/TableSection'; import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb'; @@ -30,6 +34,11 @@ const StyledContainer = styled.div` width: ${objectSettingsWidth}; `; +const StyledFlexContainer = styled.div` + display: flex; + justify-content: flex-end; +`; + const StyledBreadcrumb = styled(Breadcrumb)` margin-bottom: ${({ theme }) => theme.spacing(8)}; `; @@ -38,9 +47,34 @@ const StyledAddFieldButton = styled(Button)` align-self: flex-end; margin-top: ${({ theme }) => theme.spacing(2)}; `; +const StyledIconTableCell = styled(TableCell)` + justify-content: center; + padding-right: ${({ theme }) => theme.spacing(1)}; +`; + +const StyledTableRow = styled(TableRow)` + background-color: ${({ theme }) => theme.background.secondary}; + border: ${({ theme }) => theme.border.color.medium}; +`; + +const StyledNameTableCell = styled(TableCell)` + color: ${({ theme }) => theme.font.color.primary}; + gap: ${({ theme }) => theme.spacing(2)}; +`; + +const StyledTag = styled(Tag)` + box-sizing: border-box; + height: ${({ theme }) => theme.spacing(4)}; +`; + +const StyledIconDotsVertical = styled(IconDotsVertical)` + color: ${({ theme }) => theme.font.color.tertiary}; +`; export const SettingsObjectDetail = () => { const navigate = useNavigate(); + const theme = useTheme(); + const { pluralObjectName = '' } = useParams(); const activeObject = activeObjectItems.find( (activeObject) => activeObject.name.toLowerCase() === pluralObjectName, @@ -59,6 +93,35 @@ export const SettingsObjectDetail = () => { { children: activeObject?.name ?? '' }, ]} /> + + + + {activeObject ? ( + + ) : ( + '' + )} + {activeObject?.name} + + + + {activeObject?.type === 'standard' ? ( + + ) : ( + + )} + + + + navigate(`/settings/objects/${pluralObjectName}/edit`) + } + /> + + +