Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(website): reorder platforms to always get the recommended one in center
Elian Dorance0763f03de5
diff --git a/apps/website/src/pages/GetStarted/get-started.tsx b/apps/website/src/pages/GetStarted/get-started.tsxindex 39027c55d2..f458c9e4d8 100644--- a/apps/website/src/pages/GetStarted/get-started.tsx+++ b/apps/website/src/pages/GetStarted/get-started.tsx@@ -38,7 +38,8 @@ export default function DownloadPage() {</div><div className="grid-3-cols download-desktop">- {Object.entries(downloadMatrix.desktop).map(entry => (+ {reorderPlatforms(Object.entries(downloadMatrix.desktop), userPlatform ?? "")+ .map(entry => (<DownloadCard app="desktop" arch={currentArch} entry={entry} isRecommended={userPlatform === entry[0]} />))}</div>@@ -126,3 +127,13 @@ export function DownloadCard({ app, arch, entry: [ platform, entry ], isRecommen</Card>)}++function reorderPlatforms(entries: [string, DownloadMatrixEntry][], platformToCenter: Platform | "") {+ const entryToCenter = entries.find(x => x[0] === platformToCenter);+ if (!entryToCenter) return entries;++ const others = entries.filter(x => x !== entryToCenter);+ const mid = Math.floor(others.length / 2);+ others.splice(mid, 0, entryToCenter);+ return others;+}