Skip to content

Commit e6a1a2a

Browse files
authored
Merge pull request #31 from audacity/post-download
Implement post-download page
2 parents 3f48908 + eb408b6 commit e6a1a2a

File tree

11 files changed

+168
-14
lines changed

11 files changed

+168
-14
lines changed

src/components/button/DownloadButton.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ function DownloadButton() {
2020
]);
2121
}
2222
}
23+
24+
setTimeout(() => {
25+
window.location.href = "download-success";
26+
}, 2000);
2327
}
2428

2529
function renderButton(href) {
@@ -44,7 +48,7 @@ function DownloadButton() {
4448
case "Debian":
4549
case "Red Hat":
4650
case "SuSE":
47-
return; //primary button is Linux downlaod already
51+
return; //primary button is Linux download already
4852
default:
4953
return renderButton("/download");
5054
}

src/components/button/DownloadMuseHubButton.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,21 @@ function DownloadMuseHubButton() {
2020
"trackEvent",
2121
"Download Button",
2222
"Download Muse Hub",
23-
`Download Muse Hub button ${platform.os.family}`,
23+
`Download Muse Hub button ${browserOS}`,
2424
]);
2525
}
2626
} else if (href === audacityReleases.lin[0].browser_download_url) {
2727
_paq.push([
2828
"trackEvent",
2929
"Download Button",
3030
"Download Audacity",
31-
`Download Audacity button ${platform.os.family}`,
31+
`Download Audacity button ${browserOS}`,
3232
]);
3333
}
34+
35+
setTimeout(() => {
36+
window.location.href = "post-download";
37+
}, 2000);
3438
}
3539

3640
function renderButton(href) {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from "react";
2+
3+
function handleButtonClick() {
4+
if (typeof _paq !== "undefined") {
5+
_paq.push([
6+
"trackEvent",
7+
"CTA Button",
8+
"audio.com CTA",
9+
"audio.com block CTA",
10+
]);
11+
}
12+
}
13+
14+
function JoinAudioDotComButton() {
15+
return (
16+
<a
17+
onClick={() => {
18+
handleButtonClick();
19+
}}
20+
href="https://audio.com/auth/sign-up?mtm_campaign=audacityteamorg&mtm_content=Block_button"
21+
className="px-6 py-4 bg-blue-700 w-fit text-white rounded hover:bg-blue-600"
22+
>
23+
Join for free
24+
</a>
25+
);
26+
}
27+
28+
export default JoinAudioDotComButton;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from "react";
2+
3+
function PlatformDownloadMuseHubButton(props) {
4+
const { museHubReleaseData } = props;
5+
6+
function onClickButtonHandler() {
7+
if (typeof _paq !== "undefined") {
8+
_paq.push([
9+
"trackEvent",
10+
"Download Button",
11+
"Download Muse Hub",
12+
`Download Muse Hub button ${OS}`,
13+
]);
14+
}
15+
16+
setTimeout(() => {
17+
window.location.href = "/post-download";
18+
}, 2000);
19+
}
20+
21+
return (
22+
<a
23+
onClick={onClickButtonHandler}
24+
href={museHubReleaseData[0].browser_download_url}
25+
className="flex justify-center text-center items-center px-4 h-12 w-full sm:w-fit bg-blue-700 hover:bg-blue-600 text-base text-white rounded"
26+
>
27+
Download
28+
</a>
29+
);
30+
}
31+
32+
export default PlatformDownloadMuseHubButton;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from "react";
2+
3+
function AudioDotComCard(props) {
4+
const { title, icon, body, img } = props;
5+
return (
6+
<div
7+
className="p-4 rounded-lg flex flex-col text-left justify-between border"
8+
>
9+
<span className={`icon icon-medium ${icon} text-blue-600`}></span>
10+
<div>
11+
<small>{title}</small>
12+
<p>{body}</p>
13+
</div>
14+
</div>
15+
);
16+
}
17+
18+
export default AudioDotComCard;

src/components/card/DownloadCard.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from "react";
33
function DownloadCard(props) {
44
const { OS, title, downloadURL, downloadType, checksum } = props;
55

6-
function handleButtonClick() {
6+
function handleDownloadButtonClick() {
77
if (typeof _paq !== "undefined") {
88
_paq.push([
99
"trackEvent",
@@ -12,6 +12,10 @@ function DownloadCard(props) {
1212
`${OS + " " + title + " " + downloadType}`,
1313
]);
1414
}
15+
16+
setTimeout(() => {
17+
window.location.href = "/post-download";
18+
}, 2000);
1519
}
1620

1721
return (
@@ -20,7 +24,7 @@ function DownloadCard(props) {
2024
<h2 className="text-xl font-semibold">{title}</h2>
2125
<a
2226
onClick={() => {
23-
handleButtonClick();
27+
handleDownloadButtonClick();
2428
}}
2529
href={downloadURL}
2630
className="flex justify-center text-center items-center px-4 h-12 w-full sm:w-fit bg-slate-200 hover:bg-slate-300 text-base text-black rounded"

src/components/card/FeatureCard.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import React from "react";
21
import '../../styles/icons.css'
32

43
function FeatureCard(props) {
54
const { icon, title, description } = props;
65

76
return (
8-
<div className="h-full col-span-12 sm:col-span-6 xl:col-span-3 p-4 md:p-6 border drop-shadow-sm md:drop-shadow-lg bg-white rounded-lg flex flex-col md:gap-2">
7+
<div className="h-full col-span-6 xl:col-span-3 p-4 md:p-6 border drop-shadow-sm md:drop-shadow-lg bg-white rounded-lg flex flex-col md:gap-2">
98
<span className={`icon icon-medium text-blue-700 ${icon}`}></span>
109
<p className="text-lg font-semibold">{title}</p>
1110
<p className="">{description}</p>

src/layouts/DownloadPageLayout.astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import BaseLayout from "./BaseLayout.astro";
33
import DownloadCard from "../components/card/DownloadCard";
44
import IconLinkCard from "../components/card/IconLinkCard";
5+
import PlatformDownloadMuseHubButton from "../components/button/PlatformDownloadMuseHubButton";
56
import { Icon } from "astro-icon";
67
import "../styles/icons.css";
78
import {
@@ -68,12 +69,11 @@ const {
6869
<p>via Muse Hub</p>
6970
</div>
7071

71-
<a
72-
href={museHubReleaseData[0].browser_download_url}
73-
class="flex justify-center text-center items-center px-4 h-12 w-full sm:w-fit bg-blue-700 hover:bg-blue-600 text-base text-white rounded"
74-
>
75-
Download
76-
</a>
72+
<PlatformDownloadMuseHubButton
73+
client:load
74+
museHubReleaseData={museHubReleaseData}
75+
OS={OS}
76+
/>
7777
</div>
7878
</div>
7979
</section>

src/pages/post-download.astro

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
import BaseLayout from "../layouts/BaseLayout.astro";
3+
import JoinAudioDotComButton from "../components/button/JoinAudioDotComButton";
4+
import "../styles/icons.css";
5+
import FeatureCard from "../components/card/FeatureCard";
6+
---
7+
8+
<BaseLayout title="Audacity ® | post-download">
9+
<section>
10+
<div class="text-center bg-blue-700 py-4">
11+
<p class="text-lg text-white">Thank you for downloading Audacity!</p>
12+
</div>
13+
</section>
14+
15+
<section class="mx-8 max-w-screen-md xl:max-w-screen-lg md:mx-auto">
16+
<div class="py-8 sm:py-12 flex flex-col items-center">
17+
<div class="text-center">
18+
<h1>
19+
Sign up to Audacity's cloud saving platform and access your
20+
projects from anywhere!
21+
</h1>
22+
<div class="mt-12"><JoinAudioDotComButton /></div>
23+
</div>
24+
25+
<div class="grid grid-cols-6 sm:grid-cols-12 w-full gap-4 m-16">
26+
<FeatureCard
27+
icon="icon-cloud"
28+
title="Secure cloud storage"
29+
description="Keep your projects safe and accessible with cloud storage. Access your work anywhere and never lose a file."
30+
/>
31+
<FeatureCard
32+
icon="icon-note"
33+
title="Share your creations"
34+
description="Upload and share your audio from Audacity with just a few clicks. Quick, easy, and built for creators."
35+
/>
36+
<FeatureCard
37+
icon="icon-pen"
38+
title="Transcribe your audio"
39+
description="Free AI-powered transcription for your podcasts or voice overs, delivering fast and precise text for effortless editing."
40+
/>
41+
<FeatureCard
42+
icon="icon-globe"
43+
title="Explore new sounds"
44+
description="Collaborate with other creators, find new inspiration, and discover sounds to enhance and elevate your projects."
45+
/>
46+
</div>
47+
</div>
48+
</section>
49+
</BaseLayout>

src/styles/icons.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
content: "\F359"
2828
}
2929

30+
.icon-cloud:before {
31+
content: "\F435"
32+
}
33+
3034
.icon-export:before {
3135
content: "\EF24"
3236
}
@@ -89,4 +93,16 @@
8993

9094
.icon-times:before {
9195
content: "\EF14"
96+
}
97+
98+
.icon-pen:before {
99+
content: "\EF63"
100+
}
101+
102+
.icon-note:before {
103+
content: "\F360"
104+
}
105+
106+
.icon-globe:before {
107+
content: "\F3B6"
92108
}

0 commit comments

Comments
 (0)