@material-ui/core#TypographyClassKey TypeScript Examples

The following examples show how to use @material-ui/core#TypographyClassKey. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MarkdownHeading.tsx    From log4brains with Apache License 2.0 5 votes vote down vote up
export function MarkdownHeading({
  id,
  children,
  variant,
  className
}: MarkdownHeadingProps) {
  const classes = useStyles();

  let typographyVariant: TypographyClassKey;
  switch (variant) {
    case "h1":
      typographyVariant = "h3";
      break;
    case "h2":
      typographyVariant = "h4";
      break;
    case "h3":
      typographyVariant = "h5";
      break;
    case "h4":
      typographyVariant = "h6";
      break;
    default:
      typographyVariant = "h6";
      break;
  }

  return (
    <Typography
      gutterBottom
      variant={typographyVariant}
      component={variant}
      id={id}
      className={clsx(classes.root, className)}
    >
      {children}
      <MuiLink href={`#${id}`} className={classes.link} title="Permanent link">
        ΒΆ
      </MuiLink>
    </Typography>
  );
}