Skip to content

Commit

Permalink
style: format codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 16, 2024
1 parent fe8ace3 commit 48dd8d9
Showing 1 changed file with 56 additions and 49 deletions.
105 changes: 56 additions & 49 deletions Website/app/Releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function downloadOlderReleases(OSName, applicationType, version) {
);
} else if (OSName === "MacOS Intel") {
window.open(
"https://github.com/SaptarshiSarkar12/Drifty/releases/download/" +
"https://github.com/SaptarshiSarkar12/Drifty/releases/download/" +
version +
"/Drifty-CLI_macos_x86_64",
);
Expand Down Expand Up @@ -116,13 +116,13 @@ function downloadOlderReleases(OSName, applicationType, version) {
);
} else if (OSName === "MacOS Apple Silicon") {
window.open(
"https://github.com/SaptarshiSarkar12/Drifty/releases/download/" +
"https://github.com/SaptarshiSarkar12/Drifty/releases/download/" +
version +
"/Drifty-GUI_aarch64.pkg",
);
} else if (OSName === "MacOS Intel") {
window.open(
"https://github.com/SaptarshiSarkar12/Drifty/releases/download/" +
"https://github.com/SaptarshiSarkar12/Drifty/releases/download/" +
version +
"/Drifty-GUI_x86_64.pkg",
);
Expand Down Expand Up @@ -308,8 +308,13 @@ export default function Releases({ props }) {
{/* Third Download Now Button */}
<div className="md:ml-4 xs:ml-0">
<button
className="xs:w-80 xs:py-5 bg-gradient-to-r from-blue-600 to-green-500 text-white xs:text-3xl font-semibold md:text-3xl rounded-full hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-1 hover:scale-110 hover:from-pink-500 hover:to-yellow-500 hover:drop-shadow-lg focus:shadow-lg focus:outline-none active:bg-blue-400 active:shadow-lg transition"
onClick={() => downloadLatestRelease(latestVersion >= "v2.1.0" ? "MacOS Apple Silicon" : "MacOS", applicationType)}
className="xs:w-80 xs:py-5 bg-gradient-to-r from-blue-600 to-green-500 text-white xs:text-3xl font-semibold md:text-3xl rounded-full hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-1 hover:scale-110 hover:from-pink-500 hover:to-yellow-500 hover:drop-shadow-lg focus:shadow-lg focus:outline-none active:bg-blue-400 active:shadow-lg transition"
onClick={() =>
downloadLatestRelease(
latestVersion >= "v2.1.0" ? "MacOS Apple Silicon" : "MacOS",
applicationType,
)
}
>
Download Now <i className="fab fa-brands fa-apple"></i>
<div className="text-lg md:text-sm text-gray-700 font-semibold">
Expand All @@ -319,8 +324,10 @@ export default function Releases({ props }) {
{latestVersion >= "v2.1.0" && ( // If the version of the latest release is greater than or equal to v2.1.0, then show the download button for macOS (Intel)
<div className={"text-center"}>
<button
className="text-lg select-none text-violet-900 font-semibold hover:underline hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-0.5 hover:scale-110"
onClick={() => downloadLatestRelease("MacOS Intel", applicationType)}
className="text-lg select-none text-violet-900 font-semibold hover:underline hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-0.5 hover:scale-110"
onClick={() =>
downloadLatestRelease("MacOS Intel", applicationType)
}
>
Download for macOS (Intel)
</button>
Expand Down Expand Up @@ -366,8 +373,8 @@ export default function Releases({ props }) {
<span className="font-bold">{item.tag_name} </span>
<p>
{new Date(item.published_at).toString()} with{" "}
{item.tag_name.split("-")[0] > "v2.1.0" ? (
item.assets[0].download_count +
{item.tag_name.split("-")[0] > "v2.1.0"
? item.assets[0].download_count +
item.assets[1].download_count +
item.assets[2].download_count +
item.assets[3].download_count +
Expand All @@ -376,15 +383,13 @@ export default function Releases({ props }) {
item.assets[6].download_count +
item.assets[7].download_count +
item.assets[8].download_count
) : (
item.assets[0].download_count +
: item.assets[0].download_count +
item.assets[1].download_count +
item.assets[2].download_count +
item.assets[3].download_count +
item.assets[4].download_count +
item.assets[5].download_count +
item.assets[6].download_count
)}{" "}
item.assets[6].download_count}{" "}
Downloads
</p>
<button
Expand Down Expand Up @@ -448,7 +453,9 @@ export default function Releases({ props }) {
className="select-none pl-3 pr-3 w-auto h-min text-2xl bg-gradient-to-r from-blue-600 to-green-500 hover:from-pink-500 hover:to-yellow-500 rounded-full p-1 shadow-none hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-1 hover:scale-110 hover:drop-shadow-2xl"
onClick={() =>
downloadOlderReleases(
item.tag_name.split("-")[0] > "v2.1.0" ? "MacOS Apple Silicon" : "MacOS",
item.tag_name.split("-")[0] > "v2.1.0"
? "MacOS Apple Silicon"
: "MacOS",
applicationType,
item.tag_name,
)
Expand All @@ -457,20 +464,20 @@ export default function Releases({ props }) {
Download <i className="fab fa-brands fa-apple"></i>
</button>
{item.tag_name.split("-")[0] > "v2.1.0" && ( // If the version of pre-release is greater than v2.1.0, then show the download button for macOS (Intel)
<button
className={
"text-sm text-violet-900 font-semibold hover:underline hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-0.5 hover:scale-110"
}
onClick={() =>
downloadOlderReleases(
"MacOS Intel",
applicationType,
item.tag_name,
)
}
>
Download for macOS (Intel)
</button>
<button
className={
"text-sm text-violet-900 font-semibold hover:underline hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-0.5 hover:scale-110"
}
onClick={() =>
downloadOlderReleases(
"MacOS Intel",
applicationType,
item.tag_name,
)
}
>
Download for macOS (Intel)
</button>
)}
</div>
</div>
Expand All @@ -491,8 +498,8 @@ export default function Releases({ props }) {
<span className="font-bold">{item.tag_name} </span>
<p>
{new Date(item.published_at).toString()} with{" "}
{item.tag_name >= "v2.1.0" ? (
item.assets[0].download_count +
{item.tag_name >= "v2.1.0"
? item.assets[0].download_count +
item.assets[1].download_count +
item.assets[2].download_count +
item.assets[3].download_count +
Expand All @@ -501,15 +508,13 @@ export default function Releases({ props }) {
item.assets[6].download_count +
item.assets[7].download_count +
item.assets[8].download_count
) : (
item.assets[0].download_count +
: item.assets[0].download_count +
item.assets[1].download_count +
item.assets[2].download_count +
item.assets[3].download_count +
item.assets[4].download_count +
item.assets[5].download_count +
item.assets[6].download_count
)}{" "}
item.assets[6].download_count}{" "}
Downloads
</p>
<button
Expand Down Expand Up @@ -573,7 +578,9 @@ export default function Releases({ props }) {
className="select-none pl-3 pr-3 w-auto h-min text-2xl bg-gradient-to-r from-blue-600 to-green-500 hover:from-pink-500 hover:to-yellow-500 rounded-full p-1 shadow-none hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-1 hover:scale-110 hover:drop-shadow-2xl"
onClick={() =>
downloadOlderReleases(
item.tag_name >= "v2.1.0" ? "MacOS Apple Silicon" : "MacOS",
item.tag_name >= "v2.1.0"
? "MacOS Apple Silicon"
: "MacOS",
applicationType,
item.tag_name,
)
Expand All @@ -582,20 +589,20 @@ export default function Releases({ props }) {
Download <i className="fab fa-brands fa-apple"></i>
</button>
{item.tag_name >= "v2.1.0" && ( // If the version of the past release is greater than or equal to v2.1.0, then show the download button for macOS (Intel)
<button
className={
"text-sm text-violet-900 font-semibold hover:underline hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-0.5 hover:scale-110"
}
onClick={() =>
downloadOlderReleases(
"MacOS Intel",
applicationType,
item.tag_name,
)
}
>
Download for macOS (Intel)
</button>
<button
className={
"text-sm text-violet-900 font-semibold hover:underline hover:transition ease-in-out duration-300 delay-80 hover:-translate-y-0.5 hover:scale-110"
}
onClick={() =>
downloadOlderReleases(
"MacOS Intel",
applicationType,
item.tag_name,
)
}
>
Download for macOS (Intel)
</button>
)}
</div>
</div>
Expand Down

0 comments on commit 48dd8d9

Please sign in to comment.