menu: on click on prduct open details as BS, also add redirect button to detials page if user click on redirect button
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Button } from "antd";
|
||||
import BackIcon from "components/Icons/BackIcon";
|
||||
|
||||
import NextIcon from "components/Icons/NextIcon";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
|
||||
interface BackButtonProps {
|
||||
navigateBack?: boolean; // true = use router.back(), false = just clear state
|
||||
@@ -10,6 +11,7 @@ export default function BackButton({ navigateBack = true }: BackButtonProps) {
|
||||
const handleBack = () => {
|
||||
if (navigateBack) window.history.back();
|
||||
};
|
||||
const { isRTL } = useAppSelector((state) => state.locale);
|
||||
|
||||
return (
|
||||
<Button
|
||||
@@ -23,8 +25,14 @@ export default function BackButton({ navigateBack = true }: BackButtonProps) {
|
||||
borderRadius: "50%",
|
||||
}}
|
||||
icon={
|
||||
<div style={{ position: "relative", top: 2.5, right: 1 }}>
|
||||
<BackIcon />
|
||||
<div
|
||||
style={{
|
||||
position: "relative",
|
||||
top: 2.5,
|
||||
[isRTL ? "left" : "right"]: 1,
|
||||
}}
|
||||
>
|
||||
{isRTL ? <NextIcon /> : <BackIcon />}
|
||||
</div>
|
||||
}
|
||||
onClick={handleBack}
|
||||
|
||||
Reference in New Issue
Block a user