diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-04-21 19:34:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-21 19:34:07 -0500 |
commit | bbc2ab334de06c3ac8069b5e18a2ba76433f2f6a (patch) | |
tree | e909672c07f08e1f45c34542e3e6a4ee9b670bd5 /src/view/com/util/Views.web.tsx | |
parent | 38eb299011672fc840849ae51e67adefef882bec (diff) | |
download | voidsky-bbc2ab334de06c3ac8069b5e18a2ba76433f2f6a.tar.zst |
Hotfix feed sizing (#510)
* Fix home feed sizing on web * Bump api@0.2.8
Diffstat (limited to 'src/view/com/util/Views.web.tsx')
-rw-r--r-- | src/view/com/util/Views.web.tsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/view/com/util/Views.web.tsx b/src/view/com/util/Views.web.tsx index 63121d938..804192a37 100644 --- a/src/view/com/util/Views.web.tsx +++ b/src/view/com/util/Views.web.tsx @@ -25,6 +25,10 @@ import { import {addStyle, colors} from 'lib/styles' import {usePalette} from 'lib/hooks/usePalette' +interface AddedProps { + desktopFixedHeight?: boolean +} + export function CenteredView({ style, ...props @@ -38,8 +42,9 @@ export const FlatList = React.forwardRef(function <ItemT>( contentContainerStyle, style, contentOffset, + desktopFixedHeight, ...props - }: React.PropsWithChildren<FlatListProps<ItemT>>, + }: React.PropsWithChildren<FlatListProps<ItemT> & AddedProps>, ref: React.Ref<RNFlatList>, ) { const pal = usePalette('default') @@ -60,6 +65,9 @@ export const FlatList = React.forwardRef(function <ItemT>( paddingTop: Math.abs(contentOffset.y), }) } + if (desktopFixedHeight) { + style = addStyle(style, styles.fixedHeight) + } return ( <RNFlatList ref={ref} @@ -122,4 +130,7 @@ const styles = StyleSheet.create({ containerDark: { backgroundColor: colors.gray7, }, + fixedHeight: { + height: '100vh', + }, }) |