Skip to content

Commit

Permalink
feat(Typography): Add types
Browse files Browse the repository at this point in the history
  • Loading branch information
cballevre committed Aug 22, 2024
1 parent ba90044 commit 14494e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions react/Typography/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import MuiTypography from '@material-ui/core/Typography'
import React, { forwardRef } from 'react'

/**
* @typedef TypographyPropTypes
* @property {string} [color] - The color of the text.
* @property {string} [variant] - The variant of the text.
* @property {React.ReactNode} children - The content of the component.
*/

/**
* @type React.ForwardRefRenderFunction<HTMLDivElement, TypographyPropTypes & MuiTypography>
*/
const Typography = forwardRef(({ color, variant, children, ...props }, ref) => {
const madeColor =
color || (variant === 'caption' ? 'textSecondary' : 'textPrimary')
Expand Down

0 comments on commit 14494e4

Please sign in to comment.