Skip to content

Commit 0c82d7b

Browse files
committed
Merge branch 'frontend-back-guide'
2 parents 8682965 + 729d257 commit 0c82d7b

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

frontends/web/src/contexts/AppContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type AppContextProps = {
2929
chartDisplay: TChartDisplay;
3030
setActiveSidebar: Dispatch<SetStateAction<boolean>>;
3131
setGuideExists: Dispatch<SetStateAction<boolean>>;
32-
setGuideShown: Dispatch<SetStateAction<boolean>>;
3332
setSidebarStatus: Dispatch<SetStateAction<TSidebarStatus>>;
3433
setHideAmounts: Dispatch<SetStateAction<boolean>>;
3534
setChartDisplay: Dispatch<SetStateAction<TChartDisplay>>;

frontends/web/src/contexts/AppProvider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export const AppProvider = ({ children }: TProps) => {
7777
sidebarStatus,
7878
chartDisplay,
7979
setActiveSidebar,
80-
setGuideShown,
8180
setGuideExists,
8281
setSidebarStatus,
8382
setHideAmounts,

frontends/web/src/contexts/BackButtonContext.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ type TProviderProps = {
4242

4343
export const BackButtonProvider = ({ children }: TProviderProps) => {
4444
const [handlers, sethandlers] = useState<THandler[]>([]);
45-
const { guideShown, setGuideShown } = useContext(AppContext);
45+
const { guideShown, toggleGuide } = useContext(AppContext);
4646

4747
const callTopHandler = useCallback(() => {
4848
// On mobile, the guide covers the whole screen.
4949
// Make the back button remove the guide first.
5050
// On desktop the guide does not cover everything and one can keep navigating while it is visible.
5151
if (runningOnMobile() && guideShown) {
52-
setGuideShown(false);
52+
toggleGuide();
5353
return false;
5454
}
5555

@@ -58,7 +58,7 @@ export const BackButtonProvider = ({ children }: TProviderProps) => {
5858
return topHandler();
5959
}
6060
return true;
61-
}, [handlers, guideShown, setGuideShown]);
61+
}, [handlers, guideShown, toggleGuide]);
6262

6363
const pushHandler = useCallback((handler: THandler) => {
6464
sethandlers((prevStack) => [...prevStack, handler]);

0 commit comments

Comments
 (0)