1
1
import { sendGAEvent } from "@next/third-parties/google"
2
2
3
- import { ListItemButton } from "@mui/material"
3
+ import { Box , ListItemButton , Typography } from "@mui/material"
4
4
5
5
import ExternalLinkSvg from "@/assets/svgs/common/external-link.svg"
6
6
import Link from "@/components/Link"
7
7
8
8
const MenuItem = props => {
9
- const { mode, children, label, href, reloadDocument, isActive, dark, sx } = props
9
+ const { mode, children, label, href, reloadDocument, isActive, isNew , dark, sx } = props
10
10
const isExternal = href ?. startsWith ( "http" )
11
11
12
12
const handleTrackEvent = ( ) => {
@@ -17,7 +17,7 @@ const MenuItem = props => {
17
17
}
18
18
19
19
return (
20
- < Link href = { href } target = { isExternal ? "_blank" : "_self" } reloadDocument = { reloadDocument } >
20
+ < Link href = { href } external = { isExternal } reloadDocument = { reloadDocument } >
21
21
< ListItemButton
22
22
className = "group"
23
23
sx = { {
@@ -39,6 +39,11 @@ const MenuItem = props => {
39
39
onClick = { handleTrackEvent }
40
40
>
41
41
{ children }
42
+ { isNew && (
43
+ < Box sx = { { backgroundColor : "#B5F5EC" , padding : "0 0.8rem" , height : "2rem" , lineHeight : "2rem" , borderRadius : "0.4rem" , ml : "-0.4rem" } } >
44
+ < Typography sx = { { fontSize : "1.2rem" , lineHeight : "2rem" , fontWeight : 600 } } > NEW</ Typography >
45
+ </ Box >
46
+ ) }
42
47
{ mode === "desktop" && isExternal && (
43
48
< span className = "invisible relative -translate-x-2 transition-transform group-hover:visible group-hover:translate-x-0" >
44
49
< ExternalLinkSvg className = "w-[1rem] h-auto" > </ ExternalLinkSvg >
0 commit comments