react-router-dom

This commit is contained in:
2024-05-04 14:58:19 +03:00
parent bb49021fb8
commit 1db1a2efce
11 changed files with 127 additions and 31 deletions

View File

@@ -1,7 +1,9 @@
import styled from "@emotion/styled";
import { css } from "@emotion/react";
import { Link as ConnectedLink } from 'react-router-dom';
export const StyledLink = styled.a<{
export const StyledLink = styled(ConnectedLink)<{
contrast?: boolean;
inheritColor?: boolean;
}>`

View File

@@ -22,7 +22,7 @@ export const Link = (props: LinkProps) => {
}
return (
<StyledLink inheritColor={props.inheritColor} contrast={props.contrast} href={props.href} {...linkProps}>
<StyledLink reloadDocument={isExternal} inheritColor={props.inheritColor} contrast={props.contrast} to={props.href} {...linkProps}>
{props.children}
{isExternal && <img src={externalIcon} alt="external link icon" />}
</StyledLink>