Skip to content

Commit f2d796d

Browse files
committed
Don't show login on tote bag render
1 parent 4a5000c commit f2d796d

File tree

2 files changed

+11
-3
lines changed
  • frontend/src/screens/App/screens

2 files changed

+11
-3
lines changed

frontend/src/screens/App/screens/MapPane/components/MainMap/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface Props {
2929
className?: string;
3030
panOnClick: boolean;
3131
overlay: overlays.OverlayId;
32+
requireLogin?: boolean;
3233
}
3334

3435
type PropsWithRouter = Props & RouteComponentProps<{ identifier?: string }>;
@@ -148,7 +149,7 @@ All the types got very confusing, sorry.
148149

149150
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
150151
function withRouterRef<
151-
OuterProps,
152+
OuterProps extends Props,
152153
C = React.ComponentType<OuterProps & RouteComponentProps>
153154
>(Component: C) {
154155
return React.forwardRef<C, OuterProps>(function WithRouterRef(props, ref) {
@@ -158,7 +159,10 @@ function withRouterRef<
158159
const { isLoggedInToNonAnonymousAccount, isLoadingMe } = useLoginStore();
159160

160161
// Only show map if user is logged in to a non-anonymous account
161-
const canShowMap = isLoggedInToNonAnonymousAccount && !isLoadingMe;
162+
// But allow override if requireLogin is explicitly set to false
163+
const canShowMap =
164+
props.requireLogin === false ||
165+
(isLoggedInToNonAnonymousAccount && !isLoadingMe);
162166

163167
if (!canShowMap) {
164168
return (

frontend/src/screens/App/screens/ToteBag/components/Back.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ export default function ToteBag(): JSX.Element {
3535
return (
3636
<div className={stylesheet.back} ref={containerRef}>
3737
<div className={stylesheet.map}>
38-
<MainMap panOnClick={false} overlay="default-map" />
38+
<MainMap
39+
panOnClick={false}
40+
overlay="default-map"
41+
requireLogin={false}
42+
/>
3943
</div>
4044
<div className={stylesheet.box}>
4145
<div className={stylesheet.subhead}>

0 commit comments

Comments
 (0)