mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-09 03:37:45 +03:00
feat: disable delete all themes button when no themes exist
This commit is contained in:
commit
15746a5598
@ -7,9 +7,10 @@ import { useState } from "react";
|
||||
|
||||
interface ThemeActionsProps {
|
||||
onListUpdated: () => void;
|
||||
themesCount: number;
|
||||
}
|
||||
|
||||
export const ThemeActions = ({ onListUpdated }: ThemeActionsProps) => {
|
||||
export const ThemeActions = ({ onListUpdated, themesCount }: ThemeActionsProps) => {
|
||||
const { t } = useTranslation("settings");
|
||||
|
||||
const [addThemeModalVisible, setAddThemeModalVisible] = useState(false);
|
||||
@ -41,6 +42,7 @@ export const ThemeActions = ({ onListUpdated }: ThemeActionsProps) => {
|
||||
theme="danger"
|
||||
className="settings-appearance__button"
|
||||
onClick={() => setDeleteAllThemesModalVisible(true)}
|
||||
disabled={themesCount < 1}
|
||||
>
|
||||
<TrashIcon />
|
||||
{t("clear_themes")}
|
||||
|
@ -19,7 +19,7 @@ export const SettingsAppearance = () => {
|
||||
<div className="settings-appearance">
|
||||
<p className="settings-appearance__description">Appearance</p>
|
||||
|
||||
<ThemeActions onListUpdated={loadThemes} />
|
||||
<ThemeActions onListUpdated={loadThemes} themesCount={themes.length} />
|
||||
|
||||
<div className="settings-appearance__themes">
|
||||
{!themes.length ? (
|
||||
|
Loading…
Reference in New Issue
Block a user