Skip to content

Commit 74c2fc3

Browse files
authored
Merge pull request #58 from harmonydata/master
Release button mods for Discovery launch
2 parents 3791130 + e391fcd commit 74c2fc3

2 files changed

Lines changed: 84 additions & 2 deletions

File tree

src/components/ComingSoonDialog.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import React from "react";
2+
import {
3+
Dialog,
4+
DialogTitle,
5+
DialogContent,
6+
DialogActions,
7+
Button,
8+
Typography,
9+
Box,
10+
IconButton,
11+
} from "@mui/material";
12+
import { Close as CloseIcon, Construction } from "@mui/icons-material";
13+
14+
export default function ComingSoonDialog({
15+
open,
16+
onClose,
17+
featureName = "This feature",
18+
}) {
19+
return (
20+
<Dialog
21+
open={open}
22+
onClose={onClose}
23+
maxWidth="sm"
24+
fullWidth
25+
PaperProps={{
26+
sx: {
27+
borderRadius: 2,
28+
},
29+
}}
30+
>
31+
<DialogTitle>
32+
<Box
33+
sx={{
34+
display: "flex",
35+
justifyContent: "space-between",
36+
alignItems: "center",
37+
}}
38+
>
39+
<Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
40+
<Construction sx={{ color: "#ff9800", fontSize: 24 }} />
41+
<Typography variant="h6">Coming Soon</Typography>
42+
</Box>
43+
<IconButton size="small" onClick={onClose}>
44+
<CloseIcon />
45+
</IconButton>
46+
</Box>
47+
</DialogTitle>
48+
<DialogContent dividers>
49+
<Typography variant="body1" color="text.secondary">
50+
{featureName} is coming soon! We're working hard to bring you this
51+
feature.
52+
</Typography>
53+
</DialogContent>
54+
<DialogActions sx={{ p: 3, pt: 2 }}>
55+
<Button onClick={onClose} variant="contained">
56+
Got it
57+
</Button>
58+
</DialogActions>
59+
</Dialog>
60+
);
61+
}

src/components/HarmonySidebar.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { Logout, JoinInner } from "@mui/icons-material/";
2121
import GoogleIcon from "@mui/icons-material/Google";
2222
import GitHubIcon from "@mui/icons-material/GitHub";
2323
import TwitterIcon from "@mui/icons-material/Twitter";
24+
import ComingSoonDialog from "./ComingSoonDialog";
2425

2526
// Get current domain for dynamic links
2627
const getCurrentDomain = () => {
@@ -106,6 +107,8 @@ export default function HarmonySidebar() {
106107
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
107108
const [anchorUser, setAnchorUser] = useState(null);
108109
const [apiVersion, setApiVersion] = useState(null);
110+
const [comingSoonOpen, setComingSoonOpen] = useState(false);
111+
const [comingSoonFeature, setComingSoonFeature] = useState("");
109112

110113
const {
111114
currentUser,
@@ -116,6 +119,16 @@ export default function HarmonySidebar() {
116119
} = useAuth();
117120
const { getVersion } = useData();
118121

122+
const handleNavigationClick = (e, item) => {
123+
// For Browse, Explore, Compare, and Saves, show coming soon dialog
124+
if (["Browse", "Explore", "Compare", "Saves"].includes(item.text)) {
125+
e.preventDefault();
126+
setComingSoonFeature(item.text);
127+
setComingSoonOpen(true);
128+
}
129+
// Search and Harmonise should work normally
130+
};
131+
119132
// Determine if an item is active
120133
const isActive = (item) => {
121134
if (item.text === "Harmonise") {
@@ -215,11 +228,12 @@ export default function HarmonySidebar() {
215228

216229
return (
217230
<ListItemButton
218-
disabled={isExternal}
231+
219232
key={item.text}
220233
component={isExternal ? "a" : Link}
221234
href={isExternal ? item.href : undefined}
222235
to={isExternal ? undefined : item.href}
236+
onClick={(e) => handleNavigationClick(e, item)}
223237
selected={isActive(item)}
224238
sx={{
225239
flexDirection: "column",
@@ -365,10 +379,12 @@ export default function HarmonySidebar() {
365379
return (
366380
<ListItem key={item.text} disablePadding>
367381
<ListItemButton
368-
disabled={isExternal}
382+
383+
369384
component={isExternal ? "a" : Link}
370385
href={isExternal ? item.href : undefined}
371386
to={isExternal ? undefined : item.href}
387+
onClick={(e) => handleNavigationClick(e, item)}
372388
selected={isActive(item)}
373389
sx={{
374390
minHeight: 48,
@@ -594,6 +610,11 @@ export default function HarmonySidebar() {
594610
</Menu>
595611
</Box>
596612
</Box>
613+
<ComingSoonDialog
614+
open={comingSoonOpen}
615+
onClose={() => setComingSoonOpen(false)}
616+
featureName={comingSoonFeature}
617+
/>
597618
</>
598619
);
599620
}

0 commit comments

Comments
 (0)