Skip to content

Commit

Permalink
Merge pull request #358 from lidofinance/feature/si-1287-remove-color…
Browse files Browse the repository at this point in the history
…-for-visited-links

[fix] link visited and warning
  • Loading branch information
itaven authored Jun 19, 2024
2 parents fcf4e6c + 3f6d7ec commit defab9a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default withBundleAnalyzer({
// https://github.com/vercel/next.js/blob/v12.3.4/packages/next/build/webpack-config.ts#L417
// Presumably, it is true by default in next v13 and won't be needed
esmExternals: true,
newNextLinkBehavior: true,
},
webpack(config) {
config.module.rules.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,11 @@ export const NavLink = styled.span<{ active: boolean }>`
letter-spacing: 0.04em;
opacity: ${(props) => (props.active ? 1 : 0.8)};
:hover {
&:hover {
opacity: 1;
color: var(--lido-color-secondary);
}
// TODO: Not actual - remove
:visited {
color: var(--lido-color-secondary);
}
svg {
fill: ${({ active }) =>
active ? `var(--lido-color-primary)` : `var(--lido-color-secondary)`};
Expand Down
13 changes: 6 additions & 7 deletions shared/components/local-link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ export const LocalLink: FC<PropsWithChildren<LinkProps>> = (props) => {
}

return (
<Link {...restProps} href={{ pathname: href, query: extraQuery }}>
{/* TODO: fix when go to Next v13+ */}
{/* see: https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#link-component */}
{/* eslint-disable-next-line jsx-a11y/anchor-has-content,jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
<a {...restProps} />
</Link>
<Link
{...restProps}
legacyBehavior={false}
href={{ pathname: href, query: extraQuery }}
/>
);
}

throw new Error('Prop href is not compatible');
throw new Error('Prop href as object is not compatible');
};
2 changes: 1 addition & 1 deletion styles/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const GlobalStyle = createGlobalStyle`
color: var(--lido-color-primary);
&:visited {
color: var(--lido-color-primaryVisited);
color: var(--lido-color-primary);
}
&:hover {
Expand Down

0 comments on commit defab9a

Please sign in to comment.