mirror of
https://github.com/hanzo-io/chat.git
synced 2026-10-30 18:57:58 +00:00
* feat: Camera functionality and UI changes * chore: moved all buttons to Buttons folder * chore: add back comments --------- Co-authored-by: Nikhil Kothari <[email protected]>
25 lines
908 B
TypeScript
25 lines
908 B
TypeScript
import { useColorScheme } from "@hooks/useColorScheme"
|
|
import ChevronLeftIcon from '@assets/icons/ChevronLeftIcon.svg';
|
|
import { router, useLocalSearchParams } from "expo-router";
|
|
import { TouchableOpacity } from "react-native-gesture-handler";
|
|
|
|
const HeaderBackButton = () => {
|
|
|
|
const colors = useColorScheme()
|
|
|
|
const { site_id } = useLocalSearchParams<{ site_id: string }>()
|
|
|
|
const goBack = () => {
|
|
router.canGoBack() ? router.back() : router.replace(`/${site_id}`)
|
|
}
|
|
|
|
return (
|
|
// Importing TouchableOpacity from react-native-gesture-handler so that it works on android
|
|
// Ref: https://github.com/software-mansion/react-native-screens/issues/2219#issuecomment-2697125799
|
|
<TouchableOpacity onPress={goBack} hitSlop={10}>
|
|
<ChevronLeftIcon stroke={colors.colors.foreground} />
|
|
</TouchableOpacity>
|
|
)
|
|
}
|
|
|
|
export default HeaderBackButton |