Skip to content

Commit 8ccba3b

Browse files
committed
fix: back icon
Was having import issues, possibly related to Metro.
1 parent fd1c6e0 commit 8ccba3b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/navigation/MainNavigator.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ import { FeedItemType } from '../screens/Home/HomeScreen';
6767
import { PlanningEventType } from '../utils/Planning';
6868
import { ServiceCategoryType } from '../utils/Services';
6969
import { ParsedUrlDataType } from '../utils/URLHandler';
70+
import { Platform } from 'react-native';
71+
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
7072

7173
export enum MainRoutes {
7274
Main = 'main',
@@ -412,6 +414,14 @@ function getRegularScreens(createTabNavigator: () => React.ReactElement) {
412414
);
413415
}
414416

417+
const backIcon = ({ tintColor }: { tintColor: string }) => (
418+
<Icon
419+
name={Platform.OS === 'ios' ? 'chevron-left' : 'arrow-left'}
420+
size={30}
421+
color={tintColor}
422+
/>
423+
);
424+
415425
function MainStackComponent(props: {
416426
showIntro: boolean;
417427
isloggedIn: boolean;
@@ -423,6 +433,7 @@ function MainStackComponent(props: {
423433
initialRouteName={showIntro ? MainRoutes.Intro : MainRoutes.Main}
424434
screenOptions={{
425435
headerMode: 'float',
436+
headerBackImage: backIcon,
426437
}}
427438
>
428439
{showIntro ? getIntroScreens() : getRegularScreens(createTabNavigator)}

0 commit comments

Comments
 (0)