Skip to content

Commit 6f60359

Browse files
committed
refactor: streamline promo banner data
1 parent 5d4a783 commit 6f60359

File tree

13 files changed

+786
-295
lines changed

13 files changed

+786
-295
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"astro-compressor": "^0.4.1",
2222
"astro-icon": "^0.8.1",
2323
"astro-lazy-youtube-embed": "^0.5.4",
24+
"classnames": "^2.5.1",
2425
"platform": "^1.3.6",
2526
"react": "^18.2.0",
2627
"react-dom": "^18.2.0",

src/assets/data/audacityReleases.ts

Lines changed: 163 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
export type ReleaseInfo = {
22
name: string;
33
browser_download_url: string;
4-
checksum: string;
4+
checksum?: string;
55
type: string;
66
};
77

8-
type ReleaseDirectory = {
8+
export type ReleaseDirectory = {
99
version: string;
1010
win: ReleaseInfo[];
1111
mac: ReleaseInfo[];
1212
lin: ReleaseInfo[];
13-
src: ReleaseInfo[];
13+
src?: ReleaseInfo[];
1414
};
1515

16+
export type ActivationState = "active" | "inactive";
17+
1618
export const audacityReleases: ReleaseDirectory = {
1719
version: "3.7.5",
1820
win: [
@@ -127,4 +129,161 @@ export const audacityReleases: ReleaseDirectory = {
127129
type: ".tar.gz",
128130
},
129131
],
130-
};
132+
};
133+
134+
export const hasDownloadAssets = (downloads?: ReleaseDirectory): boolean => {
135+
if (!downloads) {
136+
return false;
137+
}
138+
139+
const { win, mac, lin, src } = downloads;
140+
141+
return Boolean(
142+
(win && win.length)
143+
|| (mac && mac.length)
144+
|| (lin && lin.length)
145+
|| (src && src.length),
146+
);
147+
};
148+
149+
export type PreReleaseEntry = {
150+
id: string;
151+
label: string;
152+
status: ActivationState;
153+
summary: string;
154+
pageHref: string;
155+
downloads: ReleaseDirectory;
156+
};
157+
158+
export const alphaPreRelease: PreReleaseEntry = {
159+
id: "alpha",
160+
label: "Alpha",
161+
status: "active",
162+
summary:
163+
"Get an early look at the next major release. Expect unfinished features and potential bugs.",
164+
pageHref: "/au4",
165+
downloads: {
166+
version: "Audacity 4 Alpha 1",
167+
win: [
168+
{
169+
name: "64 bit",
170+
browser_download_url:
171+
"https://github.com/audacity/audacity/actions/runs/18406361889/artifacts/4237171895",
172+
type: ".zip",
173+
},
174+
],
175+
mac: [
176+
{
177+
name: "ARM 64 zip (Apple Silicon)",
178+
browser_download_url:
179+
"https://github.com/audacity/audacity/actions/runs/18406354692/artifacts/4237536953",
180+
type: ".zip",
181+
},
182+
],
183+
lin: [
184+
{
185+
name: "AppImage",
186+
browser_download_url:
187+
"https://github.com/audacity/audacity/actions/runs/18406368664/artifacts/4237050905",
188+
type: ".zip",
189+
},
190+
],
191+
src: [],
192+
},
193+
};
194+
195+
export const betaPreRelease: PreReleaseEntry = {
196+
id: "beta",
197+
label: "Beta",
198+
status: "inactive",
199+
summary: "Help us test upcoming features before they ship.",
200+
pageHref: "/beta",
201+
downloads: {
202+
version: "3.5.0 beta",
203+
win: [
204+
{
205+
name: "64 bit installer (recommended)",
206+
browser_download_url:
207+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-win-3.5.0-beta-3-64bit.exe",
208+
checksum:
209+
"ed7de964ed11cbc8f74e815dbcb2cb8487ba136818cf1a148f16cadd4c10f3d0",
210+
type: ".exe",
211+
},
212+
{
213+
name: "64 bit zip file",
214+
browser_download_url:
215+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-win-3.5.0-beta-3-64bit.zip",
216+
checksum:
217+
"52da5c3e2507408d72c4ab425c2e465e3c8ad452b2ac89ddfb3f5bc141d68a03",
218+
type: ".zip",
219+
},
220+
{
221+
name: "32 bit installer",
222+
browser_download_url:
223+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-win-3.5.0-beta-3-32bit.exe",
224+
checksum:
225+
"6bb6c0d3513be7d98c400f43d84cd39992065f4c6460d80b6cb1667733ca95c7",
226+
type: ".exe",
227+
},
228+
{
229+
name: "32 bit zip file",
230+
browser_download_url:
231+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-win-3.5.0-beta-3-32bit.zip",
232+
checksum:
233+
"c313ca3c475b487bf88a42537cbc9454090391250017fe210226b3ca78797d9a",
234+
type: ".zip",
235+
},
236+
],
237+
mac: [
238+
{
239+
name: "Universal dmg (recommended)",
240+
browser_download_url:
241+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-macOS-3.5.0-beta-3-universal.dmg",
242+
checksum:
243+
"9500ede91b837fc12e5106fa33d6603829288b90fb1e28d2d70bfee9db33406e",
244+
type: ".dmg",
245+
},
246+
{
247+
name: "ARM 64 dmg (Apple Silicon)",
248+
browser_download_url:
249+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-macOS-3.5.0-beta-3-arm64.dmg",
250+
checksum:
251+
"0f3e9b9ee8e77d8b8613db8d66927e982bbec870e801811060d3d8fbc25c7698",
252+
type: ".dmg",
253+
},
254+
{
255+
name: "x86_64 dmg (Intel)",
256+
browser_download_url:
257+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-macOS-3.5.0-beta-3-x86_64.dmg",
258+
checksum:
259+
"415342de27b572bd3801f51bd77e850a21701b39e2392c2c347ea8db4da4f122",
260+
type: ".dmg",
261+
},
262+
],
263+
lin: [
264+
{
265+
name: "AppImage",
266+
browser_download_url:
267+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-linux-3.5.0-beta-3-x64.AppImage",
268+
checksum:
269+
"fc5df63e3819f4f59b4366c436579bd1a73b045a4dae28316edf6c23948a06ce",
270+
type: ".AppImage",
271+
},
272+
],
273+
src: [
274+
{
275+
name: "Source code",
276+
browser_download_url:
277+
"https://github.com/audacity/audacity/releases/download/Audacity-3.5.0-beta-3/audacity-sources-3.5.0-beta-3.tar.gz",
278+
checksum:
279+
"53c33ed875f4eb1501707d7989a6de253370a368c1c50a877e5cfa96c02bebdc",
280+
type: ".tar.gz",
281+
},
282+
],
283+
},
284+
};
285+
286+
export const preReleaseList: PreReleaseEntry[] = [
287+
alphaPreRelease,
288+
betaPreRelease,
289+
];

src/assets/data/betaReleases.ts

Lines changed: 0 additions & 98 deletions
This file was deleted.

src/assets/data/promotions.ts

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
export type PromoData = {
2+
isActive?: boolean;
3+
priority?: number;
4+
osTargets?: string[];
5+
message: string;
6+
styles?: {
7+
container?: string;
8+
message?: string;
9+
button?: string;
10+
};
11+
tracking?: {
12+
category: string;
13+
action: string;
14+
name: string;
15+
};
16+
cta?: {
17+
text: string;
18+
link: string;
19+
};
20+
};
21+
22+
const promoData: Record<string, PromoData> = {
23+
voiceByAuribus: {
24+
isActive: true,
25+
priority: 50,
26+
osTargets: ["Windows", "OS X"],
27+
message:
28+
"AI powered professional vocals. Transform any track with Voice by Auribus!",
29+
styles: {
30+
container: "bg-yellow-300",
31+
message: "text-gray-900",
32+
button: "bg-gray-100 hover:bg-white",
33+
},
34+
tracking: {
35+
category: "Promo CTA",
36+
action: "Promo CTA button",
37+
name: "Voice by Auribus Muse Hub",
38+
},
39+
cta: {
40+
text: "Get it on MuseHub",
41+
link: "https://www.musehub.com/plugin/auribus?utm_source=au-web&utm_medium=au-banner&utm_campaign=au-web-mh-web-auribus",
42+
},
43+
},
44+
ampknob: {
45+
osTargets: ["Windows", "OS X"],
46+
message: "Heavy guitar tone in seconds. One knob, no distractions.",
47+
styles: {
48+
container: "bg-yellow-300",
49+
message: "text-gray-900 font-bold",
50+
button:
51+
"font-bold border-2 border-gray-900 bg-gray-900 text-white hover:bg-yellow-300 hover:text-gray-900 hover:border-gray-900",
52+
},
53+
tracking: {
54+
category: "Promo CTA",
55+
action: "Promo CTA button",
56+
name: "Ampknob Revc Muse Hub",
57+
},
58+
cta: {
59+
text: "Try for free",
60+
link: "https://www.musehub.com/plugin/ampknob-revc?utm_source=audacity&utm_medium=web&utm_campaign=auampknob-revc",
61+
},
62+
},
63+
survey: {
64+
isActive: false,
65+
priority: 40,
66+
message: "3 minute survey:\nHelp us understand what features you want next",
67+
styles: {
68+
container: "bg-yellow-300",
69+
message: "text-lg text-gray-900",
70+
button:
71+
"h-10 bg-gray-100 hover:bg-white border border-gray-900 text-gray-900",
72+
},
73+
tracking: {
74+
category: "Promo CTA",
75+
action: "Survey CTA button",
76+
name: "Go to Survey",
77+
},
78+
cta: {
79+
text: "Take the survey",
80+
link: "https://docs.google.com/forms/d/e/1FAIpQLScxH_f64JPCWt5nwqa8MTPXfmi453mqYwy1xZFPF_mx9mYkNw/viewform",
81+
},
82+
},
83+
};
84+
85+
export default promoData;

0 commit comments

Comments
 (0)