back arrow calls dedicated funtion.
This commit is contained in:
parent
a22373f0c1
commit
c8fba938d5
|
|
@ -4,11 +4,17 @@ import { Link } from "react-router-native";
|
|||
|
||||
export default function TitleBar({ title='', theme={} , showBack="", setShowBack, setTitle }:any){
|
||||
const st = style(theme);
|
||||
|
||||
const handleBack = () =>{
|
||||
setTitle(showBack)
|
||||
setShowBack("")
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={style(theme).container}>
|
||||
{showBack ? <Link onPress={()=>{setTitle(showBack);setShowBack("")}} to={`/${showBack}`}><Text style={st.back}><Ionicons name="chevron-back" size={16} />{showBack}</Text></Link> : null}
|
||||
{showBack ? <Link onPress={handleBack} to={`/${showBack}`}><Text style={st.back}><Ionicons name="chevron-back" size={16} />{showBack}</Text></Link> : null}
|
||||
<Text style={st.title}>{title}</Text>
|
||||
{showBack ? <Link><Text style={{...st.back, ...st.hidden}}><Ionicons name="chevron-back" size={16} />{showBack}</Text></Link> : null}
|
||||
{showBack ? <View><Text style={{...st.back, ...st.hidden}}><Ionicons name="chevron-back" size={16} />{showBack}</Text></View> : null}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue