Merge branch 'master' into feat/labels
This commit is contained in:
commit
4b0e892e5e
4 files changed
+57
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,47 @@
|
|||||||
|
import { Link as MuiLink, useTheme } from "@mui/material";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
|
const Link = ({ level, label, url }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
|
const levelConfig = {
|
||||||
|
primary: {},
|
||||||
|
secondary: {},
|
||||||
|
tertiary: {
|
||||||
|
color: theme.palette.tertiary.main,
|
||||||
|
sx: {
|
||||||
|
textDecoration: "underline",
|
||||||
|
textDecorationStyle: "dashed",
|
||||||
|
textDecorationColor: theme.palette.primary.main,
|
||||||
|
":hover": {
|
||||||
|
color: theme.palette.tertiary.main,
|
||||||
|
textDecorationColor: theme.palette.primary.main,
|
||||||
|
backgroundColor: theme.palette.tertiary.linkHover,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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}>
|
||||||
|
{label}
|
||||||
|
</MuiLink>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Link.propTypes = {
|
||||||
|
url: PropTypes.string.isRequired,
|
||||||
|
level: PropTypes.oneOf(["primary", "secondary", "tertiary", "error"]),
|
||||||
|
label: PropTypes.string.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Link;
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import DropdownTeamMember from "../../Components/DropdownTeamMember";
|
import DropdownTeamMember from "../../Components/DropdownTeamMember";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
|
import Link from "../../Components/Link";
|
||||||
import ColoredLabel from "../../Components/Label/ColoredLabel";
|
import ColoredLabel from "../../Components/Label/ColoredLabel";
|
||||||
import { useTheme } from "@mui/material";
|
import { useTheme } from "@mui/material";
|
||||||
import StatusLabel from "../../Components/Label/StautsLabel";
|
import StatusLabel from "../../Components/Label/StautsLabel";
|
||||||
@@ -26,6 +27,13 @@ const Home = () => {
|
|||||||
<Button level="tertiary" label="Tertiary" disabled />
|
<Button level="tertiary" label="Tertiary" disabled />
|
||||||
<Button level="error" label="Error" disabled />
|
<Button level="error" label="Error" disabled />
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<Link
|
||||||
|
level="tertiary"
|
||||||
|
label="Tertiary Link"
|
||||||
|
url={"https://www.google.com"}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<h4>Labels</h4>
|
<h4>Labels</h4>
|
||||||
<div>
|
<div>
|
||||||
<ColoredLabel label="Label" color={theme.palette.labelGray.color} />
|
<ColoredLabel label="Label" color={theme.palette.labelGray.color} />
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { createTheme } from "@mui/material";
|
|||||||
const primaryMain = "#1570EF";
|
const primaryMain = "#1570EF";
|
||||||
const secondaryMain = "#475467";
|
const secondaryMain = "#475467";
|
||||||
const tertiaryMain = "#475467";
|
const tertiaryMain = "#475467";
|
||||||
|
const tertiaryLinkHover = "#eff8ff";
|
||||||
|
|
||||||
// Label Colors
|
// Label Colors
|
||||||
const labelOrange = "#F79009";
|
const labelOrange = "#F79009";
|
||||||
@@ -21,6 +22,7 @@ const theme = createTheme({
|
|||||||
},
|
},
|
||||||
tertiary: {
|
tertiary: {
|
||||||
main: tertiaryMain,
|
main: tertiaryMain,
|
||||||
|
linkHover: tertiaryLinkHover,
|
||||||
},
|
},
|
||||||
labelOrange: {
|
labelOrange: {
|
||||||
color: labelOrange,
|
color: labelOrange,
|
||||||
|
|||||||
Reference in new issue
Block a user