Skip to content

Commit 6e50d0c

Browse files
authored
Remove email requirement to view map (#1283)
Reverts temporarily email requirement in #1251 Was put in place due to costs. Switch to Maplibre shows costs are now negligible.
1 parent 3a6cf79 commit 6e50d0c

File tree

4 files changed

+15
-130
lines changed

4 files changed

+15
-130
lines changed

frontend/src/screens/App/screens/AnnouncementBanner/AnnouncementRegistry.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ import React from 'react';
22
import Announcment from './Announcement';
33

44
const ANNOUNCEMENTS_REGISTRY: Announcment[] = [
5-
{
6-
id: 'email-required',
7-
expiresAt: new Date('2026-01-18'),
8-
render: () => (
9-
<React.Fragment>
10-
Due to high usage, an email address is temporarily required to access
11-
the map.
12-
</React.Fragment>
13-
),
14-
},
155
{
166
id: 'zoom',
177
expiresAt: new Date('2025-01-31'),
Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1 @@
1-
import React from 'react';
2-
3-
import MapLibreMap from './MapLibreMap';
4-
5-
import LoginForm from 'shared/components/LoginForm';
6-
import useLoginStore from 'shared/stores/LoginStore';
7-
import { MapInterface } from './MapInterface';
8-
import * as overlays from './overlays';
9-
10-
// Export the OverlayId type from the appropriate module
11-
export { OverlayId } from './overlays';
12-
13-
interface Props {
14-
className?: string;
15-
panOnClick: boolean;
16-
overlay: overlays.OverlayId;
17-
requireLogin?: boolean;
18-
}
19-
20-
// Simple component that switches between implementations
21-
const MainMap = React.forwardRef<MapInterface, Props>((props, ref) => {
22-
const { isLoggedInToNonAnonymousAccount, isLoadingMe } = useLoginStore();
23-
24-
// Only show map if user is logged in to a non-anonymous account
25-
// But allow override if requireLogin is explicitly set to false
26-
const canShowMap =
27-
props.requireLogin === false ||
28-
(isLoggedInToNonAnonymousAccount && !isLoadingMe);
29-
30-
if (!canShowMap) {
31-
return (
32-
<div
33-
style={{
34-
height: '100%',
35-
display: 'flex',
36-
alignItems: 'center',
37-
justifyContent: 'center',
38-
backgroundColor: '#f5f5f5',
39-
padding: '2rem',
40-
}}
41-
>
42-
<div
43-
style={{
44-
textAlign: 'center',
45-
maxWidth: '400px',
46-
}}
47-
>
48-
<h2>Login Required</h2>
49-
<p>Please log in to view the map.</p>
50-
<LoginForm newEmailBehavior="create" />
51-
</div>
52-
</div>
53-
);
54-
}
55-
56-
return <MapLibreMap ref={ref} {...props} />;
57-
});
58-
59-
MainMap.displayName = 'MainMap';
60-
61-
export default MainMap;
1+
export { default, OverlayId } from './MapLibreMap';

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ export default function ToteBag(): JSX.Element {
3333
return (
3434
<div className={stylesheet.back} ref={containerRef}>
3535
<div className={stylesheet.map}>
36-
<MainMap
37-
panOnClick={false}
38-
overlay="default-map"
39-
requireLogin={false}
40-
/>
36+
<MainMap panOnClick={false} overlay="default-map" />
4137
</div>
4238
<div className={stylesheet.box}>
4339
<div className={stylesheet.subhead}>

frontend/src/screens/App/screens/Welcome/index.tsx

Lines changed: 13 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import React from 'react';
22
import { useFeatureFlag } from 'screens/App/shared/stores/FeatureFlagsStore';
33
import FeatureFlag from 'screens/App/shared/types/FeatureFlag';
44
import Button from 'shared/components/Button';
5-
import LoginForm from 'shared/components/LoginForm';
6-
import useLoginStore from 'shared/stores/LoginStore';
75

86
import PhotoAsideModal from '../PhotoAsideModal';
97
import carouselImages from './carouselImages';
@@ -12,9 +10,6 @@ import classNames from 'classnames';
1210

1311
import stylesheet from './welcome.less';
1412

15-
// Set to false to disable email requirement
16-
const REQUIRE_EMAIL = true;
17-
1813
interface Props {
1914
isOpen: boolean;
2015
onRequestClose: () => void;
@@ -26,17 +21,8 @@ export default function Welcome({
2621
// Used to hide this annoying modal in development
2722
const isWelcomeDisabled = useFeatureFlag(FeatureFlag.DISABLE_WELCOME_MODAL);
2823

29-
const { isLoggedInToNonAnonymousAccount, isLoadingMe } = useLoginStore();
30-
31-
// Only require login if REQUIRE_EMAIL is true
32-
const isEmailRequirementMet = REQUIRE_EMAIL
33-
? isLoggedInToNonAnonymousAccount && !isLoadingMe
34-
: true;
35-
3624
const handleClose = (): void => {
37-
if (isEmailRequirementMet) {
38-
onRequestClose();
39-
}
25+
onRequestClose();
4026
};
4127

4228
return (
@@ -45,7 +31,7 @@ export default function Welcome({
4531
className={stylesheet.welcomeModal}
4632
onRequestClose={handleClose}
4733
shouldCloseOnOverlayClick={false}
48-
shouldCloseOnEsc={isEmailRequirementMet}
34+
shouldCloseOnEsc={true}
4935
size="large"
5036
isCloseButtonVisible={false}
5137
carouselProps={{
@@ -66,31 +52,6 @@ export default function Welcome({
6652
<br />
6753
<strong>Zoom in! Every dot&nbsp;is&nbsp;a&nbsp;photo.</strong>
6854
</p>
69-
70-
{REQUIRE_EMAIL && !isEmailRequirementMet ? (
71-
<div className={stylesheet.loginSection}>
72-
<p>
73-
<strong>
74-
An email address is temporarily required to access the site.
75-
</strong>
76-
</p>
77-
<LoginForm newEmailBehavior="create" />
78-
</div>
79-
) : (
80-
<div
81-
className={classNames(
82-
stylesheet.buttonContainer,
83-
stylesheet.mobileButton,
84-
stylesheet.mobileOnly
85-
)}
86-
onClick={handleClose}
87-
>
88-
<Button buttonStyle="primary" className={stylesheet.explore}>
89-
Start Exploring
90-
</Button>
91-
</div>
92-
)}
93-
9455
<hr />
9556
<p className={stylesheet.finePrint}>
9657
The photos on this site were retrieved from the NYC Department of
@@ -139,19 +100,17 @@ export default function Welcome({
139100
</a>
140101
</p>
141102
</div>
142-
{(!REQUIRE_EMAIL || isEmailRequirementMet) && (
143-
<div
144-
className={classNames(
145-
stylesheet.buttonContainer,
146-
stylesheet.desktopOnly
147-
)}
148-
onClick={handleClose}
149-
>
150-
<Button buttonStyle="primary" className={stylesheet.explore}>
151-
Start Exploring
152-
</Button>
153-
</div>
154-
)}
103+
<div
104+
className={classNames(
105+
stylesheet.buttonContainer,
106+
stylesheet.desktopOnly
107+
)}
108+
onClick={handleClose}
109+
>
110+
<Button buttonStyle="primary" className={stylesheet.explore}>
111+
Start Exploring
112+
</Button>
113+
</div>
155114
</div>
156115
</PhotoAsideModal>
157116
);

0 commit comments

Comments
 (0)