issue(61): fixed back button design similarity and screen settings
This commit is contained in:
parent
abcb9823c2
commit
358bb420a2
|
|
@ -4,6 +4,7 @@ import {
|
|||
BackHandler,
|
||||
Linking,
|
||||
Platform,
|
||||
Pressable,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
|
|
@ -13,7 +14,7 @@ import {
|
|||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { moderateScale, verticalScale } from "react-native-size-matters";
|
||||
import { moderateScale, scale, verticalScale } from "react-native-size-matters";
|
||||
import Constants from "expo-constants";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
|
|
@ -166,15 +167,22 @@ export default function SubscriptionScreen() {
|
|||
return (
|
||||
<SafeAreaView style={styles.safeArea} edges={["top", "bottom", "left", "right"]}>
|
||||
<View style={styles.header}>
|
||||
<TouchableOpacity
|
||||
<Pressable
|
||||
onPress={handleBack}
|
||||
style={styles.backButton}
|
||||
style={({ pressed }) => [
|
||||
styles.backButton,
|
||||
pressed && styles.backButtonPressed,
|
||||
]}
|
||||
hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Go back"
|
||||
>
|
||||
<Ionicons name="chevron-back" size={24} color={Colors.textPrimary} />
|
||||
</TouchableOpacity>
|
||||
<Ionicons
|
||||
name="chevron-back"
|
||||
size={moderateScale(24)}
|
||||
color={Colors.textPrimary}
|
||||
/>
|
||||
</Pressable>
|
||||
<Text style={styles.headerTitle} numberOfLines={1}>
|
||||
{title}
|
||||
</Text>
|
||||
|
|
@ -237,10 +245,15 @@ const styles = StyleSheet.create({
|
|||
backgroundColor: "#FFFFFF",
|
||||
},
|
||||
backButton: {
|
||||
width: moderateScale(36),
|
||||
height: moderateScale(36),
|
||||
alignItems: "center",
|
||||
width: scale(38),
|
||||
height: scale(38),
|
||||
borderRadius: scale(19),
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundColor: "#F1F5F9",
|
||||
},
|
||||
backButtonPressed: {
|
||||
backgroundColor: "#E2E8F0",
|
||||
},
|
||||
headerTitle: {
|
||||
flex: 1,
|
||||
|
|
@ -250,7 +263,7 @@ const styles = StyleSheet.create({
|
|||
textAlign: "center",
|
||||
marginHorizontal: moderateScale(8),
|
||||
},
|
||||
placeholder: { width: moderateScale(36) },
|
||||
placeholder: { width: scale(38), height: scale(38) },
|
||||
scrollContent: {
|
||||
flexGrow: 1,
|
||||
justifyContent: "center",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { type ReactNode, useCallback } from "react";
|
|||
import { BackHandler, Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, useFocusEffect } from "expo-router";
|
||||
import { moderateScale } from "react-native-size-matters";
|
||||
import { moderateScale, scale } from "react-native-size-matters";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
|
||||
|
|
@ -76,16 +76,16 @@ export function ContentPageHeader({
|
|||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Go back"
|
||||
hitSlop={10}
|
||||
hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}
|
||||
onPress={handleBack}
|
||||
style={({ pressed }) => [
|
||||
styles.iconButton,
|
||||
pressed && styles.pressed,
|
||||
styles.backButton,
|
||||
pressed && styles.backButtonPressed,
|
||||
]}
|
||||
>
|
||||
<Ionicons
|
||||
name="chevron-back"
|
||||
size={24}
|
||||
size={moderateScale(24)}
|
||||
color={Colors.textPrimary}
|
||||
/>
|
||||
</Pressable>
|
||||
|
|
@ -139,12 +139,16 @@ const styles = StyleSheet.create({
|
|||
alignItems: "center",
|
||||
justifyContent: "flex-end",
|
||||
},
|
||||
iconButton: {
|
||||
width: 40,
|
||||
height: 40,
|
||||
borderRadius: 20,
|
||||
alignItems: "center",
|
||||
backButton: {
|
||||
width: scale(38),
|
||||
height: scale(38),
|
||||
borderRadius: scale(19),
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundColor: "#F1F5F9",
|
||||
},
|
||||
backButtonPressed: {
|
||||
backgroundColor: "#E2E8F0",
|
||||
},
|
||||
pressed: {
|
||||
opacity: 0.65,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { Platform, Pressable, StyleSheet, Text, TextInput, View } from "react-na
|
|||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
import { moderateScale, scale } from "react-native-size-matters";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
import { useDebouncedValue } from "@/features/content/hooks/use-debounced-value";
|
||||
|
|
@ -150,12 +151,18 @@ export default function FacetedSearchScreen({
|
|||
<SafeAreaView style={styles.safe} edges={["top", "left", "right"]}>
|
||||
<View style={styles.header}>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Go back"
|
||||
hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}
|
||||
onPress={() => router.back()}
|
||||
style={styles.headerButton}
|
||||
style={({ pressed }) => [
|
||||
styles.backButton,
|
||||
pressed && styles.backButtonPressed,
|
||||
]}
|
||||
>
|
||||
<Ionicons
|
||||
name="chevron-back"
|
||||
size={24}
|
||||
size={moderateScale(24)}
|
||||
color={Colors.textPrimary}
|
||||
/>
|
||||
</Pressable>
|
||||
|
|
@ -167,7 +174,7 @@ export default function FacetedSearchScreen({
|
|||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
<View style={styles.headerButton} />
|
||||
<View style={styles.headerPlaceholder} />
|
||||
</View>
|
||||
|
||||
<View style={styles.controls}>
|
||||
|
|
@ -346,7 +353,18 @@ const styles = StyleSheet.create({
|
|||
borderBottomColor: "#ECECEC",
|
||||
backgroundColor: Colors.white,
|
||||
},
|
||||
headerButton: { width: 32, padding: 4 },
|
||||
backButton: {
|
||||
width: scale(38),
|
||||
height: scale(38),
|
||||
borderRadius: scale(19),
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundColor: "#F1F5F9",
|
||||
},
|
||||
backButtonPressed: {
|
||||
backgroundColor: "#E2E8F0",
|
||||
},
|
||||
headerPlaceholder: { width: scale(38), height: scale(38) },
|
||||
headerCenter: { flex: 1, alignItems: "center" },
|
||||
headerTitle: {
|
||||
fontSize: 18,
|
||||
|
|
|
|||
Loading…
Reference in New Issue