From bbc2ab334de06c3ac8069b5e18a2ba76433f2f6a Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 21 Apr 2023 19:34:07 -0500 Subject: [PATCH] Hotfix feed sizing (#510) * Fix home feed sizing on web * Bump api@0.2.8 --- package.json | 2 +- src/view/com/posts/Feed.tsx | 2 ++ src/view/com/util/Views.web.tsx | 13 ++++++++++++- yarn.lock | 8 ++++---- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index aef018a8..f4e400b0 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "e2e:run": "detox test --configuration ios.sim.debug --take-screenshots all" }, "dependencies": { - "@atproto/api": "0.2.7", + "@atproto/api": "0.2.8", "@bam.tech/react-native-image-resizer": "^3.0.4", "@braintree/sanitize-url": "^6.0.2", "@expo/webpack-config": "^18.0.1", diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx index bd07f9b1..998cfe0c 100644 --- a/src/view/com/posts/Feed.tsx +++ b/src/view/com/posts/Feed.tsx @@ -179,6 +179,8 @@ export const Feed = observer(function Feed({ onEndReachedThreshold={0.6} removeClippedSubviews={true} contentOffset={{x: 0, y: headerOffset * -1}} + // @ts-ignore our .web version only -prf + desktopFixedHeight /> )} diff --git a/src/view/com/util/Views.web.tsx b/src/view/com/util/Views.web.tsx index 63121d93..804192a3 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 ( contentContainerStyle, style, contentOffset, + desktopFixedHeight, ...props - }: React.PropsWithChildren>, + }: React.PropsWithChildren & AddedProps>, ref: React.Ref, ) { const pal = usePalette('default') @@ -60,6 +65,9 @@ export const FlatList = React.forwardRef(function ( paddingTop: Math.abs(contentOffset.y), }) } + if (desktopFixedHeight) { + style = addStyle(style, styles.fixedHeight) + } return (