|
1 | 1 | --- |
2 | | -import BaseLayout from "../layouts/BaseLayout.astro"; |
3 | | -import OperatingSystemCard from "../components/card/OperatingSystemCard"; |
4 | | -import "../styles/icons.css"; |
5 | 2 | import { |
6 | 3 | audacityReleases, |
7 | 4 | hasDownloadAssets, |
8 | 5 | preReleaseList, |
9 | 6 | type PreReleaseEntry, |
10 | 7 | } from "../assets/data/audacityReleases"; |
11 | 8 | import ChecksumAccordion from "../components/accordion/ChecksumAccordion"; |
| 9 | +import OperatingSystemCard from "../components/card/OperatingSystemCard"; |
| 10 | +import BaseLayout from "../layouts/BaseLayout.astro"; |
| 11 | +import "../styles/icons.css"; |
12 | 12 |
|
13 | 13 | const { version } = audacityReleases; |
14 | 14 | const sourceDownloads = audacityReleases.src ?? []; |
15 | 15 | const primarySourceDownload = sourceDownloads[0] ?? null; |
16 | 16 | const activeDownloadEntries = preReleaseList.filter( |
17 | | - (entry) => entry.isActive && hasDownloadAssets(entry.downloads), |
| 17 | + (entry) => entry.isActive && hasDownloadAssets(entry.downloads) |
18 | 18 | ); |
19 | 19 | const hasDownloadCampaigns = activeDownloadEntries.length > 0; |
20 | 20 |
|
21 | 21 | const formatCampaignLinkLabel = ( |
22 | 22 | entry: PreReleaseEntry, |
23 | 23 | platform: string, |
24 | | - buildName?: string, |
| 24 | + buildName?: string |
25 | 25 | ) => |
26 | 26 | `${entry.downloads.version} for ${platform}${ |
27 | 27 | buildName ? ` (${buildName})` : "" |
@@ -74,77 +74,84 @@ const formatCampaignLinkLabel = ( |
74 | 74 | </div> |
75 | 75 | </section> |
76 | 76 | <aside class="col-start-2 col-span-10 sm:col-start-8 sm:col-span-3"> |
77 | | - {hasDownloadCampaigns && ( |
78 | | - <div> |
79 | | - <h2 class="text-sm uppercase font-normal text-gray-600"> |
80 | | - Pre-release builds |
81 | | - </h2> |
82 | | - <div class="flex flex-col gap-6 mt-2"> |
83 | | - {activeDownloadEntries.map((entry) => { |
84 | | - const downloads = entry.downloads; |
85 | | - const windowsBuilds = downloads.win ?? []; |
86 | | - const macBuilds = downloads.mac ?? []; |
87 | | - const linuxBuilds = downloads.lin ?? []; |
88 | | - const versionLabel = downloads.version; |
| 77 | + { |
| 78 | + hasDownloadCampaigns && ( |
| 79 | + <div> |
| 80 | + <h2 class="text-sm uppercase font-normal text-gray-600"> |
| 81 | + Pre-release builds |
| 82 | + </h2> |
| 83 | + <div class="flex flex-col gap-6 mt-2"> |
| 84 | + {activeDownloadEntries.map((entry) => { |
| 85 | + const downloads = entry.downloads; |
| 86 | + const windowsBuilds = downloads.win ?? []; |
| 87 | + const macBuilds = downloads.mac ?? []; |
| 88 | + const linuxBuilds = downloads.lin ?? []; |
| 89 | + const versionLabel = downloads.version; |
89 | 90 |
|
90 | | - return ( |
91 | | - <div class="flex flex-col gap-3"> |
92 | | - <h3 class="text-base font-semibold text-gray-900"> |
93 | | - {versionLabel} |
94 | | - </h3> |
95 | | - <p class="text-sm text-gray-700"> |
96 | | - {entry.summary} |
97 | | - </p> |
98 | | - <ul class="flex flex-col gap-2 text-sm"> |
99 | | - { |
100 | | - windowsBuilds.map((build) => ( |
| 91 | + return ( |
| 92 | + <div class="flex flex-col gap-3"> |
| 93 | + <h3 class="text-base font-semibold text-gray-900"> |
| 94 | + {versionLabel} |
| 95 | + </h3> |
| 96 | + <p class="text-sm text-gray-700">{entry.summary}</p> |
| 97 | + {entry.id === "alpha" && <au4alpha2 />} |
| 98 | + <ul class="flex flex-col gap-2 text-sm"> |
| 99 | + {windowsBuilds.map((build) => ( |
101 | 100 | <li> |
102 | 101 | <a |
103 | 102 | class="hyperlink" |
104 | 103 | href={build.browser_download_url} |
105 | 104 | > |
106 | | - {formatCampaignLinkLabel(entry, "Windows", build.name)} |
| 105 | + {formatCampaignLinkLabel( |
| 106 | + entry, |
| 107 | + "Windows", |
| 108 | + build.name |
| 109 | + )} |
107 | 110 | </a> |
108 | 111 | </li> |
109 | | - )) |
110 | | - } |
111 | | - { |
112 | | - macBuilds.map((build) => ( |
| 112 | + ))} |
| 113 | + {macBuilds.map((build) => ( |
113 | 114 | <li> |
114 | 115 | <a |
115 | 116 | class="hyperlink" |
116 | 117 | href={build.browser_download_url} |
117 | 118 | > |
118 | | - {formatCampaignLinkLabel(entry, "macOS", build.name)} |
| 119 | + {formatCampaignLinkLabel( |
| 120 | + entry, |
| 121 | + "macOS", |
| 122 | + build.name |
| 123 | + )} |
119 | 124 | </a> |
120 | 125 | </li> |
121 | | - )) |
122 | | - } |
123 | | - { |
124 | | - linuxBuilds.map((build) => ( |
| 126 | + ))} |
| 127 | + {linuxBuilds.map((build) => ( |
125 | 128 | <li> |
126 | 129 | <a |
127 | 130 | class="hyperlink" |
128 | 131 | href={build.browser_download_url} |
129 | 132 | > |
130 | | - {formatCampaignLinkLabel(entry, "Linux", build.name)} |
| 133 | + {formatCampaignLinkLabel( |
| 134 | + entry, |
| 135 | + "Linux", |
| 136 | + build.name |
| 137 | + )} |
131 | 138 | </a> |
132 | 139 | </li> |
133 | | - )) |
134 | | - } |
135 | | - </ul> |
136 | | - <div class="flex items-center gap-1"> |
137 | | - <a href={entry.pageHref} class="hyperlink text-sm"> |
138 | | - {`Learn more about ${versionLabel}`} |
139 | | - </a> |
140 | | - <span class="align-middle icon icon-share text-blue-600"></span> |
| 140 | + ))} |
| 141 | + </ul> |
| 142 | + <div class="flex items-center gap-1"> |
| 143 | + <a href={entry.pageHref} class="hyperlink text-sm"> |
| 144 | + {`Learn more about ${versionLabel}`} |
| 145 | + </a> |
| 146 | + <span class="align-middle icon icon-share text-blue-600" /> |
| 147 | + </div> |
141 | 148 | </div> |
142 | | - </div> |
143 | | - ); |
144 | | - })} |
| 149 | + ); |
| 150 | + })} |
| 151 | + </div> |
145 | 152 | </div> |
146 | | - </div> |
147 | | - )} |
| 153 | + ) |
| 154 | + } |
148 | 155 | <h2 class="text-sm uppercase font-normal text-gray-600 mt-10"> |
149 | 156 | Additional resources |
150 | 157 | </h2> |
@@ -176,18 +183,20 @@ const formatCampaignLinkLabel = ( |
176 | 183 | <h3 class="additional-resource-heading">Source code</h3> |
177 | 184 | <div class="flex flex-col gap-2"> |
178 | 185 | <!-- TODO - Ensure accordions are included in the tab hierarchy --> |
179 | | - {primarySourceDownload ? ( |
180 | | - <ChecksumAccordion |
181 | | - title={primarySourceDownload.type} |
182 | | - downloadUrl={primarySourceDownload.browser_download_url} |
183 | | - checksum={primarySourceDownload.checksum} |
184 | | - client:load |
185 | | - /> |
186 | | - ) : ( |
187 | | - <p class="text-sm text-gray-700"> |
188 | | - Source code packages are not available right now. |
189 | | - </p> |
190 | | - )} |
| 186 | + { |
| 187 | + primarySourceDownload ? ( |
| 188 | + <ChecksumAccordion |
| 189 | + title={primarySourceDownload.type} |
| 190 | + downloadUrl={primarySourceDownload.browser_download_url} |
| 191 | + checksum={primarySourceDownload.checksum} |
| 192 | + client:load |
| 193 | + /> |
| 194 | + ) : ( |
| 195 | + <p class="text-sm text-gray-700"> |
| 196 | + Source code packages are not available right now. |
| 197 | + </p> |
| 198 | + ) |
| 199 | + } |
191 | 200 | </div> |
192 | 201 | </div> |
193 | 202 |
|
|
0 commit comments