diff options
Diffstat (limited to 'src/components/forms')
-rw-r--r-- | src/components/forms/TextField.tsx | 2 | ||||
-rw-r--r-- | src/components/forms/Toggle.tsx | 34 |
2 files changed, 11 insertions, 25 deletions
diff --git a/src/components/forms/TextField.tsx b/src/components/forms/TextField.tsx index ebf2e4750..a781bdd18 100644 --- a/src/components/forms/TextField.tsx +++ b/src/components/forms/TextField.tsx @@ -72,7 +72,7 @@ export function Root({children, isInvalid = false}: RootProps) { return ( <Context.Provider value={context}> <View - style={[a.flex_row, a.align_center, a.relative, a.w_full, a.px_md]} + style={[a.flex_row, a.align_center, a.relative, a.flex_1, a.px_md]} {...web({ onClick: () => inputRef.current?.focus(), onMouseOver: onHoverIn, diff --git a/src/components/forms/Toggle.tsx b/src/components/forms/Toggle.tsx index 9369423f2..140740f70 100644 --- a/src/components/forms/Toggle.tsx +++ b/src/components/forms/Toggle.tsx @@ -5,6 +5,7 @@ import {HITSLOP_10} from 'lib/constants' import {useTheme, atoms as a, web, native, flatten, ViewStyleProp} from '#/alf' import {Text} from '#/components/Typography' import {useInteractionState} from '#/components/hooks/useInteractionState' +import {CheckThick_Stroke2_Corner0_Rounded as Checkmark} from '#/components/icons/Check' export type ItemState = { name: string @@ -331,15 +332,14 @@ export function createSharedToggleStyles({ export function Checkbox() { const t = useTheme() const {selected, hovered, focused, disabled, isInvalid} = useItemContext() - const {baseStyles, baseHoverStyles, indicatorStyles} = - createSharedToggleStyles({ - theme: t, - hovered, - focused, - selected, - disabled, - isInvalid, - }) + const {baseStyles, baseHoverStyles} = createSharedToggleStyles({ + theme: t, + hovered, + focused, + selected, + disabled, + isInvalid, + }) return ( <View style={[ @@ -355,21 +355,7 @@ export function Checkbox() { baseStyles, hovered || focused ? baseHoverStyles : {}, ]}> - {selected ? ( - <View - style={[ - a.absolute, - a.rounded_2xs, - {height: 12, width: 12}, - selected - ? { - backgroundColor: t.palette.primary_500, - } - : {}, - indicatorStyles, - ]} - /> - ) : null} + {selected ? <Checkmark size="xs" fill={t.palette.primary_500} /> : null} </View> ) } |