From 358bb420a256830481ffea5ffd48796bdc46ecd4 Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 22 Oct 2026 13:26:45 +0530 Subject: [PATCH] issue(61): fixed back button design similarity and screen settings --- src/app/subscription/index.tsx | 31 +++++++++++++------ .../components/layout/ContentPageHeader.tsx | 24 ++++++++------ .../search/screens/FacetedSearchScreen.tsx | 26 +++++++++++++--- 3 files changed, 58 insertions(+), 23 deletions(-) diff --git a/src/app/subscription/index.tsx b/src/app/subscription/index.tsx index 674dd3d..58ebf86 100644 --- a/src/app/subscription/index.tsx +++ b/src/app/subscription/index.tsx @@ -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 ( - [ + styles.backButton, + pressed && styles.backButtonPressed, + ]} hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }} accessibilityRole="button" accessibilityLabel="Go back" > - - + + {title} @@ -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", diff --git a/src/features/content/components/layout/ContentPageHeader.tsx b/src/features/content/components/layout/ContentPageHeader.tsx index 117d469..2298596 100644 --- a/src/features/content/components/layout/ContentPageHeader.tsx +++ b/src/features/content/components/layout/ContentPageHeader.tsx @@ -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({ [ - styles.iconButton, - pressed && styles.pressed, + styles.backButton, + pressed && styles.backButtonPressed, ]} > @@ -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, diff --git a/src/features/search/screens/FacetedSearchScreen.tsx b/src/features/search/screens/FacetedSearchScreen.tsx index 382eba2..f968b68 100644 --- a/src/features/search/screens/FacetedSearchScreen.tsx +++ b/src/features/search/screens/FacetedSearchScreen.tsx @@ -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({ router.back()} - style={styles.headerButton} + style={({ pressed }) => [ + styles.backButton, + pressed && styles.backButtonPressed, + ]} > @@ -167,7 +174,7 @@ export default function FacetedSearchScreen({ ) : null} - + @@ -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, -- 2.34.1