2021-10-15 20:20:21 -07:00
|
|
|
import { makeStyles, Typography } from "@material-ui/core";
|
|
|
|
import clsx from "clsx";
|
|
|
|
import { ReactChild } from "react";
|
|
|
|
import { COLORS } from "../muiTheme";
|
|
|
|
|
|
|
|
const useStyles = makeStyles((theme) => ({
|
|
|
|
centeredContainer: {
|
2022-03-18 13:59:15 -07:00
|
|
|
marginBottom: theme.spacing(24),
|
2021-10-15 20:20:21 -07:00
|
|
|
textAlign: "center",
|
|
|
|
width: "100%",
|
|
|
|
},
|
|
|
|
linearGradient: {
|
|
|
|
background: `linear-gradient(to left, ${COLORS.blue}, ${COLORS.green});`,
|
|
|
|
WebkitBackgroundClip: "text",
|
|
|
|
backgroundClip: "text",
|
|
|
|
WebkitTextFillColor: "transparent",
|
|
|
|
MozBackgroundClip: "text",
|
|
|
|
MozTextFillColor: "transparent",
|
|
|
|
},
|
2022-03-18 13:59:15 -07:00
|
|
|
subtitle: {
|
|
|
|
marginTop: theme.spacing(2),
|
|
|
|
},
|
2021-10-15 20:20:21 -07:00
|
|
|
}));
|
|
|
|
|
2021-11-08 14:23:59 -08:00
|
|
|
export default function HeaderText({
|
|
|
|
children,
|
|
|
|
white,
|
|
|
|
small,
|
2022-01-23 19:00:42 -08:00
|
|
|
subtitle,
|
2021-11-08 14:23:59 -08:00
|
|
|
}: {
|
|
|
|
children: ReactChild;
|
|
|
|
white?: boolean;
|
|
|
|
small?: boolean;
|
2022-02-25 07:07:59 -08:00
|
|
|
subtitle?: ReactChild;
|
2021-11-08 14:23:59 -08:00
|
|
|
}) {
|
2021-10-15 20:20:21 -07:00
|
|
|
const classes = useStyles();
|
|
|
|
return (
|
|
|
|
<div className={classes.centeredContainer}>
|
|
|
|
<Typography
|
2021-11-08 14:23:59 -08:00
|
|
|
variant={small ? "h2" : "h1"}
|
|
|
|
component="h1"
|
2022-01-23 19:00:42 -08:00
|
|
|
className={clsx({ [classes.linearGradient]: !white })}
|
2021-10-15 20:20:21 -07:00
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</Typography>
|
2022-03-18 13:59:15 -07:00
|
|
|
{subtitle ? (
|
|
|
|
<Typography component="div" className={classes.subtitle}>
|
|
|
|
{subtitle}
|
|
|
|
</Typography>
|
|
|
|
) : null}
|
2021-10-15 20:20:21 -07:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|