Renamed link component, added links to Demo page
This commit is contained in:
1 parent
f4832f0324
commit
3de2a17cbc
4 files changed
+101
-27
No files matched your search
@@ -33,6 +33,7 @@ const levelConfig = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @component
|
||||
* @param {Object} props
|
||||
* @param {'primary' | 'secondary' | 'tertiary' | 'error' | 'imagePrimary' | 'imageSecondary' | 'imageTertiary'} props.level - The level of the button
|
||||
* @param {string} props.label - The label of the button
|
||||
|
||||
File renamed without changes.
@@ -1,6 +1,15 @@
|
||||
import { Link as MuiLink, useTheme } from "@mui/material";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
/**
|
||||
* @component
|
||||
* @param {Object} props
|
||||
* @param {'primary' | 'secondary' | 'tertiary' | 'error'} props.level - The level of the link
|
||||
* @param {string} props.label - The label of the link
|
||||
* @param {string} props.url - The URL of the link
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
|
||||
const Link = ({ level, label, url }) => {
|
||||
const theme = useTheme();
|
||||
|
||||
@@ -22,14 +31,6 @@ const Link = ({ level, label, url }) => {
|
||||
},
|
||||
error: {},
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {Object} Props
|
||||
* @property {'primary' | 'secondary' | 'tertiary' | 'error'} level - The level of the link
|
||||
* @property {string} label - The label of the link
|
||||
* @property {string} url - The URL of the link
|
||||
*/
|
||||
|
||||
const { sx, color } = levelConfig[level];
|
||||
return (
|
||||
<MuiLink href={url} sx={sx} color={color}>
|
||||
Reference in new issue
Block a user