fix top border width for user list updates (#4340)

* fix nits in add/remove users from list screen

invert check

use `ViewHeader`

simplify

replace with hairline width

fix top border width for user list updates

* dont use `ViewHeader`

* update one more hairline
zio/stable
Hailey 2024-06-03 16:34:37 -07:00 committed by GitHub
parent 44670c7ee2
commit 8c596b61c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 30 additions and 25 deletions

View File

@ -6,28 +6,30 @@ import {
View, View,
} from 'react-native' } from 'react-native'
import {AppBskyGraphDefs as GraphDefs} from '@atproto/api' import {AppBskyGraphDefs as GraphDefs} from '@atproto/api'
import {Text} from '../util/text/Text' import {msg, Trans} from '@lingui/macro'
import {UserAvatar} from '../util/UserAvatar'
import {MyLists} from '../lists/MyLists'
import {Button} from '../util/forms/Button'
import * as Toast from '../util/Toast'
import {sanitizeDisplayName} from 'lib/strings/display-names'
import {sanitizeHandle} from 'lib/strings/handles'
import {s} from 'lib/styles'
import {usePalette} from 'lib/hooks/usePalette'
import {isWeb, isAndroid, isMobileWeb} from 'platform/detection'
import {Trans, msg} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {cleanError} from '#/lib/strings/errors'
import {useModalControls} from '#/state/modals' import {useModalControls} from '#/state/modals'
import { import {
useDangerousListMembershipsQuery,
getMembership, getMembership,
ListMembersip, ListMembersip,
useDangerousListMembershipsQuery,
useListMembershipAddMutation, useListMembershipAddMutation,
useListMembershipRemoveMutation, useListMembershipRemoveMutation,
} from '#/state/queries/list-memberships' } from '#/state/queries/list-memberships'
import {cleanError} from '#/lib/strings/errors'
import {useSession} from '#/state/session' import {useSession} from '#/state/session'
import {usePalette} from 'lib/hooks/usePalette'
import {sanitizeDisplayName} from 'lib/strings/display-names'
import {sanitizeHandle} from 'lib/strings/handles'
import {s} from 'lib/styles'
import {isAndroid, isMobileWeb, isWeb} from 'platform/detection'
import {MyLists} from '../lists/MyLists'
import {Button} from '../util/forms/Button'
import {Text} from '../util/text/Text'
import * as Toast from '../util/Toast'
import {UserAvatar} from '../util/UserAvatar'
import hairlineWidth = StyleSheet.hairlineWidth
export const snapPoints = ['fullscreen'] export const snapPoints = ['fullscreen']
@ -61,12 +63,23 @@ export function Component({
return [pal.border, {height: screenHeight / 1.5}] return [pal.border, {height: screenHeight / 1.5}]
} }
return [pal.border, {flex: 1, borderTopWidth: 1}] return [pal.border, {flex: 1, borderTopWidth: hairlineWidth}]
}, [pal.border, screenHeight]) }, [pal.border, screenHeight])
return ( return (
<View testID="userAddRemoveListsModal" style={s.hContentRegion}> <View testID="userAddRemoveListsModal" style={s.hContentRegion}>
<Text style={[styles.title, pal.text]}> <Text
style={[
{
textAlign: 'center',
fontWeight: 'bold',
fontSize: 20,
marginBottom: 12,
paddingHorizontal: 12,
},
pal.text,
]}
numberOfLines={1}>
<Trans>Update {displayName} in Lists</Trans> <Trans>Update {displayName} in Lists</Trans>
</Text> </Text>
<MyLists <MyLists
@ -175,9 +188,7 @@ function ListItem({
style={[ style={[
styles.listItem, styles.listItem,
pal.border, pal.border,
{ index !== 0 && {borderTopWidth: hairlineWidth},
borderTopWidth: index === 0 ? 0 : 1,
},
]}> ]}>
<View style={styles.listItemAvi}> <View style={styles.listItemAvi}>
<UserAvatar size={40} avatar={list.avatar} type="list" /> <UserAvatar size={40} avatar={list.avatar} type="list" />
@ -229,12 +240,6 @@ const styles = StyleSheet.create({
container: { container: {
paddingHorizontal: isWeb ? 0 : 16, paddingHorizontal: isWeb ? 0 : 16,
}, },
title: {
textAlign: 'center',
fontWeight: 'bold',
fontSize: 24,
marginBottom: 12,
},
btns: { btns: {
position: 'relative', position: 'relative',
flexDirection: 'row', flexDirection: 'row',
@ -243,7 +248,7 @@ const styles = StyleSheet.create({
gap: 10, gap: 10,
paddingTop: 10, paddingTop: 10,
paddingBottom: isAndroid ? 10 : 0, paddingBottom: isAndroid ? 10 : 0,
borderTopWidth: 1, borderTopWidth: hairlineWidth,
}, },
footerBtn: { footerBtn: {
paddingHorizontal: 24, paddingHorizontal: 24,