Fix double border on web hashtag list (#3091)

* add `topBorder` to Views.tsx

* fix double border
This commit is contained in:
Hailey 2024-03-06 11:02:48 -08:00 committed by GitHub
parent 7a592d8140
commit b8f36a8bca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 12 deletions

View file

@ -5,4 +5,6 @@ export function CenteredView({
style,
sideBorders,
...props
}: React.PropsWithChildren<ViewProps & {sideBorders?: boolean}>)
}: React.PropsWithChildren<
ViewProps & {sideBorders?: boolean; topBorder?: boolean}
>)

View file

@ -32,8 +32,11 @@ interface AddedProps {
export function CenteredView({
style,
sideBorders,
topBorder,
...props
}: React.PropsWithChildren<ViewProps & {sideBorders?: boolean}>) {
}: React.PropsWithChildren<
ViewProps & {sideBorders?: boolean; topBorder?: boolean}
>) {
const pal = usePalette('default')
const {isMobile} = useWebMediaQueries()
if (!isMobile) {
@ -46,6 +49,12 @@ export function CenteredView({
})
style = addStyle(style, pal.border)
}
if (topBorder) {
style = addStyle(style, {
borderTopWidth: 1,
})
style = addStyle(style, pal.border)
}
return <View style={style} {...props} />
}