Skip to content

Commit c0664ec

Browse files
authored
Merge pull request #38 from kleros/fix/prevent-modal-close-on-clickaway
fix: prevent-modal-close-on-clickaway-during-minting
2 parents d1009f9 + be51f72 commit c0664ec

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/app/(homepage)/components/ProjectFunding/PredictPopup/MintSellSteps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const MintSellSteps: React.FC<IMintSellSteps> = ({ close, toggleIsOpen }) => {
7676
items={steps}
7777
/>
7878
<div className="flex gap-[13.5px]">
79-
<Button text="Close" variant="secondary" onPress={close} />
79+
<Button text="Back" variant="secondary" onPress={close} />
8080
{currentStep === Step.Mint && (
8181
<SplitButton
8282
{...{ marketId, underlyingToken, initialBalanceRef }}

src/app/(homepage)/components/ProjectFunding/PredictPopup/index.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { useState } from "react";
22

33
import { Modal } from "@kleros/ui-components-library";
44

5+
import LightButton from "@/components/LightButton";
6+
7+
import CloseIcon from "@/assets/svg/close-icon.svg";
8+
59
import DefaultPredict from "./DefaultPredict";
610
import MintSell from "./MintSell";
711
import MintSellSteps from "./MintSellSteps";
@@ -19,11 +23,18 @@ const PredictPopup: React.FC<IPredictPopup> = ({ isOpen, toggleIsOpen }) => {
1923
const [isMinting, setIsMinting] = useState(false);
2024
return (
2125
<Modal
22-
className="h-fit w-max overflow-x-hidden p-6 py-8"
23-
isDismissable
26+
className="relative h-fit w-max overflow-x-hidden p-6 py-8"
2427
onOpenChange={toggleIsOpen}
2528
{...{ isOpen }}
2629
>
30+
<LightButton
31+
className="absolute top-4 right-4 p-1"
32+
text=""
33+
icon={
34+
<CloseIcon className="[&_path]:stroke-klerosUIComponentsSecondaryText size-4" />
35+
}
36+
onPress={toggleIsOpen}
37+
/>
2738
{isMinting ? (
2839
<MintSellSteps
2940
close={() => setIsMinting(false)}

src/assets/svg/close-icon.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)