Skip to content

Commit 01a9fd8

Browse files
authored
Fixed links on downloads page.
* Fix windows link * Linked macOS to App Store
1 parent 8b54178 commit 01a9fd8

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/components/buttons/DownloadButton/DownloadButton.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface DownloadProps {
1818
}
1919

2020
const ARCHLINK = "https://aur.archlinux.org/packages/defguard-client";
21+
const APPSTORE_LINK = "https://apps.apple.com/pl/app/defguard-desktop-client/id6754601166?mt=12";
2122

2223
export const DownloadButton = ({ platformType, owner, repo, version }: DownloadProps) => {
2324
const [isButtonClicked, setIsButtonClicked] = useState(false);
@@ -29,7 +30,7 @@ export const DownloadButton = ({ platformType, owner, repo, version }: DownloadP
2930
useEffect(() => {
3031
switch (platform) {
3132
case PlatformType.WINDOWS: {
32-
setDownloadName(`defguard-client_${version}_x64_en-US.exe`);
33+
setDownloadName(`Defguard_${version}_x64_en-US.msi`);
3334
break;
3435
}
3536
case PlatformType.MACOSARM: {
@@ -221,19 +222,22 @@ export const DownloadButton = ({ platformType, owner, repo, version }: DownloadP
221222
href={
222223
platform === PlatformType.ARCHLINUX
223224
? ARCHLINK
224-
: `https://github.com/${owner}/${repo}/releases/download/v${version}/${downloadName}`
225+
: platform === PlatformType.MACOSARM || platform === PlatformType.MACOSINTEL
226+
? APPSTORE_LINK
227+
: `https://github.com/${owner}/${repo}/releases/download/v${version}/${downloadName}`
225228
}
226229
className="download-main"
227230
onClick={handleClick}
228231
>
229232
<div className="download-text">
230233
{(platform === PlatformType.DEBIAN ||
231-
platform === PlatformType.MACOSINTEL ||
232-
platform === PlatformType.MACOSARM ||
233234
platform === PlatformType.WINDOWS ||
234235
platform === PlatformType.FEDORAX86 ||
235236
platform === PlatformType.FEDORAARM) && <>Download now</>}
236237
{platform === PlatformType.ARCHLINUX && <>AUR package</>}
238+
{(platform === PlatformType.MACOSINTEL || platform === PlatformType.MACOSARM) && (
239+
<>App Store</>
240+
)}
237241
{platform === PlatformType.DEBIAN && <p>Debian package</p>}
238242
{platform === PlatformType.MACOSINTEL && <p>Apple Intel</p>}
239243
{platform === PlatformType.MACOSARM && <p>Apple ARM</p>}
@@ -243,10 +247,12 @@ export const DownloadButton = ({ platformType, owner, repo, version }: DownloadP
243247
<div className="btn">
244248
{isButtonClicked ? (
245249
<CheckIcon />
246-
) : platform !== PlatformType.ARCHLINUX ? (
247-
<DownloadIcon />
248-
) : (
250+
) : platform === PlatformType.ARCHLINUX ||
251+
platform === PlatformType.MACOSARM ||
252+
platform === PlatformType.MACOSINTEL ? (
249253
<h3></h3>
254+
) : (
255+
<DownloadIcon />
250256
)}
251257
</div>
252258
</a>

0 commit comments

Comments
 (0)