From cbc45d6616289c55ec34c86edc3e3ed9f9c6695b Mon Sep 17 00:00:00 2001 From: gitstart-twenty Date: Fri, 6 Sep 2024 16:03:47 +0000 Subject: [PATCH] remove unused file and update zod schema --- .../types/guards/isFieldArrayValue.ts | 6 +- .../link/components/RoundedItem.tsx | 76 ------------------- 2 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 packages/twenty-front/src/modules/ui/navigation/link/components/RoundedItem.tsx diff --git a/packages/twenty-front/src/modules/object-record/record-field/types/guards/isFieldArrayValue.ts b/packages/twenty-front/src/modules/object-record/record-field/types/guards/isFieldArrayValue.ts index e8ce4804abbf..8be30f0e2646 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/types/guards/isFieldArrayValue.ts +++ b/packages/twenty-front/src/modules/object-record/record-field/types/guards/isFieldArrayValue.ts @@ -1,11 +1,7 @@ import { FieldArrayValue } from '@/object-record/record-field/types/FieldMetadata'; import { z } from 'zod'; -export const arraySchema = z.union([ - z.null(), - z.array(z.any()), - z.record(z.any()), -]); +export const arraySchema = z.union([z.null(), z.array(z.string())]); export const isFieldArrayValue = ( fieldValue: unknown, diff --git a/packages/twenty-front/src/modules/ui/navigation/link/components/RoundedItem.tsx b/packages/twenty-front/src/modules/ui/navigation/link/components/RoundedItem.tsx deleted file mode 100644 index 0911ec55af33..000000000000 --- a/packages/twenty-front/src/modules/ui/navigation/link/components/RoundedItem.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import styled from '@emotion/styled'; -import { isNonEmptyString } from '@sniptt/guards'; -import { useContext } from 'react'; -import { FONT_COMMON, THEME_COMMON, ThemeContext } from 'twenty-ui'; - -type RoundedItemProps = { - label?: string; -}; - -const fontSizeMd = FONT_COMMON.size.md; -const spacing1 = THEME_COMMON.spacing(1); -const spacing2 = THEME_COMMON.spacing(2); - -const spacingMultiplicator = THEME_COMMON.spacingMultiplicator; - -const StyledLink = styled.a<{ - color: string; - background: string; - backgroundHover: string; - backgroundActive: string; - border: string; -}>` - align-items: center; - background-color: ${({ background }) => background}; - border: 1px solid ${({ border }) => border}; - - border-radius: 50px; - color: ${({ color }) => color}; - - cursor: pointer; - display: inline-flex; - font-weight: ${fontSizeMd}; - - gap: ${spacing1}; - - height: 10px; - justify-content: center; - - max-width: calc(100% - ${spacingMultiplicator} * 2px); - - min-width: fit-content; - - overflow: hidden; - padding: ${spacing1} ${spacing2}; - - text-decoration: none; - text-overflow: ellipsis; - user-select: none; - white-space: nowrap; -`; - -export const RoundedItem = ({ label }: RoundedItemProps) => { - const { theme } = useContext(ThemeContext); - - const background = theme.background.transparent.lighter; - const backgroundHover = theme.background.transparent.light; - const backgroundActive = theme.background.transparent.medium; - const border = theme.border.color.strong; - const color = theme.font.color.primary; - - if (!isNonEmptyString(label)) { - return <>; - } - - return ( - - {label} - - ); -};