chore: rotation options

This commit is contained in:
Ibrahima G. Coulibaly
2025-03-29 16:40:14 +00:00
parent 87d47c3aa5
commit 6dc48e77ce
4 changed files with 149 additions and 116 deletions

View File

@@ -0,0 +1,20 @@
import { IconButton } from '@mui/material';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import { useNavigate, useNavigationType } from 'react-router-dom';
const BackButton = () => {
const navigate = useNavigate();
const navigationType = useNavigationType(); // Check if there is a history state
const disabled = navigationType === 'POP';
const handleBack = () => {
navigate(-1);
};
return (
<IconButton onClick={handleBack} disabled={disabled}>
<ArrowBackIcon color={disabled ? 'action' : 'primary'} />
</IconButton>
);
};
export default BackButton;