-
-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move job modal to queue dropdown actions
- Loading branch information
Showing
7 changed files
with
68 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,7 @@ | ||
import React from 'react'; | ||
|
||
export const AddIcon = () => ( | ||
<svg | ||
role="img" | ||
width="256px" | ||
height="256px" | ||
viewBox="0 0 24.00 24.00" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
stroke="#748094" | ||
> | ||
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g> | ||
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g> | ||
<g id="SVGRepo_iconCarrier"> | ||
<path | ||
d="M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z" | ||
fill="#748094" | ||
></path> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M2 4.5C2 3.11929 3.11929 2 4.5 2H19.5C20.8807 2 22 3.11929 22 4.5V19.5C22 20.8807 20.8807 22 19.5 22H4.5C3.11929 22 2 20.8807 2 19.5V4.5ZM4.5 4C4.22386 4 4 4.22386 4 4.5V19.5C4 19.7761 4.22386 20 4.5 20H19.5C19.7761 20 20 19.7761 20 19.5V4.5C20 4.22386 19.7761 4 19.5 4H4.5Z" | ||
fill="#748094" | ||
></path> | ||
</g> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"> | ||
<path d="M64 80c-8.8 0-16 7.2-16 16v320c0 8.8 7.2 16 16 16h320c8.8 0 16-7.2 16-16V96c0-8.8-7.2-16-16-16H64zM0 96c0-35.3 28.7-64 64-64h320c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm200 248v-64h-64c-13.3 0-24-10.7-24-24s10.7-24 24-24h64v-64c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24h-64v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z" /> | ||
</svg> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { useState } from 'react'; | ||
|
||
export function useModal<ModalTypes extends string>() { | ||
type AllModalTypes = ModalTypes | `${ModalTypes}Closing` | null; | ||
const [openedModal, setModalOpen] = useState<AllModalTypes>(null); | ||
|
||
return { | ||
isOpen(modal: ModalTypes): boolean { | ||
return openedModal === modal; | ||
}, | ||
isMounted(modal: ModalTypes): boolean { | ||
return [modal, `${modal}Closing`].includes(openedModal as any); | ||
}, | ||
open(modal: ModalTypes): void { | ||
setModalOpen(modal); | ||
}, | ||
close(modal: ModalTypes): () => void { | ||
return () => { | ||
setModalOpen(`${modal}Closing`); | ||
setTimeout(() => setModalOpen(null), 300); // fadeout animation duration | ||
}; | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters