Merge pull request 'update(back-button-issue): added a circle style back button similar across all screens' (#96) from issue-61 into main
Reviewed-on: https://git.zedobject.local/AcuPedia/acupedia-mobile-ui/pulls/96 Reviewed-by: Amit Salunke <amit@noreply.localhost>
This commit is contained in:
commit
ae903b1c4c
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue