From de91035d9b4a80e820d4536afd3942bc4d9e3813 Mon Sep 17 00:00:00 2001 From: Dan Brewster Date: Tue, 14 Jan 2025 15:39:37 -0500 Subject: [PATCH] remove unnecessary files --- packages/ui/src/components/Form/Field.tsx | 16 +++++++++++++++- packages/ui/src/components/Form/FieldContext.tsx | 16 ---------------- packages/ui/src/components/Form/FormContext.tsx | 7 ------- packages/ui/src/components/Form/inputs.tsx | 2 +- 4 files changed, 16 insertions(+), 25 deletions(-) delete mode 100644 packages/ui/src/components/Form/FieldContext.tsx delete mode 100644 packages/ui/src/components/Form/FormContext.tsx diff --git a/packages/ui/src/components/Form/Field.tsx b/packages/ui/src/components/Form/Field.tsx index 537d6a8daa..b8e0af1110 100644 --- a/packages/ui/src/components/Form/Field.tsx +++ b/packages/ui/src/components/Form/Field.tsx @@ -1,10 +1,24 @@ import React, { useContext } from 'react'; import { YStack, styled } from 'tamagui'; +import { createStyledContext } from 'tamagui'; import { VariantsFromStyledContext } from '../../types'; import { Text } from '../TextV2'; -import { FieldContext } from './FieldContext'; import { FormContext } from './Form'; +import { Accent, BackgroundType } from './formUtils'; + +// Single field +type FieldContextValue = { + accent: Accent; + disabled: boolean; + backgroundType: BackgroundType; +}; + +export const FieldContext = createStyledContext({ + accent: 'neutral', + disabled: false, + backgroundType: 'primary', +}); export const FieldFrame = styled(YStack, { context: FieldContext, diff --git a/packages/ui/src/components/Form/FieldContext.tsx b/packages/ui/src/components/Form/FieldContext.tsx deleted file mode 100644 index e563980614..0000000000 --- a/packages/ui/src/components/Form/FieldContext.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { createStyledContext } from 'tamagui'; - -import { Accent, BackgroundType } from './formUtils'; - -// Single field -type FieldContextValue = { - accent: Accent; - disabled: boolean; - backgroundType: BackgroundType; -}; - -export const FieldContext = createStyledContext({ - accent: 'neutral', - disabled: false, - backgroundType: 'primary', -}); diff --git a/packages/ui/src/components/Form/FormContext.tsx b/packages/ui/src/components/Form/FormContext.tsx deleted file mode 100644 index f146419ef6..0000000000 --- a/packages/ui/src/components/Form/FormContext.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { createStyledContext } from 'tamagui'; - -import { BackgroundType } from './formUtils'; - -export const FormContext = createStyledContext<{ - backgroundType: BackgroundType; -}>({ backgroundType: 'primary' }); diff --git a/packages/ui/src/components/Form/inputs.tsx b/packages/ui/src/components/Form/inputs.tsx index 4fd4d265b3..966f073677 100644 --- a/packages/ui/src/components/Form/inputs.tsx +++ b/packages/ui/src/components/Form/inputs.tsx @@ -34,7 +34,7 @@ import { useBoundHandler } from '../ListItem/listItemUtils'; import Pressable from '../Pressable'; import { Text } from '../TextV2'; import { typeStyles } from '../TextV2/Text'; -import { FieldContext } from './FieldContext'; +import { FieldContext } from './Field'; import { Accent, getBorderVariantStyle as getBackgroundTypeVariantStyle,