Initial commit
This commit is contained in:
33
src/pages/menu/components/BackButton.tsx
Normal file
33
src/pages/menu/components/BackButton.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Button } from "antd";
|
||||
import BackIcon from "components/Icons/BackIcon";
|
||||
|
||||
|
||||
interface BackButtonProps {
|
||||
navigateBack?: boolean; // true = use router.back(), false = just clear state
|
||||
}
|
||||
|
||||
export default function BackButton({ navigateBack = true }: BackButtonProps) {
|
||||
const handleBack = () => {
|
||||
if (navigateBack) window.history.back();
|
||||
};
|
||||
|
||||
return (
|
||||
<Button
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
padding: 0,
|
||||
borderRadius: "50%",
|
||||
}}
|
||||
icon={
|
||||
<div style={{ position: "relative", top: 2.5, right: 1 }}>
|
||||
<BackIcon />
|
||||
</div>
|
||||
}
|
||||
onClick={handleBack}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user