Skip to content

Commit

Permalink
Don't use flex on inputs (#5458)
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey authored Sep 23, 2024
1 parent e1ee95a commit e93cbbd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 17 deletions.
22 changes: 12 additions & 10 deletions src/components/dialogs/Embed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,18 @@ function EmbedDialogInner({
</View>

<View style={[a.flex_row, a.gap_sm]}>
<TextField.Root>
<TextField.Icon icon={CodeBrackets} />
<TextField.Input
label={_(msg`Embed HTML code`)}
editable={false}
selection={{start: 0, end: snippet.length}}
value={snippet}
style={{}}
/>
</TextField.Root>
<View style={[a.flex_1]}>
<TextField.Root>
<TextField.Icon icon={CodeBrackets} />
<TextField.Input
label={_(msg`Embed HTML code`)}
editable={false}
selection={{start: 0, end: snippet.length}}
value={snippet}
style={{}}
/>
</TextField.Root>
</View>
<Button
label={_(msg`Copy code`)}
color="primary"
Expand Down
4 changes: 2 additions & 2 deletions src/components/forms/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
ViewStyle,
} from 'react-native'

import {HITSLOP_20} from '#/lib/constants'
import {mergeRefs} from '#/lib/merge-refs'
import {HITSLOP_20} from 'lib/constants'
import {android, atoms as a, useTheme, web} from '#/alf'
import {useInteractionState} from '#/components/hooks/useInteractionState'
import {Props as SVGIconProps} from '#/components/icons/common'
Expand Down Expand Up @@ -73,7 +73,7 @@ export function Root({children, isInvalid = false}: RootProps) {
return (
<Context.Provider value={context}>
<View
style={[a.flex_row, a.align_center, a.relative, a.flex_1, a.px_md]}
style={[a.flex_row, a.align_center, a.relative, a.w_full, a.px_md]}
{...web({
onClick: () => inputRef.current?.focus(),
onMouseOver: onHoverIn,
Expand Down
21 changes: 21 additions & 0 deletions src/view/screens/Storybook/Forms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ export function Forms() {
label="Text field"
/>

<View style={[a.flex_row, a.gap_sm]}>
<View
style={[
{
width: '50%',
},
]}>
<TextField.Root>
<TextField.Icon icon={Globe} />
<TextField.Input
value={value}
onChangeText={setValue}
label="Text field"
/>
</TextField.Root>
</View>
<Button label="Submit" size="large" variant="solid" color="primary">
<ButtonText>Submit</ButtonText>
</Button>
</View>

<TextField.Root>
<TextField.Icon icon={Globe} />
<TextField.Input
Expand Down
10 changes: 5 additions & 5 deletions src/view/screens/Storybook/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import {ScrollView, View} from 'react-native'

import {isWeb} from '#/platform/detection'
import {useSetThemePrefs} from '#/state/shell'
import {isWeb} from 'platform/detection'
import {CenteredView} from '#/view/com/util/Views'
import {ListContained} from 'view/screens/Storybook/ListContained'
import {ListContained} from '#/view/screens/Storybook/ListContained'
import {atoms as a, ThemeProvider, useTheme} from '#/alf'
import {Button, ButtonText} from '#/components/Button'
import {Breakpoints} from './Breakpoints'
Expand Down Expand Up @@ -80,9 +80,8 @@ function StorybookInner() {
</Button>
</View>

<Buttons />
<Forms />

<Dialogs />
<ThemeProvider theme="light">
<Theming />
</ThemeProvider>
Expand All @@ -93,16 +92,17 @@ function StorybookInner() {
<Theming />
</ThemeProvider>

<Buttons />
<Typography />
<Spacing />
<Shadows />
<Buttons />
<Icons />
<Links />
<Forms />
<Dialogs />
<Menus />
<Breakpoints />
<Dialogs />

<Button
variant="solid"
Expand Down

0 comments on commit e93cbbd

Please sign in to comment.