From 9b450cf68b60b47ebcb4ca84af9cc07293397567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Vay=C3=A1?= Date: Tue, 19 Nov 2024 11:19:57 +0100 Subject: [PATCH] prevent overlap of clear button, fix font, reduce space on recent statuses (#8322) * prevent overlap of clear button, fix font, reduce space on recent statuses * remove font size * prevent newlines on android external keyboard * move to reducer action * change newline behaviour to space --- .../custom_status/components/custom_status_input.tsx | 12 ++++-------- .../custom_status_suggestion.tsx | 4 +++- app/screens/custom_status/custom_status.tsx | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/screens/custom_status/components/custom_status_input.tsx b/app/screens/custom_status/components/custom_status_input.tsx index bac11f81d..42d82bb50 100644 --- a/app/screens/custom_status/components/custom_status_input.tsx +++ b/app/screens/custom_status/components/custom_status_input.tsx @@ -8,6 +8,7 @@ import {TextInput, View} from 'react-native'; import ClearButton from '@components/custom_status/clear_button'; import {CUSTOM_STATUS_TEXT_CHARACTER_LIMIT} from '@constants/custom_status'; import {changeOpacity, getKeyboardAppearanceFromTheme, makeStyleSheetFromTheme} from '@utils/theme'; +import {typography} from '@utils/typography'; import CustomStatusEmoji from './custom_status_emoji'; @@ -29,24 +30,19 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { marginRight: 16, marginLeft: 52, }, - clearButton: { - position: 'absolute', - top: 3, - right: 14, - }, input: { alignSelf: 'stretch', color: theme.centerChannelColor, flex: 1, - fontSize: 17, paddingHorizontal: 16, textAlignVertical: 'center', height: '100%', + ...typography('Body', 200, 'Regular'), }, inputContainer: { justifyContent: 'center', alignItems: 'center', - height: 48, + height: 80, backgroundColor: theme.centerChannelBg, flexDirection: 'row', }, @@ -83,11 +79,11 @@ const CustomStatusInput = ({emoji, isStatusSet, onChangeText, onClearHandle, onO style={style.input} secureTextEntry={false} underlineColorAndroid='transparent' + multiline={true} value={text} /> {isStatusSet ? ( { paddingTop: 14, paddingBottom: 14, justifyContent: 'center', - width: '70%', + width: '93%', flex: 1, }, divider: { @@ -57,6 +58,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { }, customStatusText: { color: theme.centerChannelColor, + ...typography('Body', 200, 'Regular'), }, }; }); diff --git a/app/screens/custom_status/custom_status.tsx b/app/screens/custom_status/custom_status.tsx index 5422c315d..361c9e6d9 100644 --- a/app/screens/custom_status/custom_status.tsx +++ b/app/screens/custom_status/custom_status.tsx @@ -128,7 +128,7 @@ function reducer(state: NewStatusType, action: { return state; } case 'text': - return {...state, text: action.value}; + return {...state, text: action.value?.replace('\n', ' ')}; case 'emoji': return {...state, emoji: action.value}; case 'duration':