Fix web home feed sizing and related issues (close #432) (#475)

* Fix web home feed sizing (close #432)

* Fix lint

* Fix positioning of profile not found error

* Fix load latest on mobile

* Fix overflow issues on mobile web (visible in postthread)

* Fix bottom pad on mobile web

* Remove old comment
This commit is contained in:
Paul Frazee 2023-04-15 10:15:30 -07:00 committed by GitHub
parent a79dcd3d38
commit 91fadadb58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 109 additions and 24 deletions

View file

@ -35,6 +35,8 @@ export function CenteredView({
export const FlatList = React.forwardRef(function <ItemT>(
{
contentContainerStyle,
style,
contentOffset,
...props
}: React.PropsWithChildren<FlatListProps<ItemT>>,
ref: React.Ref<RNFlatList>,
@ -43,10 +45,25 @@ export const FlatList = React.forwardRef(function <ItemT>(
contentContainerStyle,
styles.containerScroll,
)
if (contentOffset && contentOffset?.y !== 0) {
// NOTE
// we use paddingTop & contentOffset to space around the floating header
// but reactnative web puts the paddingTop on the wrong element (style instead of the contentContainer)
// so we manually correct it here
// -prf
style = addStyle(style, {
paddingTop: 0,
})
contentContainerStyle = addStyle(contentContainerStyle, {
paddingTop: Math.abs(contentOffset.y),
})
}
return (
<RNFlatList
contentContainerStyle={contentContainerStyle}
ref={ref}
contentContainerStyle={contentContainerStyle}
style={style}
contentOffset={contentOffset}
{...props}
/>
)