Skip to content

Commit 9a50eb7

Browse files
committed
chore: move snackbar on top
1 parent 3fc32d5 commit 9a50eb7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/visualisation/src/App.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import { Snackbar, SnackbarContent } from '@mui/material'
1313

1414
import Slide from '@mui/material/Slide';
1515

16-
function TransitionUp(props) {
17-
return <Slide {...props} direction="up" />
18-
}
16+
1917
const App = () => {
2018
const [activeCar, setActiveCar] = useState(null)
2119
const [reset, setReset] = useState(false)
@@ -349,21 +347,24 @@ const App = () => {
349347
/>
350348

351349
<Snackbar
352-
sx={{ opacity: 0.8, bottom: 20 }}
350+
sx={{ opacity: 0.8 }}
353351
anchorOrigin={{
354-
vertical: 'bottom',
352+
vertical: 'top',
355353
horizontal: 'center',
356354
}}
357355
variant="filled"
358356
open={snackbarOpen}
359357
autoHideDuration={3000}
360-
TransitionComponent={TransitionUp}
358+
TransitionComponent={TransitionDown}
361359
onClose={() => setSnackbarOpen(false)}
362360
>
363-
<SnackbarContent sx={{ backgroundColor: 'black', height: 20, margin: 3, color: 'white' }} message={latestLogMessage} />
361+
<SnackbarContent sx={{ backgroundColor: 'black', color: 'white' }} message={latestLogMessage} />
364362
</Snackbar>
365363
</>
366364
)
367365
}
368366

367+
function TransitionDown(props) {
368+
return <Slide {...props} direction="down" />
369+
}
369370
export default App

0 commit comments

Comments
 (0)