Skip to content

Merge develop into testnet #1854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/components/Header/MenusComp/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@
justify-content: space-between;

.icon {
margin-left: auto;
transform: rotate(180deg);
transition: transform 0.1s;
}
}

.headerMenusItem {
--dim-color: rgb(244 244 245);

position: relative;
color: white;
display: flex;
align-items: center;
Expand All @@ -118,6 +122,30 @@
font-weight: medium;
color: var(--primary-color);
}

&[data-popup] {
&::after {
position: absolute;
top: calc(100% + 10px);
display: none;
content: attr(data-popup);
white-space: nowrap;
padding: 2px 20px;
background: var(--dim-color);
color: #333;
left: 50%;
transform: translateX(-50%);
border-radius: 2px;
box-shadow: 0 4px 4px 0 rgb(16 16 16 / 5%);
opacity: 0.8;
}

&:hover {
&::after {
display: block;
}
}
}
}

.moreMenus {
Expand Down
82 changes: 52 additions & 30 deletions src/components/Header/MenusComp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,25 +248,37 @@ export default memo(({ isMobile }: { isMobile: boolean }) => {
<MobileMenuItem>
{menuList
.filter(menu => menu.name !== undefined)
.map(menu =>
// eslint-disable-next-line no-nested-ternary
menu.children ? (
<SubmenuDropdown key={menu.name} menu={menu.children}>
<MobileMenuOuterLink className={styles.mobileSubmenuTrigger}>
.map(menu => {
if (menu.children) {
return (
<SubmenuDropdown key={menu.name} menu={menu.children}>
<MobileMenuOuterLink className={styles.mobileSubmenuTrigger}>
{menu.icon}
{menu.name}
<ArrowIcon className={styles.icon} />
</MobileMenuOuterLink>
</SubmenuDropdown>
)
}

if (menu.type === LinkType.Inner) {
return (
<MobileMenuInnerLink key={menu.name} to={menu.url ?? '/'}>
{menu.icon}
{menu.name}
</MobileMenuInnerLink>
)
}
if (menu.type === LinkType.Outer) {
return (
<MobileMenuOuterLink key={menu.name} href={menu.url} target="_blank" rel="noopener noreferrer">
{menu.icon}
{menu.name}
<ArrowIcon className={styles.icon} />
</MobileMenuOuterLink>
</SubmenuDropdown>
) : menu.type === LinkType.Inner ? (
<MobileMenuInnerLink key={menu.name} to={menu.url ?? '/'}>
{menu.name}
</MobileMenuInnerLink>
) : (
<MobileMenuOuterLink key={menu.name} href={menu.url} target="_blank" rel="noopener noreferrer">
{menu.name}
</MobileMenuOuterLink>
),
)}
)
}
return null
})}
</MobileMenuItem>
) : (
<HeaderMenuPanel>
Expand All @@ -285,23 +297,33 @@ export default memo(({ isMobile }: { isMobile: boolean }) => {

if (menu.type === LinkType.Inner) {
return (
<Link className={styles.headerMenusItem} to={menu.url ?? '/'} key={menu.name} title={menu.name}>
<Link
className={styles.headerMenusItem}
to={menu.url ?? '/'}
key={menu.name}
title={menu.name}
data-popup={menu.name}
>
{menu.icon}
</Link>
)
}
return (
<a
className={styles.headerMenusItem}
href={menu.url}
target="_blank"
rel="noopener noreferrer"
key={menu.name}
title={menu.name}
>
{menu.icon}
</a>
)
if (menu.type === LinkType.Outer) {
return (
<a
className={styles.headerMenusItem}
href={menu.url}
target="_blank"
rel="noopener noreferrer"
key={menu.name}
title={menu.name}
data-popup={menu.name}
>
{menu.icon}
</a>
)
}
return null
})}
</HeaderMenuPanel>
)
Expand Down
12 changes: 12 additions & 0 deletions src/components/Header/MenusComp/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ export const MobileMenuOuterLink = styled.a`
font-weight: regular;
margin-top: 22px;
height: 21px;
gap: 8px;

&:hover {
font-weight: medium;
color: ${props => props.theme.primary};

svg {
filter: drop-shadow(0 0 4px var(--primary-color));
mix-blend-mode: difference;
}
}
`

Expand All @@ -31,10 +37,16 @@ export const MobileMenuInnerLink = styled(Link)`
font-weight: regular;
margin-top: 22px;
height: 21px;
gap: 8px;

&:hover {
font-weight: medium;
color: ${props => props.theme.primary};

svg {
filter: drop-shadow(0 0 4px var(--primary-color));
mix-blend-mode: difference;
}
}
`

Expand Down
Loading