diff --git a/front/src/modules/settings/objects/components/NewObjectType.tsx b/front/src/modules/settings/objects/components/NewObjectType.tsx new file mode 100644 index 000000000..d6ffbc596 --- /dev/null +++ b/front/src/modules/settings/objects/components/NewObjectType.tsx @@ -0,0 +1,67 @@ +import { useState } from 'react'; +import { useTheme } from '@emotion/react'; +import styled from '@emotion/styled'; + +import { IconBox, IconDatabase, IconFileCheck } from '@/ui/display/icon'; + +import { ObjectTypeCard } from './ObjectTypeCard'; + +const StyledContainer = styled.div` + display: flex; + flex-direction: row; + gap: ${({ theme }) => theme.spacing(5)}; + margin-bottom: ${({ theme }) => theme.spacing(8)}; + width: 100%; +`; + +export const NewObjectType = () => { + const theme = useTheme(); + const [selectedType, setSelectedType] = useState(null); + const handleCardClick = (selectedType: string) => { + setSelectedType(selectedType); + }; + return ( + + + } + onClick={() => handleCardClick('Standard')} + > + + } + onClick={() => handleCardClick('Custom')} + > + + } + > + + ); +}; diff --git a/front/src/modules/settings/objects/components/ObjectTypeCard.tsx b/front/src/modules/settings/objects/components/ObjectTypeCard.tsx new file mode 100644 index 000000000..82925645b --- /dev/null +++ b/front/src/modules/settings/objects/components/ObjectTypeCard.tsx @@ -0,0 +1,79 @@ +import { useTheme } from '@emotion/react'; +import styled from '@emotion/styled'; + +import { IconCheck } from '@/ui/display/icon'; +import { SoonPill } from '@/ui/display/pill/components/SoonPill'; +import { Tag } from '@/ui/display/tag/components/Tag'; +import { ThemeColor } from '@/ui/theme/constants/colors'; + +const StyledObjectTypeCard = styled.div` + ${({ theme, disabled, selected }) => ` + background: ${theme.background.transparent.primary}; + cursor: ${disabled ? 'not-allowed' : 'pointer'}; + display: flex; + flex-direction: row; + font-family: ${theme.font.family}; + font-weight: 500; + border-style: solid; + border-width: '1px'; + padding: ${theme.spacing(3)}; + border-radius: ${theme.border.radius.sm}; + gap: ${theme.spacing(2)}; + border-color: ${ + selected ? theme.border.color.inverted : theme.border.color.medium + }; + color: ${theme.font.color.primary}; + align-items: center; + width: 140px; + `} +`; + +const StyledTag = styled(Tag)` + box-sizing: border-box; + height: ${({ theme }) => theme.spacing(5)}; +`; + +const StyledIconCheck = styled(IconCheck)` + margin-left: auto; +`; + +type ObjectTypeCardProps = { + prefixIcon?: React.ReactNode; + title: string; + soon?: boolean; + disabled?: boolean; + color: ThemeColor; + selected: boolean; + onClick?: () => void; +}; + +export const ObjectTypeCard = ({ + prefixIcon, + title, + soon = false, + selected, + disabled = false, + color, + onClick, +}: ObjectTypeCardProps) => { + const theme = useTheme(); + return ( +
onclick}> + + {prefixIcon} + + {soon && } + {!disabled && selected && } + +
+ ); +}; + +export {}; diff --git a/front/src/modules/ui/display/icon/index.ts b/front/src/modules/ui/display/icon/index.ts index eab74695b..a7a2bdd63 100644 --- a/front/src/modules/ui/display/icon/index.ts +++ b/front/src/modules/ui/display/icon/index.ts @@ -11,6 +11,7 @@ export { IconArrowUp, IconArrowUpRight, IconBell, + IconBox, IconBrandGithub, IconBrandGoogle, IconBrandLinkedin, @@ -34,9 +35,11 @@ export { IconCopy, IconCross, IconCurrencyDollar, + IconDatabase, IconDotsVertical, IconEye, IconEyeOff, + IconFileCheck, IconFileImport, IconFileUpload, IconForbid, diff --git a/front/src/pages/settings/SettingsNewObject.tsx b/front/src/pages/settings/SettingsNewObject.tsx index 9bb9774b6..43142f036 100644 --- a/front/src/pages/settings/SettingsNewObject.tsx +++ b/front/src/pages/settings/SettingsNewObject.tsx @@ -1,10 +1,11 @@ import styled from '@emotion/styled'; -import { SettingsIconSection } from '@/settings/components/SettingsIconSection'; +import { NewObjectType } from '@/settings/objects/components/NewObjectType'; import { objectSettingsWidth } from '@/settings/objects/constants/objectSettings'; -import { IconSettings } from '@/ui/input/constants/icons'; -import { useIconPicker } from '@/ui/input/hooks/useIconPicker'; +import { IconSettings } from '@/ui/display/icon'; +import { H2Title } from '@/ui/display/typography/components/H2Title'; import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer'; +import { Section } from '@/ui/layout/section/components/Section'; import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb'; const StyledContainer = styled.div` @@ -18,8 +19,6 @@ const StyledContainer = styled.div` `; export const SettingsNewObject = () => { - const { Icon, iconKey, setIconPicker } = useIconPicker(); - return ( @@ -29,12 +28,13 @@ export const SettingsNewObject = () => { { children: 'New' }, ]} /> - - +
+ +
+
);