mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-08 07:56:12 +02:00
feat(header): correctly gray out disabled menu links
This commit is contained in:
@@ -9,7 +9,11 @@ interface IHeaderProps {
|
|||||||
|
|
||||||
function MenuItem({ children, to }: PropsWithChildren<{ to: string }>) {
|
function MenuItem({ children, to }: PropsWithChildren<{ to: string }>) {
|
||||||
return (
|
return (
|
||||||
<SC.MenuItem to={to} activeClassName="active">
|
<SC.MenuItem
|
||||||
|
to={to}
|
||||||
|
activeClassName="active"
|
||||||
|
className={to === "/" ? "disabled" : ""}
|
||||||
|
>
|
||||||
<SC.MenuItemText>{children}</SC.MenuItemText>
|
<SC.MenuItemText>{children}</SC.MenuItemText>
|
||||||
<SC.MenuItemLine />
|
<SC.MenuItemLine />
|
||||||
</SC.MenuItem>
|
</SC.MenuItem>
|
||||||
|
|||||||
@@ -158,14 +158,16 @@ export const MenuItem = styled(Link)`
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[href="/"] {
|
&.disabled {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[href="/"] ${MenuItemLine} {
|
&.disabled ${MenuItemLine} {
|
||||||
bottom: 50%;
|
bottom: 50%;
|
||||||
|
background: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
|
|||||||
Reference in New Issue
Block a user