diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-07-06 20:28:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-06 20:28:10 -0500 |
commit | e14c9783e0cea73ada1d20e8a798738c39319315 (patch) | |
tree | 41be4e050c1e7cf4ade0e0ff1c66342599618935 /src/view/com/composer/Composer.tsx | |
parent | f05c2f06d665cb3a9989154fbc82a2b0ea60669a (diff) | |
download | voidsky-e14c9783e0cea73ada1d20e8a798738c39319315.tar.zst |
[APP-735] Post language improvements (#982)
* Fix composer character-counter bouncing around UI elements * Fix composer toolbar padding when keyboard is dismissed on iOS * Use the full name of the language in the composer footer * Add headings to the DropdownButton * Update the composer language control to use a simpler dropdown * Fix lint * Add translate link to Post component used in notifications * Fix lint
Diffstat (limited to 'src/view/com/composer/Composer.tsx')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index c6a9ecd4a..f2e3cbd63 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -16,6 +16,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {RichText} from '@atproto/api' import {useAnalytics} from 'lib/analytics/analytics' import {UserAutocompleteModel} from 'state/models/discovery/user-autocomplete' +import {useIsKeyboardVisible} from 'lib/hooks/useIsKeyboardVisible' import {ExternalEmbed} from './ExternalEmbed' import {Text} from '../util/text/Text' import * as Toast from '../util/Toast' @@ -35,7 +36,7 @@ import {OpenCameraBtn} from './photos/OpenCameraBtn' import {usePalette} from 'lib/hooks/usePalette' import QuoteEmbed from '../util/post-embeds/QuoteEmbed' import {useExternalLinkFetch} from './useExternalLinkFetch' -import {isDesktopWeb, isAndroid} from 'platform/detection' +import {isDesktopWeb, isAndroid, isIOS} from 'platform/detection' import {GalleryModel} from 'state/models/media/gallery' import {Gallery} from './photos/Gallery' import {MAX_GRAPHEME_LENGTH} from 'lib/constants' @@ -55,6 +56,7 @@ export const ComposePost = observer(function ComposePost({ const pal = usePalette('default') const store = useStores() const textInput = useRef<TextInputRef>(null) + const [isKeyboardVisible] = useIsKeyboardVisible({iosUseWillEvents: true}) const [isProcessing, setIsProcessing] = useState(false) const [processingState, setProcessingState] = useState('') const [error, setError] = useState('') @@ -75,10 +77,11 @@ export const ComposePost = observer(function ComposePost({ const insets = useSafeAreaInsets() const viewStyles = useMemo( () => ({ - paddingBottom: isAndroid ? insets.bottom : 0, + paddingBottom: + isAndroid || (isIOS && !isKeyboardVisible) ? insets.bottom : 0, paddingTop: isAndroid ? insets.top : isDesktopWeb ? 0 : 15, }), - [insets], + [insets, isKeyboardVisible], ) // HACK |