change(ui): fix modal closing
This commit is contained in:
parent
0714d66bce
commit
d162bb6ae7
2 changed files with 5 additions and 3 deletions
|
|
@ -77,7 +77,7 @@ function Steps({ xrayProps }: Props) {
|
|||
}
|
||||
/>
|
||||
{bugReportStore.isSubStepModalOpen ? (
|
||||
<SubModal type={bugReportStore.subModalType} xrayProps={xrayProps}/>
|
||||
<SubModal type={bugReportStore.subModalType} toggleModal={bugReportStore.toggleSubStepModal} xrayProps={xrayProps}/>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ const Titles = {
|
|||
|
||||
interface Props {
|
||||
type: 'note' | 'network' | 'error';
|
||||
toggleModal: (isOpen: boolean) => void;
|
||||
}
|
||||
|
||||
function ModalContent(props: Props) {
|
||||
|
|
@ -34,7 +35,7 @@ function ModalContent(props: Props) {
|
|||
<Button disabled={selected.length === 0} variant="primary">
|
||||
Add Selected
|
||||
</Button>
|
||||
<Button variant="text-primary">Cancel</Button>
|
||||
<Button variant="text-primary" onClick={() => props.toggleModal(false)}>Cancel</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
@ -49,6 +50,7 @@ interface ModalProps {
|
|||
endTime: number;
|
||||
};
|
||||
type: 'note' | 'network' | 'error';
|
||||
toggleModal: (isOpen: boolean) => void;
|
||||
}
|
||||
|
||||
function SubModal(props: ModalProps) {
|
||||
|
|
@ -57,7 +59,7 @@ function SubModal(props: ModalProps) {
|
|||
className="bg-white overflow-y-scroll absolute"
|
||||
style={{ maxWidth: '70vw', width: 620, height: '100vh', top: 0, right: 0, zIndex: 999 }}
|
||||
>
|
||||
<ModalContent type={props.type} />
|
||||
<ModalContent type={props.type} toggleModal={props.toggleModal} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue