-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d365a9d
commit bd778f6
Showing
10 changed files
with
149 additions
and
74 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,76 @@ | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import Modal from "react-modal"; | ||
import { Tooltip } from "react-tooltip"; | ||
import copy from "copy-to-clipboard"; | ||
|
||
Modal.setAppElement("#root"); | ||
|
||
function GetDownloadLinks({ | ||
closeModal, | ||
modalIsOpen, | ||
links, | ||
}: { | ||
closeModal: (folderName?: string) => void; | ||
modalIsOpen: boolean; | ||
links: string[]; | ||
}) { | ||
return ( | ||
<Modal | ||
isOpen={modalIsOpen} | ||
onRequestClose={() => closeModal()} | ||
style={{ | ||
content: { | ||
top: "10%", | ||
left: "10%", | ||
right: "auto", | ||
bottom: "auto", | ||
marginRight: "-10%", | ||
transform: "translate(-6%, -10%)", | ||
width: "90%", | ||
padding: 0, | ||
}, | ||
overlay: { | ||
zIndex: 999, | ||
}, | ||
}} | ||
contentLabel="Download Links" | ||
> | ||
<div> | ||
<div className="flex items-center"> | ||
<h2 className="grow m-4 font-semibold text-2xl">Download Links</h2> | ||
<button | ||
className="mx-4 p-2 text-xs" | ||
aria-description="close" | ||
onClick={() => closeModal()} | ||
> | ||
<FontAwesomeIcon icon={["fas", "x"]} /> | ||
</button> | ||
</div> | ||
<hr /> | ||
<div className="m-8"> | ||
<div className="my-2 mx-1 ml-auto text-end"> | ||
<Tooltip id="tooltip-copy" openOnClick={true} content="Copied!" /> | ||
<button | ||
data-tooltip-id="tooltip-copy" | ||
data-tooltip-content="Copied!" | ||
onClick={() => copy(links.join("\n"))} | ||
> | ||
<FontAwesomeIcon icon={["fas", "clipboard"]} /> | ||
</button> | ||
</div> | ||
<div className="flex"> | ||
<textarea | ||
readOnly | ||
rows={7} | ||
id="links" | ||
value={links.join("\n")} | ||
className="rounded-none bg-white border text-gray-900 focus:outline-none focus:border-amber-300 focus:ring-1 focus:ring-amber-300 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</Modal> | ||
); | ||
} | ||
|
||
export default GetDownloadLinks; |
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
Oops, something went wrong.