From 3387d94ea473689d7ad2c424bec1a40dba5b97b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Fri, 1 Jul 2022 17:33:04 -0300 Subject: [PATCH] Refactor LinearProgress --- .../index.js} | 14 ++++---------- src/components/LoadingIndicator/styles.js | 12 ++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) rename src/components/{LoadingIndicator.js => LoadingIndicator/index.js} (69%) create mode 100644 src/components/LoadingIndicator/styles.js diff --git a/src/components/LoadingIndicator.js b/src/components/LoadingIndicator/index.js similarity index 69% rename from src/components/LoadingIndicator.js rename to src/components/LoadingIndicator/index.js index 8d5d006..4c2c285 100644 --- a/src/components/LoadingIndicator.js +++ b/src/components/LoadingIndicator/index.js @@ -1,6 +1,10 @@ import { Box, LinearProgress } from '@mui/material'; +import styles from './styles'; + function LoadingIndicator({ isLoading }) { + const { box, linearProgress } = styles; + if (isLoading) { return ( @@ -10,14 +14,4 @@ function LoadingIndicator({ isLoading }) { } } -const box = { - width: '100%', - position: 'absolute', - top: 0, -}; - -const linearProgress = { - height: '7px', -}; - export default LoadingIndicator; diff --git a/src/components/LoadingIndicator/styles.js b/src/components/LoadingIndicator/styles.js new file mode 100644 index 0000000..2e5c5d3 --- /dev/null +++ b/src/components/LoadingIndicator/styles.js @@ -0,0 +1,12 @@ +const box = { + width: '100%', + position: 'absolute', + top: 0, +}; + +const linearProgress = { + height: '7px', +}; + +const styles = { box, linearProgress }; +export default styles;