fix(striker-ui): hide Link underline and show Link icon

main
Tsu-ba-me 3 years ago
parent 6dfa7e6b70
commit 6ddc0dd5b5
  1. 25
      striker-ui/components/Link.tsx

@ -1,24 +1,39 @@
import { FC } from 'react'; import { FC } from 'react';
import { Link as MUILink, LinkProps as MUILinkProps } from '@mui/material'; import {
Box as MUIBox,
Link as MUILink,
LinkProps as MUILinkProps,
} from '@mui/material';
import { Link as LinkIcon } from '@mui/icons-material';
import { GREY } from '../lib/consts/DEFAULT_THEME'; import { GREY, TEXT } from '../lib/consts/DEFAULT_THEME';
export type LinkProps = MUILinkProps; export type LinkProps = MUILinkProps;
const Link: FC<LinkProps> = ({ children, sx, ...restLinkProps }) => ( const Link: FC<LinkProps> = ({ children, sx, ...restLinkProps }) => (
<MUILink <MUILink
{...{ {...{
underline: 'always', underline: 'hover',
variant: 'subtitle1', variant: 'subtitle1',
...restLinkProps, ...restLinkProps,
sx: { sx: {
color: GREY, color: TEXT,
textDecorationColor: GREY, textDecorationColor: GREY,
...sx, ...sx,
}, },
}} }}
> >
{children} <MUIBox
sx={{
alignItems: 'center',
display: 'flex',
flexDirection: 'row',
}}
>
{children}
<LinkIcon sx={{ marginLeft: '.3em' }} />
</MUIBox>
</MUILink> </MUILink>
); );

Loading…
Cancel
Save