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