Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 16 additions & 21 deletions src/components/download/selection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const DEFAULT_DE = {
const DownloadSelection = () => {
const [selectedPlatform, setSelectedPlatform] = useState("generic");
const [selectedDEs, setSelectedDEs] = useState({});
const [tooltipText, setTooltipText] = useState("Copy to clipboard");
const contents = PLATFORM_MAP[selectedPlatform];

const handleDEChange = (index, de) => {
Expand Down Expand Up @@ -93,10 +94,10 @@ const DownloadSelection = () => {
</p>
<p>
<a
className="text-rhino-purple underline"
href={details.sourceCode}
target="_blank"
rel="noopener noreferrer"
className="text-rhino-purple underline"
>
Source Code
</a>
Expand All @@ -113,36 +114,30 @@ const DownloadSelection = () => {
</div>
)}

<button className="mt-4 hover:scale-105 transition-all bg-rhino-purple rounded-[0.65em] text-white text-xl px-4 py-2 shadow-md mr-2">
<a
href={details.downloadMirror}
target="_blank"
rel="noopener noreferrer"
>
<a
classname="inline-block mt-4"
href={details.downloadMirror}
target="_blank"
rel="noopener noreferrer"
>
<button className="mr-2 hover:scale-105 transition-all bg-rhino-purple rounded-[0.65em] text-white text-xl px-4 py-2 shadow-md">
Download
</a>
</button>
</button>
</a>

<div className="tooltip inline-block">
<span
className="tooltiptext"
id={`${content.title}-${selectedDE}`}
>
Copy to clipboard
{tooltipText}
</span>
<button
onClick={() => {
navigator.clipboard.writeText(details.shasum);
document.getElementById(
`${content.title}-${selectedDE}`
).innerHTML = "Copied to clipboard!";
}}
onMouseOut={() => {
document.getElementById(
`${content.title}-${selectedDE}`
).innerHTML = "Copy to clipboard";
}}
className="my-4 hover:scale-105 transition-all bg-site-100 p-1 rounded-[0.65em] text-white text-sm px-2 py-1 shadow-md"
onClick={() => navigator.clipboard.writeText(details.shasum).then(
() => setTooltipText("Copied to clipboard!")
)}
onMouseOut={() => setTooltipText("Copy to clipboard")}
>
sha256sum
</button>
Expand Down