From 7182961a452df088cbd18cb83a434e4d3fa27705 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Mon, 26 Sep 2022 23:28:14 -0400 Subject: [PATCH] fix(striker-ui): expose progress component props in Spinner --- striker-ui/components/Spinner.tsx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/striker-ui/components/Spinner.tsx b/striker-ui/components/Spinner.tsx index 3c90437b..7825916b 100644 --- a/striker-ui/components/Spinner.tsx +++ b/striker-ui/components/Spinner.tsx @@ -4,19 +4,33 @@ import { BoxProps as MUIBoxProps, CircularProgress as MUICircularProgress, circularProgressClasses as muiCircularProgressClasses, + CircularProgressProps as MUICircularProgressProps, } from '@mui/material'; import { TEXT } from '../lib/consts/DEFAULT_THEME'; -type SpinnerProps = MUIBoxProps; +type SpinnerOptionalProps = { + progressProps?: MUICircularProgressProps; +}; + +type SpinnerProps = MUIBoxProps & SpinnerOptionalProps; + +const SPINNER_DEFAULT_PROPS: Required = { + progressProps: {}, +}; const Spinner: FC = (spinnerProps): JSX.Element => { - const { sx, ...spinnerRestProps } = spinnerProps; + const { + sx, + progressProps = SPINNER_DEFAULT_PROPS.progressProps, + ...spinnerRestProps + } = spinnerProps; return ( = (spinnerProps): JSX.Element => { }, }} > - + ); }; +Spinner.defaultProps = SPINNER_DEFAULT_PROPS; + export default Spinner;