diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-09-05 10:42:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-05 10:42:19 -0700 |
commit | 764c7cd5694a41c98d8543b68d7791fa90db4291 (patch) | |
tree | 8a11af0aa0e898cf7fb57ab0354f9fb5d28f004e /src/view/screens/PreferencesHomeFeed.tsx | |
parent | be8084ae103064d5680485f25e202c763957f2b4 (diff) | |
download | voidsky-764c7cd5694a41c98d8543b68d7791fa90db4291.tar.zst |
Updates to use dynamic/responsive styles on web (#1351)
* Move most responsive queries to the hook * Fix invalid CSS value * Fixes to tablet render of post thread * Fix overflow issues on web * Fix search header on tablet * Fix QP margin in web composer * Fix: only apply double gutter once to flatlist (close #1368) * Fix styles on discover feeds header * Fix double discover links in multifeed
Diffstat (limited to 'src/view/screens/PreferencesHomeFeed.tsx')
-rw-r--r-- | src/view/screens/PreferencesHomeFeed.tsx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/view/screens/PreferencesHomeFeed.tsx b/src/view/screens/PreferencesHomeFeed.tsx index b04f274f7..bd6dd8b39 100644 --- a/src/view/screens/PreferencesHomeFeed.tsx +++ b/src/view/screens/PreferencesHomeFeed.tsx @@ -6,7 +6,8 @@ import {Text} from '../com/util/text/Text' import {useStores} from 'state/index' import {s, colors} from 'lib/styles' import {usePalette} from 'lib/hooks/usePalette' -import {isWeb, isDesktopWeb} from 'platform/detection' +import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' +import {isWeb} from 'platform/detection' import {ToggleButton} from 'view/com/util/forms/ToggleButton' import {CommonNavigatorParams, NativeStackScreenProps} from 'lib/routes/types' import {ViewHeader} from 'view/com/util/ViewHeader' @@ -50,6 +51,7 @@ type Props = NativeStackScreenProps< export const PreferencesHomeFeed = observer(({navigation}: Props) => { const pal = usePalette('default') const store = useStores() + const {isTabletOrDesktop} = useWebMediaQueries() return ( <CenteredView @@ -58,10 +60,11 @@ export const PreferencesHomeFeed = observer(({navigation}: Props) => { pal.view, pal.border, styles.container, - isDesktopWeb && styles.desktopContainer, + isTabletOrDesktop && styles.desktopContainer, ]}> <ViewHeader title="Home Feed Preferences" showOnDesktop /> - <View style={styles.titleSection}> + <View + style={[styles.titleSection, isTabletOrDesktop && {paddingTop: 20}]}> <Text type="xl" style={[pal.textLight, styles.description]}> Fine-tune the content you see on your home screen. </Text> @@ -122,7 +125,12 @@ export const PreferencesHomeFeed = observer(({navigation}: Props) => { </View> </ScrollView> - <View style={[styles.btnContainer, pal.borderDark]}> + <View + style={[ + styles.btnContainer, + !isTabletOrDesktop && {borderTopWidth: 1, paddingHorizontal: 20}, + pal.borderDark, + ]}> <TouchableOpacity testID="confirmBtn" onPress={() => { @@ -130,7 +138,7 @@ export const PreferencesHomeFeed = observer(({navigation}: Props) => { ? navigation.goBack() : navigation.navigate('Settings') }} - style={[styles.btn, isDesktopWeb && styles.btnDesktop]} + style={[styles.btn, isTabletOrDesktop && styles.btnDesktop]} accessibilityRole="button" accessibilityLabel="Confirm" accessibilityHint=""> @@ -144,15 +152,15 @@ export const PreferencesHomeFeed = observer(({navigation}: Props) => { const styles = StyleSheet.create({ container: { flex: 1, - paddingBottom: isDesktopWeb ? 40 : 90, + paddingBottom: 90, }, desktopContainer: { borderLeftWidth: 1, borderRightWidth: 1, + paddingBottom: 40, }, titleSection: { paddingBottom: 30, - paddingTop: isDesktopWeb ? 20 : 0, }, title: { textAlign: 'center', @@ -184,7 +192,6 @@ const styles = StyleSheet.create({ }, btnContainer: { paddingTop: 20, - borderTopWidth: isDesktopWeb ? 0 : 1, }, dimmed: { opacity: 0.3, |