Skip to content

Commit 5f754f6

Browse files
committed
feat: add tooptip to v1 for legacy site info
1 parent 0001f5f commit 5f754f6

1 file changed

Lines changed: 51 additions & 4 deletions

File tree

src/components/NavBar/NavItems.tsx

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Toolbar, Grid, Button, Typography, Box } from "@mui/material";
1+
import { Toolbar, Grid, Button, Typography, Box, Tooltip } from "@mui/material";
22
import { Colors } from "design/theme";
33
import React from "react";
44
import { useNavigate, Link } from "react-router-dom";
@@ -96,10 +96,57 @@ const NavItems: React.FC = () => {
9696
{ text: "Wiki", url: "https://neurojson.org/Wiki" },
9797
{ text: "Search", url: RoutesEnum.SEARCH },
9898
{ text: "Databases", url: RoutesEnum.DATABASES },
99-
{ text: "V1", url: "https://neurojson.io/v1" },
100-
].map(({ text, url }) => (
99+
{
100+
text: "V1",
101+
url: "https://neurojson.io/v1",
102+
tooltip: "Visit the previous version of website",
103+
},
104+
].map(({ text, url, tooltip }) => (
101105
<Grid item key={text}>
102-
{url?.startsWith("https") ? (
106+
{tooltip ? (
107+
<Tooltip
108+
title={tooltip}
109+
arrow
110+
componentsProps={{
111+
tooltip: {
112+
sx: {
113+
bgcolor: Colors.lightGray,
114+
color: Colors.darkPurple,
115+
},
116+
},
117+
arrow: {
118+
sx: {
119+
color: Colors.lightGray,
120+
},
121+
},
122+
}}
123+
>
124+
<a
125+
href={url}
126+
target="_blank"
127+
rel="noopener noreferrer"
128+
style={{ textDecoration: "none" }}
129+
>
130+
<Typography
131+
align="center"
132+
fontWeight={600}
133+
lineHeight={"1.5rem"}
134+
letterSpacing={"0.05rem"}
135+
sx={{
136+
color: Colors.white,
137+
transition: "color 0.3s ease, transform 0.3s ease",
138+
textTransform: "uppercase",
139+
"&:hover": {
140+
transform: "scale(1.2)",
141+
cursor: "pointer",
142+
},
143+
}}
144+
>
145+
{text}
146+
</Typography>
147+
</a>
148+
</Tooltip>
149+
) : url?.startsWith("https") ? (
103150
<a
104151
href={url}
105152
target="_blank"

0 commit comments

Comments
 (0)