Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

adjust height of list based on screen size (#2678)

authored by

Hailey and committed by
GitHub
c3b4ce43 45291f17

+19 -3
+19 -3
src/view/com/modals/UserAddRemoveLists.tsx
··· 1 1 import React, {useCallback} from 'react' 2 - import {ActivityIndicator, StyleSheet, View} from 'react-native' 2 + import { 3 + ActivityIndicator, 4 + StyleSheet, 5 + useWindowDimensions, 6 + View, 7 + } from 'react-native' 3 8 import {AppBskyGraphDefs as GraphDefs} from '@atproto/api' 4 9 import {Text} from '../util/text/Text' 5 10 import {UserAvatar} from '../util/UserAvatar' ··· 10 15 import {sanitizeHandle} from 'lib/strings/handles' 11 16 import {s} from 'lib/styles' 12 17 import {usePalette} from 'lib/hooks/usePalette' 13 - import {isWeb, isAndroid} from 'platform/detection' 18 + import {isWeb, isAndroid, isMobileWeb} from 'platform/detection' 14 19 import {Trans, msg} from '@lingui/macro' 15 20 import {useLingui} from '@lingui/react' 16 21 import {useModalControls} from '#/state/modals' ··· 41 46 }) { 42 47 const {closeModal} = useModalControls() 43 48 const pal = usePalette('default') 49 + const {height: screenHeight} = useWindowDimensions() 44 50 const {_} = useLingui() 45 51 const {data: memberships} = useDangerousListMembershipsQuery() 46 52 ··· 48 54 closeModal() 49 55 }, [closeModal]) 50 56 57 + const listStyle = React.useMemo(() => { 58 + if (isMobileWeb) { 59 + return [pal.border, {height: screenHeight / 2}] 60 + } else if (isWeb) { 61 + return [pal.border, {height: screenHeight / 1.5}] 62 + } 63 + 64 + return [pal.border, {flex: 1}] 65 + }, [pal.border, screenHeight]) 66 + 51 67 return ( 52 68 <View testID="userAddRemoveListsModal" style={s.hContentRegion}> 53 69 <Text style={[styles.title, pal.text]}> ··· 68 84 onRemove={onRemove} 69 85 /> 70 86 )} 71 - style={[styles.list, pal.border]} 87 + style={listStyle} 72 88 /> 73 89 <View style={[styles.btns, pal.border]}> 74 90 <Button