@@ -6,6 +6,7 @@ import Footer from './Footer';
6import useBreakpoints from 'lib/useBreakpoints';
6import useBreakpoints from 'lib/useBreakpoints';
7import MiniBackButton from './MiniBackButton';
7import MiniBackButton from './MiniBackButton';
8import { useHistory } from 'store/history';
8import { useHistory } from 'store/history';
9+import NavHeader from './NavHeader';
10const EXPECT_LOGOUT_WHEN_POPPING_AT_DEPTH = 2;
11const EXPECT_LOGOUT_WHEN_POPPING_AT_DEPTH = 2;
@@ -29,9 +30,32 @@ function View({
30 const goBack = useCallback(() => pop(), [pop]);
31 const goBack = useCallback(() => pop(), [pop]);
33+ const goLogout = useCallback(() => pop(size - 1), [pop, size]);
32 const showBackButton = size > 1 && !!pop;
35 const showBackButton = size > 1 && !!pop;
33 const backIsLogout = size === EXPECT_LOGOUT_WHEN_POPPING_AT_DEPTH;
36 const backIsLogout = size === EXPECT_LOGOUT_WHEN_POPPING_AT_DEPTH;
38+ const Header = useCallback(
40+ return showBackButton ? (
43+ className={cn(insetPadding, 'flex-row-r justify-between pb5')}>
47+ className="f5 gray4 underline mr2 pointer">
50+ <Flex.Item as={NavHeader.Target} />
53+ <Flex.Item className={insetPadding} as={NavHeader.Target} />
56+ [insetPadding, showBackButton]
37 row={!isMobile}
61 row={!isMobile}
@@ -51,7 +75,7 @@ function View({
52 style={{ width: '48px' }}
76 style={{ width: '48px' }}
53 className={cn(insetPadding)}>
77 className={cn(insetPadding)}>
54− {showBackButton && (
78+ {showBackButton && !backIsLogout && (
55 <MiniBackButton
79 <MiniBackButton
56 hpadding={!isMobile}
80 hpadding={!isMobile}
57 vpadding={isMobile}
81 vpadding={isMobile}
@@ -62,7 +86,10 @@ function View({
62 </Flex.Item>
86 </Flex.Item>
64 <Flex.Item flex={1} as={Flex} col justify="between">
88 <Flex.Item flex={1} as={Flex} col justify="between">
65− <Flex.Item className={cn('pb5', insetPadding)}>{children}</Flex.Item>
89+ <Flex.Item className="pb5 ">
90+ <Header logout={goBack} />
66 <Flex.Item as={Footer.Target} />
93 <Flex.Item as={Footer.Target} />
67 </Flex.Item>
94 </Flex.Item>