diff --git a/src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap b/src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap index e926246c756..2e0988b9770 100644 --- a/src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap +++ b/src/__tests__/modals/__snapshots__/CategoryModal.test.tsx.snap @@ -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, }, ] } @@ -521,6 +521,7 @@ exports[`CategoryModal should render with a subcategory 1`] = ` "alignSelf": "flex-start", "flex": 1, "flexDirection": "row", + "left": 0, }, { "marginBottom": NaN, @@ -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, @@ -551,6 +553,9 @@ exports[`CategoryModal should render with a subcategory 1`] = ` { "translateY": undefined, }, + { + "translateX": undefined, + }, ], }, ] @@ -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, }, { @@ -1907,14 +1912,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, }, ] } @@ -1952,6 +1957,7 @@ exports[`CategoryModal should render with an empty subcategory 1`] = ` "alignSelf": "flex-start", "flex": 1, "flexDirection": "row", + "left": 0, }, { "marginBottom": NaN, @@ -1971,8 +1977,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, @@ -1982,6 +1989,9 @@ exports[`CategoryModal should render with an empty subcategory 1`] = ` { "translateY": undefined, }, + { + "translateX": undefined, + }, ], }, ] @@ -2066,7 +2076,7 @@ exports[`CategoryModal should render with an empty subcategory 1`] = ` "flexShrink": 1, "fontFamily": "Quicksand-Regular", "margin": 0, - "paddingHorizontal": 11, + "paddingHorizontal": 0, "paddingVertical": 0, }, { diff --git a/src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap b/src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap index b640142cd1a..40d3a76d358 100644 --- a/src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap +++ b/src/__tests__/scenes/__snapshots__/CreateWalletAccountSetupScene.test.tsx.snap @@ -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, }, ] } @@ -454,6 +454,7 @@ exports[`CreateWalletAccountSelect renders 1`] = ` "alignSelf": "flex-start", "flex": 1, "flexDirection": "row", + "left": 0, }, { "marginBottom": NaN, @@ -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, @@ -484,6 +486,9 @@ exports[`CreateWalletAccountSelect renders 1`] = ` { "translateY": undefined, }, + { + "translateX": undefined, + }, ], }, ] @@ -570,7 +575,7 @@ exports[`CreateWalletAccountSelect renders 1`] = ` "flexShrink": 1, "fontFamily": "Quicksand-Regular", "margin": 0, - "paddingHorizontal": 11, + "paddingHorizontal": 0, "paddingVertical": 0, }, { diff --git a/src/__tests__/scenes/__snapshots__/CreateWalletImportScene.test.tsx.snap b/src/__tests__/scenes/__snapshots__/CreateWalletImportScene.test.tsx.snap index faf2ca5cab6..80ad419c7e2 100644 --- a/src/__tests__/scenes/__snapshots__/CreateWalletImportScene.test.tsx.snap +++ b/src/__tests__/scenes/__snapshots__/CreateWalletImportScene.test.tsx.snap @@ -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, }, ] } @@ -429,6 +429,7 @@ exports[`CreateWalletImportScene should render with loading props 1`] = ` "alignSelf": "flex-start", "flex": 1, "flexDirection": "row", + "left": 0, }, { "marginBottom": NaN, @@ -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, @@ -459,6 +461,9 @@ exports[`CreateWalletImportScene should render with loading props 1`] = ` { "translateY": undefined, }, + { + "translateX": undefined, + }, ], }, ] @@ -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, }, { diff --git a/src/components/scenes/InputTesterScene.tsx b/src/components/scenes/InputTesterScene.tsx index 4b4475800fd..bcd8a33e8a7 100644 --- a/src/components/scenes/InputTesterScene.tsx +++ b/src/components/scenes/InputTesterScene.tsx @@ -26,6 +26,9 @@ export function InputTesterScene() { const [value0, setValue0] = useState('') const [value1, setValue1] = useState('') const [filledTextInputValue, setFilledTextInputValue] = useState('') + const [filledTextInputValue2, setFilledTextInputValue2] = useState('') + const [filledTextInputValue3, setFilledTextInputValue3] = useState('') + const [filledTextInputValue4, setFilledTextInputValue4] = useState('') const walletId = selectedWallet?.wallet.id ?? '' const tokenId = selectedWallet?.tokenId ?? null const exchangedFlipInputRef = React.useRef(null) @@ -85,6 +88,35 @@ export function InputTesterScene() { placeholder="Test FilledTextInput" maxLength={100} /> + + + ({ backgroundColor: interpolateInputBackgroundColor(focusAnimation, disableAnimation), borderColor: interpolateOutlineColor(focusAnimation, disableAnimation), opacity: interpolate(scale.value, [1, 0.5], [1, 0]), marginHorizontal: interpolate(scale.value, [1, 0], [0, 2 * rem]), - paddingVertical: scale.value * 0.8 * rem + paddingVertical: scale.value * 0.75 * rem })) ] }) @@ -346,15 +347,18 @@ const InnerContainer = styled(Animated.View)<{ hasPlaceholder: boolean }>(theme => ({ hasPlaceholder, focusValue }) => { const rem = theme.rem(1) + const androidHShift = isAndroid ? rem / 8 : 0 + return [ { + left: androidHShift, flex: 1, flexDirection: 'row', alignItems: 'flex-start', alignSelf: 'flex-start' }, useAnimatedStyle(() => { - const shiftValue = interpolate(focusValue.value, [0, 1], [0, rem * 0.4]) + const shiftValue = interpolate(focusValue.value, [0, 1], [0, rem * 0.5]) return { marginTop: hasPlaceholder ? shiftValue : undefined, marginBottom: hasPlaceholder ? -shiftValue : undefined @@ -365,7 +369,8 @@ const InnerContainer = styled(Animated.View)<{ const PrefixAnimatedText = styled(Animated.Text)<{ visibility: SharedValue }>(theme => ({ visibility }) => { const rem = theme.rem(1) - const isAndroid = Platform.OS === 'android' + const androidVShift = isAndroid ? rem / 16 : 0 + return [ { color: theme.secondaryText, @@ -375,34 +380,49 @@ const PrefixAnimatedText = styled(Animated.Text)<{ visibility: SharedValue { return { opacity: visibility.value, - top: isAndroid ? -1 : 0, + top: androidVShift, transform: [{ translateY: (1 - visibility.value) * rem }, { scale: visibility.value }] } }) ] }) -const SuffixText = styled(EdgeText)(theme => ({ - color: theme.secondaryText, - fontFamily: theme.fontFaceDefault, - includeFontPadding: false, - marginRight: theme.rem(1) -})) +const SuffixText = styled(EdgeText)(theme => { + const rem3 = theme.rem(3) + const androidVShift = isAndroid ? rem3 / 16 : 0 + + return { + color: theme.secondaryText, + fontFamily: theme.fontFaceDefault, + includeFontPadding: false, + marginTop: androidVShift, + marginRight: theme.rem(0.5) + } +}) const Placeholder = styled(Animated.View)<{ shift: SharedValue }>(theme => ({ shift }) => { const rem = theme.rem(1) + const androidVShift = isAndroid ? rem / 16 : 0 return [ { position: 'absolute', - top: 0, + top: androidVShift, + left: rem * 0.4, alignItems: 'center', justifyContent: 'center', - paddingHorizontal: theme.rem(0.5), + paddingHorizontal: theme.rem(0), paddingVertical: 0, margin: 0 }, useAnimatedStyle(() => ({ - transform: [{ translateY: interpolate(shift.value, [0, 1], [0, -1.2 * rem]) }] + transform: [ + { + translateY: interpolate(shift.value, [0, 1], [0, -0.9 * rem]) + }, + { + translateX: interpolate(shift.value, [0, 1], [0, -0.4 * rem]) + } + ] })) ] }) @@ -429,7 +449,7 @@ const PlaceholderText = styled(Animated.Text)<{ useAnimatedStyle(() => { return { color: interpolatePlaceholderTextColor(focusAnimation, disableAnimation), - fontSize: interpolate(shift.value, [0, 1], [fontSizeBase, 0.8 * fontSizeBase]) + fontSize: interpolate(shift.value, [0, 1], [fontSizeBase, 0.75 * fontSizeBase]) } }) ] @@ -449,7 +469,7 @@ const StyledAnimatedTextInput = styledWithRef(AnimatedTextInput)<{ flexGrow: 1, flexShrink: 1, fontFamily: theme.fontFaceDefault, - paddingHorizontal: theme.rem(0.5), + paddingHorizontal: 0, paddingVertical: 0, margin: 0 }, @@ -474,7 +494,7 @@ const StyledNumericInput = styledWithRef(NumericInput)<{ flexGrow: 1, flexShrink: 1, fontFamily: theme.fontFaceDefault, - paddingHorizontal: theme.rem(0.5), + paddingHorizontal: 0, paddingVertical: 0, margin: 0 },