@@ -21,6 +21,7 @@ import { Logout, JoinInner } from "@mui/icons-material/";
2121import GoogleIcon from "@mui/icons-material/Google" ;
2222import GitHubIcon from "@mui/icons-material/GitHub" ;
2323import TwitterIcon from "@mui/icons-material/Twitter" ;
24+ import ComingSoonDialog from "./ComingSoonDialog" ;
2425
2526// Get current domain for dynamic links
2627const 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,17 @@ export default function HarmonySidebar() {
215228
216229 return (
217230 < ListItemButton
218- disabled = { isExternal }
231+ disabled = {
232+ item . text !== "Search" &&
233+ [ "Browse" , "Explore" , "Compare" , "Saves" ] . includes ( item . text )
234+ ? false
235+ : isExternal
236+ }
219237 key = { item . text }
220238 component = { isExternal ? "a" : Link }
221239 href = { isExternal ? item . href : undefined }
222240 to = { isExternal ? undefined : item . href }
241+ onClick = { ( e ) => handleNavigationClick ( e , item ) }
223242 selected = { isActive ( item ) }
224243 sx = { {
225244 flexDirection : "column" ,
@@ -365,10 +384,18 @@ export default function HarmonySidebar() {
365384 return (
366385 < ListItem key = { item . text } disablePadding >
367386 < ListItemButton
368- disabled = { isExternal }
387+ disabled = {
388+ item . text !== "Search" &&
389+ [ "Browse" , "Explore" , "Compare" , "Saves" ] . includes (
390+ item . text
391+ )
392+ ? false
393+ : isExternal
394+ }
369395 component = { isExternal ? "a" : Link }
370396 href = { isExternal ? item . href : undefined }
371397 to = { isExternal ? undefined : item . href }
398+ onClick = { ( e ) => handleNavigationClick ( e , item ) }
372399 selected = { isActive ( item ) }
373400 sx = { {
374401 minHeight : 48 ,
@@ -594,6 +621,11 @@ export default function HarmonySidebar() {
594621 </ Menu >
595622 </ Box >
596623 </ Box >
624+ < ComingSoonDialog
625+ open = { comingSoonOpen }
626+ onClose = { ( ) => setComingSoonOpen ( false ) }
627+ featureName = { comingSoonFeature }
628+ />
597629 </ >
598630 ) ;
599631}
0 commit comments