From af8ed8b3e3ad76f7634e351d36c5246de417fe8e Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Sat, 12 Oct 2019 09:54:52 +0200 Subject: [PATCH] fix: introduced ForwardRef (#177) * refactor: introduced forwardref - circular progress * refactor: replaced HTMLElementTagNameMap with HTMLElementDiv * fix: fixed func name --- src/components/Spinner/styles.ts | 2 +- .../CircularProgress/CircularProgress.tsx | 10 ++++++++++ src/muiComponents/CircularProgress/index.ts | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/muiComponents/CircularProgress/CircularProgress.tsx create mode 100644 src/muiComponents/CircularProgress/index.ts diff --git a/src/components/Spinner/styles.ts b/src/components/Spinner/styles.ts index 29fcaae..9b48aaf 100644 --- a/src/components/Spinner/styles.ts +++ b/src/components/Spinner/styles.ts @@ -1,7 +1,7 @@ -import CircularProgress from '@material-ui/core/CircularProgress'; import styled, { css } from 'react-emotion'; import colors from '../../utils/styles/colors'; +import CircularProgress from '../../muiComponents/CircularProgress'; interface WrapperProps { centered: boolean; diff --git a/src/muiComponents/CircularProgress/CircularProgress.tsx b/src/muiComponents/CircularProgress/CircularProgress.tsx new file mode 100644 index 0000000..8f1e233 --- /dev/null +++ b/src/muiComponents/CircularProgress/CircularProgress.tsx @@ -0,0 +1,10 @@ +import React, { forwardRef } from 'react'; +import { default as MaterialUICircularProgress, CircularProgressProps } from '@material-ui/core/CircularProgress'; + +type CircularProgressRef = HTMLDivElement; + +const CircularProgress = forwardRef(function CircularProgress(props, ref) { + return ; +}); + +export default CircularProgress; diff --git a/src/muiComponents/CircularProgress/index.ts b/src/muiComponents/CircularProgress/index.ts new file mode 100644 index 0000000..e87fbb2 --- /dev/null +++ b/src/muiComponents/CircularProgress/index.ts @@ -0,0 +1 @@ +export { default } from './CircularProgress';