fix borders for labels tab (#3261)

* fix borders for labels tab

* rm entire wrapping view
zio/stable
Hailey 2024-03-19 07:56:28 -07:00 committed by GitHub
parent 9c49b209ca
commit 4de8e8fa14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 39 deletions

View File

@ -48,7 +48,6 @@ export const ProfileLabelsSection = React.forwardRef<
}, },
ref, ref,
) { ) {
const t = useTheme()
const {_} = useLingui() const {_} = useLingui()
const {height: minHeight} = useSafeAreaFrame() const {height: minHeight} = useSafeAreaFrame()
@ -66,37 +65,26 @@ export const ProfileLabelsSection = React.forwardRef<
})) }))
return ( return (
<CenteredView> <CenteredView style={{flex: 1, minHeight}} sideBorders>
<View {isLabelerLoading ? (
style={[ <View style={[a.w_full, a.align_center]}>
a.border_l, <Loader size="xl" />
a.border_r, </View>
a.border_t, ) : labelerError || !labelerInfo ? (
t.atoms.border_contrast_low, <ErrorState
{ error={
minHeight, labelerError?.toString() ||
}, _(msg`Something went wrong, please try again.`)
]}> }
{isLabelerLoading ? ( />
<View style={[a.w_full, a.align_center]}> ) : (
<Loader size="xl" /> <ProfileLabelsSectionInner
</View> moderationOpts={moderationOpts}
) : labelerError || !labelerInfo ? ( labelerInfo={labelerInfo}
<ErrorState scrollElRef={scrollElRef}
error={ headerHeight={headerHeight}
labelerError?.toString() || />
_(msg`Something went wrong, please try again.`) )}
}
/>
) : (
<ProfileLabelsSectionInner
moderationOpts={moderationOpts}
labelerInfo={labelerInfo}
scrollElRef={scrollElRef}
headerHeight={headerHeight}
/>
)}
</View>
</CenteredView> </CenteredView>
) )
}) })
@ -149,13 +137,7 @@ export function ProfileLabelsSectionInner({
}} }}
contentOffset={{x: 0, y: headerHeight * -1}} contentOffset={{x: 0, y: headerHeight * -1}}
onScroll={scrollHandler}> onScroll={scrollHandler}>
<View <View style={[a.pt_xl, a.px_lg, a.border_t, t.atoms.border_contrast_low]}>
style={[
a.pt_xl,
a.px_lg,
isNative && a.border_t,
t.atoms.border_contrast_low,
]}>
<View> <View>
<Text style={[t.atoms.text_contrast_high, a.leading_snug, a.text_sm]}> <Text style={[t.atoms.text_contrast_high, a.leading_snug, a.text_sm]}>
<Trans> <Trans>