From c8fba938d550754a451f9b7c3f4ec52a0ec2d8ed Mon Sep 17 00:00:00 2001 From: moist-webDev Date: Thu, 8 Jun 2023 21:08:11 -0400 Subject: [PATCH] back arrow calls dedicated funtion. --- components/TitleBar.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/TitleBar.tsx b/components/TitleBar.tsx index d936cf8..8cbdcf8 100644 --- a/components/TitleBar.tsx +++ b/components/TitleBar.tsx @@ -2,13 +2,19 @@ import { StyleSheet, Text, View} from 'react-native'; import { AntDesign, Ionicons } from '@expo/vector-icons'; import { Link } from "react-router-native"; -export default function TitleBar({ title='', theme={} , showBack="", setShowBack, setTitle}:any){ +export default function TitleBar({ title='', theme={} , showBack="", setShowBack, setTitle }:any){ const st = style(theme); + + const handleBack = () =>{ + setTitle(showBack) + setShowBack("") + } + return ( - {showBack ? {setTitle(showBack);setShowBack("")}} to={`/${showBack}`}>{showBack} : null} + {showBack ? {showBack} : null} {title} - {showBack ? {showBack} : null} + {showBack ? {showBack} : null} ) }