diff options
author | dan <dan.abramov@gmail.com> | 2023-09-08 01:36:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-07 17:36:08 -0700 |
commit | 8a93321fb1bd4991cbb3bd1c1f09ed2196182f93 (patch) | |
tree | 2cd7cbfa0eb98a808517c8485af3ec43c0a7ea2e /src/view/shell/Composer.web.tsx | |
parent | 69209c988fc412a10a5028ca915f99b1d059f5ec (diff) | |
download | voidsky-8a93321fb1bd4991cbb3bd1c1f09ed2196182f93.tar.zst |
Give explicit names to MobX observer components (#1413)
* Consider observer(...) as components * Add display names to MobX observers * Temporarily suppress nested components * Suppress new false positives for react/prop-types
Diffstat (limited to 'src/view/shell/Composer.web.tsx')
-rw-r--r-- | src/view/shell/Composer.web.tsx | 86 |
1 files changed, 42 insertions, 44 deletions
diff --git a/src/view/shell/Composer.web.tsx b/src/view/shell/Composer.web.tsx index b32ba90c4..f4b2d9a4c 100644 --- a/src/view/shell/Composer.web.tsx +++ b/src/view/shell/Composer.web.tsx @@ -8,54 +8,52 @@ import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' const BOTTOM_BAR_HEIGHT = 61 -export const Composer = observer( - ({ - active, - replyTo, - quote, - onPost, - onClose, - mention, - }: { - active: boolean - winHeight: number - replyTo?: ComposerOpts['replyTo'] - quote: ComposerOpts['quote'] - onPost?: ComposerOpts['onPost'] - onClose: () => void - mention?: ComposerOpts['mention'] - }) => { - const pal = usePalette('default') - const {isMobile} = useWebMediaQueries() +export const Composer = observer(function ComposerImpl({ + active, + replyTo, + quote, + onPost, + onClose, + mention, +}: { + active: boolean + winHeight: number + replyTo?: ComposerOpts['replyTo'] + quote: ComposerOpts['quote'] + onPost?: ComposerOpts['onPost'] + onClose: () => void + mention?: ComposerOpts['mention'] +}) { + const pal = usePalette('default') + const {isMobile} = useWebMediaQueries() - // rendering - // = + // rendering + // = - if (!active) { - return <View /> - } + if (!active) { + return <View /> + } - return ( - <View style={styles.mask} aria-modal accessibilityViewIsModal> - <View - style={[ - styles.container, - isMobile && styles.containerMobile, - pal.view, - pal.border, - ]}> - <ComposePost - replyTo={replyTo} - quote={quote} - onPost={onPost} - onClose={onClose} - mention={mention} - /> - </View> + return ( + <View style={styles.mask} aria-modal accessibilityViewIsModal> + <View + style={[ + styles.container, + isMobile && styles.containerMobile, + pal.view, + pal.border, + ]}> + <ComposePost + replyTo={replyTo} + quote={quote} + onPost={onPost} + onClose={onClose} + mention={mention} + /> </View> - ) - }, -) + </View> + ) +}) const styles = StyleSheet.create({ mask: { |