1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-19 19:05:56 +01:00
upscayl/renderer/components/sidebar/settings-tab/select-theme.tsx
NayamAmarshe 95843ded88
Refactor Renderer Code (#987)
* Initial refactor

* Remove unused imports

* Update code

* Refactor and Update Code

- Change file names to kebab-caase
- Add new useTranslation Hook
- Change useLog hook name to useLogger
- Update translation hook to provide autocomplete

* Update import and component name

* Rename files and components

* Update locales

* Update electron commands

* Update var

* Change Lowercase

* Replace filter with map

* Add props

* Update flag check

* Add validate paths

* Update formats

* Update import

* Update function

* Update function and translation

* Update handlePaste
2024-10-04 14:45:54 +05:30

55 lines
1.9 KiB
TypeScript

import { translationAtom } from "@/atoms/translations-atom";
import { useAtomValue } from "jotai";
import React from "react";
export function SelectTheme() {
const availableThemes = [
{ label: "upscayl", value: "upscayl" },
{ label: "light", value: "light" },
{ label: "dark", value: "dark" },
{ label: "cupcake", value: "cupcake" },
{ label: "bumblebee", value: "bumblebee" },
{ label: "emerald", value: "emerald" },
{ label: "corporate", value: "corporate" },
{ label: "synthwave", value: "synthwave" },
{ label: "retro", value: "retro" },
{ label: "cyberpunk", value: "cyberpunk" },
{ label: "valentine", value: "valentine" },
{ label: "halloween", value: "halloween" },
{ label: "garden", value: "garden" },
{ label: "forest", value: "forest" },
{ label: "aqua", value: "aqua" },
{ label: "lofi", value: "lofi" },
{ label: "pastel", value: "pastel" },
{ label: "fantasy", value: "fantasy" },
{ label: "wireframe", value: "wireframe" },
{ label: "black", value: "black" },
{ label: "luxury", value: "luxury" },
{ label: "dracula", value: "dracula" },
{ label: "cmyk", value: "cmyk" },
{ label: "autumn", value: "autumn" },
{ label: "business", value: "business" },
{ label: "acid", value: "acid" },
{ label: "lemonade", value: "lemonade" },
{ label: "night", value: "night" },
{ label: "coffee", value: "coffee" },
{ label: "winter", value: "winter" },
];
const t = useAtomValue(translationAtom);
return (
<div className="flex flex-col gap-2">
<p className="text-sm font-medium">{t("SETTINGS.THEME.TITLE")}</p>
<select data-choose-theme className="select select-primary">
{availableThemes.map((theme) => {
return (
<option value={theme.value} key={theme.value}>
{theme.label.toLocaleUpperCase()}
</option>
);
})}
</select>
</div>
);
}