UIKit/lib/components/PenaLink.tsx

35 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-08-22 11:03:11 +00:00
import { Link, LinkProps, LinkTypeMap, Typography, useTheme } from "@mui/material";
2023-08-14 14:09:38 +00:00
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
2023-08-21 11:10:34 +00:00
import { deepmerge } from "@mui/utils";
2023-08-22 11:03:11 +00:00
import { OverridableComponent } from "@mui/material/OverridableComponent";
2023-08-14 14:09:38 +00:00
2023-08-22 11:03:11 +00:00
export const PenaLink: OverridableComponent<LinkTypeMap<object, "a">> = (props: LinkProps) => {
2023-08-14 14:09:38 +00:00
const theme = useTheme();
return (
<Link
2023-08-21 11:10:34 +00:00
{...deepmerge({
sx: {
display: "flex",
gap: "3px",
textUnderlinePosition: "under",
2023-08-24 12:44:51 +00:00
color: theme.palette.purple.light,
textDecorationColor: theme.palette.purple.main,
2023-08-22 10:59:11 +00:00
textUnderlineOffset: "2px",
"&:hover": {
2023-08-24 12:44:51 +00:00
textDecorationColor: theme.palette.purple.light,
2023-08-22 10:59:11 +00:00
},
2023-08-21 11:10:34 +00:00
"&:active": {
2023-08-22 10:59:11 +00:00
color: "white",
textDecorationColor: "white",
2023-08-21 11:10:34 +00:00
},
}
}, props)}
2023-08-14 14:09:38 +00:00
>
<Typography variant="body2">{props.children}</Typography>
<ArrowForwardIcon sx={{ height: "20px", width: "20px" }} />
</Link>
);
2023-08-22 11:03:11 +00:00
};