update(back-button-issue): added a circle style back button similar across all screens #96

Merged
amit merged 1 commits from issue-61 into main 2026-10-30 05:08:28 +00:00
1 changed files with 31 additions and 8 deletions
Showing only changes of commit 045ed5fc49 - Show all commits

View File

@ -1,6 +1,7 @@
import React, { useCallback, useEffect, useMemo, useRef } from "react";
import {
Platform,
Pressable,
ScrollView,
StyleSheet,
Text,
@ -10,7 +11,7 @@ import {
import { SafeAreaView } from "react-native-safe-area-context";
import { router, useFocusEffect } 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 { Colors } from "@/theme";
import { useAuthStore } from "@/store/auth.store";
@ -152,14 +153,28 @@ export default function ModulesIndexScreen() {
<SafeAreaView style={styles.safeArea} edges={["top", "left", "right"]}>
<View style={styles.container}>
<View style={styles.header}>
<TouchableOpacity
onPress={() => router.replace("/")}
style={styles.backButton}
<Pressable
accessibilityRole="button"
accessibilityLabel="Go to home"
accessibilityLabel="Go back"
hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}
onPress={() => {
if (router.canGoBack()) {
router.back();
} else {
router.replace("/");
}
}}
style={({ pressed }) => [
styles.backButton,
pressed && styles.backButtonPressed,
]}
>
<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}>All Modules</Text>
<View style={styles.headerActions}>
{isPreviewAdmin ? (
@ -333,7 +348,15 @@ const styles = StyleSheet.create({
backgroundColor: "#FFFFFF",
},
backButton: {
padding: 4,
width: scale(38),
height: scale(38),
borderRadius: scale(19),
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F1F5F9",
},
backButtonPressed: {
backgroundColor: "#E2E8F0",
},
headerTitle: {
fontSize: moderateScale(18),