diff --git a/src/components/SnackbarIndicator.js b/src/components/SnackbarIndicator/index.js similarity index 78% rename from src/components/SnackbarIndicator.js rename to src/components/SnackbarIndicator/index.js index 0240e9b..4292532 100644 --- a/src/components/SnackbarIndicator.js +++ b/src/components/SnackbarIndicator/index.js @@ -1,8 +1,11 @@ import { useState, useEffect, forwardRef } from 'react'; import { Snackbar, Alert } from '@mui/material'; +import styles from './styles'; + function SnackbarIndicator({ isOpen, severity, message }) { const [open, setOpen] = useState(false); + const { snackbarContainer, customAlert } = styles; useEffect(() => { setOpen(isOpen); @@ -16,12 +19,12 @@ function SnackbarIndicator({ isOpen, severity, message }) { return ( - + {message} diff --git a/src/components/SnackbarIndicator/styles.js b/src/components/SnackbarIndicator/styles.js new file mode 100644 index 0000000..523c120 --- /dev/null +++ b/src/components/SnackbarIndicator/styles.js @@ -0,0 +1,11 @@ +const snackbarContainer = { + vertical: 'bottom', + horizontal: 'center', +}; + +const customAlert = { + width: '100%', +}; + +const styles = { snackbarContainer, customAlert }; +export default styles;