Skip to content

Commit

Permalink
Tweak FilledTextInput spacing
Browse files Browse the repository at this point in the history
Also add more test cases to InputTester
  • Loading branch information
paullinator committed Jan 17, 2024
1 parent dabe8d6 commit e39e18f
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 33 deletions.
26 changes: 18 additions & 8 deletions src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,14 @@ exports[`CategoryModal should render with a subcategory 1`] = `
"borderWidth": 1,
"flex": undefined,
"flexDirection": "row",
"paddingHorizontal": 22,
"paddingHorizontal": 9,
},
{
"backgroundColor": undefined,
"borderColor": undefined,
"marginHorizontal": undefined,
"opacity": undefined,
"paddingVertical": 17.6,
"paddingVertical": 16.5,
},
]
}
Expand Down Expand Up @@ -521,6 +521,7 @@ exports[`CategoryModal should render with a subcategory 1`] = `
"alignSelf": "flex-start",
"flex": 1,
"flexDirection": "row",
"left": 0,
},
{
"marginBottom": NaN,
Expand All @@ -540,8 +541,9 @@ exports[`CategoryModal should render with a subcategory 1`] = `
{
"alignItems": "center",
"justifyContent": "center",
"left": 8.8,
"margin": 0,
"paddingHorizontal": 11,
"paddingHorizontal": 0,
"paddingVertical": 0,
"position": "absolute",
"top": 0,
Expand All @@ -551,6 +553,9 @@ exports[`CategoryModal should render with a subcategory 1`] = `
{
"translateY": undefined,
},
{
"translateX": undefined,
},
],
},
]
Expand Down Expand Up @@ -635,7 +640,7 @@ exports[`CategoryModal should render with a subcategory 1`] = `
"flexShrink": 1,
"fontFamily": "Quicksand-Regular",
"margin": 0,
"paddingHorizontal": 11,
"paddingHorizontal": 0,
"paddingVertical": 0,
},
{
Expand Down Expand Up @@ -1896,14 +1901,14 @@ exports[`CategoryModal should render with an empty subcategory 1`] = `
"borderWidth": 1,
"flex": undefined,
"flexDirection": "row",
"paddingHorizontal": 22,
"paddingHorizontal": 9,
},
{
"backgroundColor": undefined,
"borderColor": undefined,
"marginHorizontal": undefined,
"opacity": undefined,
"paddingVertical": 17.6,
"paddingVertical": 16.5,
},
]
}
Expand Down Expand Up @@ -1941,6 +1946,7 @@ exports[`CategoryModal should render with an empty subcategory 1`] = `
"alignSelf": "flex-start",
"flex": 1,
"flexDirection": "row",
"left": 0,
},
{
"marginBottom": NaN,
Expand All @@ -1960,8 +1966,9 @@ exports[`CategoryModal should render with an empty subcategory 1`] = `
{
"alignItems": "center",
"justifyContent": "center",
"left": 8.8,
"margin": 0,
"paddingHorizontal": 11,
"paddingHorizontal": 0,
"paddingVertical": 0,
"position": "absolute",
"top": 0,
Expand All @@ -1971,6 +1978,9 @@ exports[`CategoryModal should render with an empty subcategory 1`] = `
{
"translateY": undefined,
},
{
"translateX": undefined,
},
],
},
]
Expand Down Expand Up @@ -2055,7 +2065,7 @@ exports[`CategoryModal should render with an empty subcategory 1`] = `
"flexShrink": 1,
"fontFamily": "Quicksand-Regular",
"margin": 0,
"paddingHorizontal": 11,
"paddingHorizontal": 0,
"paddingVertical": 0,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,14 @@ exports[`CreateWalletAccountSelect renders 1`] = `
"borderWidth": 1,
"flex": undefined,
"flexDirection": "row",
"paddingHorizontal": 22,
"paddingHorizontal": 9,
},
{
"backgroundColor": undefined,
"borderColor": undefined,
"marginHorizontal": undefined,
"opacity": undefined,
"paddingVertical": 17.6,
"paddingVertical": 16.5,
},
]
}
Expand Down Expand Up @@ -454,6 +454,7 @@ exports[`CreateWalletAccountSelect renders 1`] = `
"alignSelf": "flex-start",
"flex": 1,
"flexDirection": "row",
"left": 0,
},
{
"marginBottom": NaN,
Expand All @@ -473,8 +474,9 @@ exports[`CreateWalletAccountSelect renders 1`] = `
{
"alignItems": "center",
"justifyContent": "center",
"left": 8.8,
"margin": 0,
"paddingHorizontal": 11,
"paddingHorizontal": 0,
"paddingVertical": 0,
"position": "absolute",
"top": 0,
Expand All @@ -484,6 +486,9 @@ exports[`CreateWalletAccountSelect renders 1`] = `
{
"translateY": undefined,
},
{
"translateX": undefined,
},
],
},
]
Expand Down Expand Up @@ -570,7 +575,7 @@ exports[`CreateWalletAccountSelect renders 1`] = `
"flexShrink": 1,
"fontFamily": "Quicksand-Regular",
"margin": 0,
"paddingHorizontal": 11,
"paddingHorizontal": 0,
"paddingVertical": 0,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
"borderWidth": 1,
"flex": undefined,
"flexDirection": "row",
"paddingHorizontal": 22,
"paddingHorizontal": 9,
},
{
"backgroundColor": undefined,
"borderColor": undefined,
"marginHorizontal": undefined,
"opacity": undefined,
"paddingVertical": 17.6,
"paddingVertical": 16.5,
},
]
}
Expand Down Expand Up @@ -429,6 +429,7 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
"alignSelf": "flex-start",
"flex": 1,
"flexDirection": "row",
"left": 0,
},
{
"marginBottom": NaN,
Expand All @@ -448,8 +449,9 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
{
"alignItems": "center",
"justifyContent": "center",
"left": 8.8,
"margin": 0,
"paddingHorizontal": 11,
"paddingHorizontal": 0,
"paddingVertical": 0,
"position": "absolute",
"top": 0,
Expand All @@ -459,6 +461,9 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
{
"translateY": undefined,
},
{
"translateX": undefined,
},
],
},
]
Expand Down Expand Up @@ -544,7 +549,7 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
"flexShrink": 1,
"fontFamily": "Quicksand-Regular",
"margin": 0,
"paddingHorizontal": 11,
"paddingHorizontal": 0,
"paddingVertical": 0,
},
{
Expand Down
32 changes: 32 additions & 0 deletions src/components/scenes/InputTesterScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export function InputTesterScene() {
const [value0, setValue0] = useState<string>('')
const [value1, setValue1] = useState<string>('')
const [filledTextInputValue, setFilledTextInputValue] = useState<string>('')
const [filledTextInputValue2, setFilledTextInputValue2] = useState<string>('')
const [filledTextInputValue3, setFilledTextInputValue3] = useState<string>('')
const [filledTextInputValue4, setFilledTextInputValue4] = useState<string>('')
const walletId = selectedWallet?.wallet.id ?? ''
const tokenId = selectedWallet?.tokenId ?? null
const exchangedFlipInputRef = React.useRef<ExchangedFlipInputRef>(null)
Expand Down Expand Up @@ -85,6 +88,35 @@ export function InputTesterScene() {
placeholder="Test FilledTextInput"
maxLength={100}
/>
<FilledTextInput
vertical={1}
prefix="PRE"
value={filledTextInputValue2}
onChangeText={setFilledTextInputValue2}
autoFocus={false}
placeholder="Test FilledTextInput"
maxLength={100}
/>
<FilledTextInput
numeric
vertical={1}
value={filledTextInputValue3}
onChangeText={setFilledTextInputValue3}
autoFocus={false}
placeholder="Test FilledTextInput num"
maxLength={100}
/>
<FilledTextInput
numeric
vertical={1}
prefix="$"
suffix="BTC"
value={filledTextInputValue4}
onChangeText={setFilledTextInputValue4}
autoFocus={false}
placeholder="Test FilledTextInput num"
maxLength={100}
/>
<CardUi4>
<ExchangedFlipInput2
ref={exchangedFlipInputRef}
Expand Down
Loading

0 comments on commit e39e18f

Please sign in to comment.