feat: Add themes marketplace page and components

This commit is contained in:
Mauro Balades
2024-08-14 23:12:22 +02:00
parent ca1540a6c5
commit f16a46a290
8 changed files with 268 additions and 2 deletions

25
src/lib/themes.ts Normal file
View File

@@ -0,0 +1,25 @@
export interface ZenTheme {
name: string
description: string
image: string
downloadUrl: string
id: string
}
export function getAllThemes(): ZenTheme[] {
// TODO: Fetch themes from the marketplace (database or JSON file)
return [
{
name: "Zen",
description: "The default theme for Zen Browser",
downloadUrl: "https://zen-browser.app/download", // idrc
id: "zen",
image: "https://imgs.search.brave.com/qcDBMGuBLvJGLxWR3IkZyg35vROTSZ2omLn_0iLU2rs/rs:fit:860:0:0:0/g:ce/aHR0cHM6Ly9pLnBp/bmltZy5jb20vb3Jp/Z2luYWxzLzgxL2Mz/LzE0LzgxYzMxNDI5/MmViOGM3YzYxNmY5/ZjM3YTRmZDI5ODU4/LmpwZw",
},
];
}
export function getThemesFromSearch(themes: ZenTheme[], query: string): ZenTheme[] {
return themes.filter((theme) => theme.name.toLowerCase().includes(query.toLowerCase()));
}