diff --git a/src/components/Form/Settings/ChipSelect/ChipSelect.jsx b/src/components/Form/Settings/ChipSelect/ChipSelect.jsx
index c2a5c7ae..d25ecafa 100644
--- a/src/components/Form/Settings/ChipSelect/ChipSelect.jsx
+++ b/src/components/Form/Settings/ChipSelect/ChipSelect.jsx
@@ -4,8 +4,9 @@ import { MdExpandMore, MdClose, MdCheck } from 'react-icons/md';
import './ChipSelect.scss';
-function ChipSelect({ label, options, onChange }) {
- let start = (localStorage.getItem('apiCategories') || '').split(',');
+function ChipSelect({ label, options, onChange, name }) {
+ const storageKey = name || 'apiCategories';
+ let start = (localStorage.getItem(storageKey) || '').split(',');
if (start[0] === '') {
start = [];
}
@@ -84,7 +85,8 @@ function ChipSelect({ label, options, onChange }) {
}
setOptionsSelected(newSelected);
- localStorage.setItem('apiCategories', newSelected.join(','));
+ const storageKey = name || 'apiCategories';
+ localStorage.setItem(storageKey, newSelected.join(','));
if (onChange) {
onChange(newSelected);
diff --git a/src/features/background/options/sections/PhotoPackSettings.jsx b/src/features/background/options/sections/PhotoPackSettings.jsx
index c715955a..ad8ae674 100644
--- a/src/features/background/options/sections/PhotoPackSettings.jsx
+++ b/src/features/background/options/sections/PhotoPackSettings.jsx
@@ -1,54 +1,12 @@
import React, { useState, useEffect } from 'react';
import variables from 'config/variables';
import EventBus from 'utils/eventbus';
-import { Dropdown, Text, Switch, Slider } from 'components/Form/Settings';
+import { Dropdown, Text, Switch, Slider, ChipSelect } from 'components/Form/Settings';
import { Row, Content, Action } from 'components/Layout/Settings/Item';
import { Button } from 'components/Elements';
+import { Section } from 'components/Layout/Settings';
import { refreshAPIPackCache } from 'features/background/api/photoPackAPI';
-import { MdRefresh, MdWarning } from 'react-icons/md';
-
-/**
- * ChipSelect component for multi-select options
- */
-const ChipSelect = ({ label, options, defaultValue, name, onChange }) => {
- const [selected, setSelected] = useState(defaultValue || []);
-
- const toggleChip = (value) => {
- const newSelected = selected.includes(value)
- ? selected.filter((v) => v !== value)
- : [...selected, value];
- setSelected(newSelected);
- onChange(newSelected);
- };
-
- return (
-
-
-
- {options.map((option) => (
-
- ))}
-
-
- );
-};
+import { MdRefresh, MdWarning, MdExpandMore, MdExpandLess } from 'react-icons/md';
const PhotoPackSettings = ({ pack }) => {
if (!pack.settings_schema || pack.settings_schema.length === 0) {
@@ -63,6 +21,7 @@ const PhotoPackSettings = ({ pack }) => {
const [dynamicOptions, setDynamicOptions] = useState({});
const [isRefreshing, setIsRefreshing] = useState(false);
const [validationErrors, setValidationErrors] = useState([]);
+ const [isExpanded, setIsExpanded] = useState(false);
// Load dynamic options (e.g., categories from API)
useEffect(() => {
@@ -85,7 +44,7 @@ const PhotoPackSettings = ({ pack }) => {
const categories = await response.json();
setDynamicOptions((prev) => ({
...prev,
- [field.key]: categories.map((cat) => ({ value: cat, label: cat })),
+ [field.key]: categories,
}));
} catch (error) {
console.error('Failed to load categories:', error);
@@ -139,12 +98,16 @@ const PhotoPackSettings = ({ pack }) => {
switch (field.type) {
case 'dropdown':
+ const dropdownItems = field.options.map((opt) => ({
+ value: opt.value,
+ text: opt.label,
+ }));
return (
handleSettingChange(field.key, newValue)}
/>
);
@@ -155,7 +118,6 @@ const PhotoPackSettings = ({ pack }) => {
handleSettingChange(field.key, newValue)}
/>
@@ -204,38 +166,60 @@ const PhotoPackSettings = ({ pack }) => {
return (
<>
-
-
-
- }
- label="Refresh Photos"
- disabled={isRefreshing || validationErrors.length > 0}
- />
-
-
+ setIsExpanded(!isExpanded)}
+ >
+ {isExpanded ? : }
+
- {validationErrors.length > 0 && (
-
-
-
-
- Configuration incomplete: {validationErrors.join(', ')}
-
-
-
+ {isExpanded && (
+ <>
+
+
+
+ }
+ label={variables.getMessage(
+ 'modals.main.settings.sections.background.photo_pack_settings.refresh_photos',
+ )}
+ disabled={isRefreshing || validationErrors.length > 0}
+ />
+
+
+
+ {validationErrors.length > 0 && (
+
+
+
+
+ Configuration incomplete: {validationErrors.join(', ')}
+
+
+
+ )}
+
+ {pack.settings_schema.map((field, index) => (
+
+
+ {renderField(field, index)}
+
+ ))}
+ >
)}
-
- {pack.settings_schema.map((field, index) => (
-
-
- {renderField(field, index)}
-
- ))}
>
);
};
diff --git a/src/i18n/locales/ar.json b/src/i18n/locales/ar.json
index 4a9db686..a00db4e3 100644
--- a/src/i18n/locales/ar.json
+++ b/src/i18n/locales/ar.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "البحث",
diff --git a/src/i18n/locales/arz.json b/src/i18n/locales/arz.json
index 36a84a98..f99f2819 100644
--- a/src/i18n/locales/arz.json
+++ b/src/i18n/locales/arz.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/az.json b/src/i18n/locales/az.json
index fabccf9a..c490bbef 100644
--- a/src/i18n/locales/az.json
+++ b/src/i18n/locales/az.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Axtarış",
diff --git a/src/i18n/locales/azb.json b/src/i18n/locales/azb.json
index f9e7c479..93441d97 100644
--- a/src/i18n/locales/azb.json
+++ b/src/i18n/locales/azb.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Axtarış",
diff --git a/src/i18n/locales/bn.json b/src/i18n/locales/bn.json
index f50e1757..d1607244 100644
--- a/src/i18n/locales/bn.json
+++ b/src/i18n/locales/bn.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/de_DE.json b/src/i18n/locales/de_DE.json
index 2359b3fe..88f4f624 100644
--- a/src/i18n/locales/de_DE.json
+++ b/src/i18n/locales/de_DE.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Suche",
diff --git a/src/i18n/locales/el.json b/src/i18n/locales/el.json
index f377f719..a9110cd4 100644
--- a/src/i18n/locales/el.json
+++ b/src/i18n/locales/el.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/en_GB.json b/src/i18n/locales/en_GB.json
index 44cb8f47..22ec07e4 100644
--- a/src/i18n/locales/en_GB.json
+++ b/src/i18n/locales/en_GB.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/en_US.json b/src/i18n/locales/en_US.json
index c59ab45b..3d38463b 100644
--- a/src/i18n/locales/en_US.json
+++ b/src/i18n/locales/en_US.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json
index 64c369e4..12f11177 100644
--- a/src/i18n/locales/es.json
+++ b/src/i18n/locales/es.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Búsqueda",
diff --git a/src/i18n/locales/es_419.json b/src/i18n/locales/es_419.json
index e6b2c348..4dee3bba 100644
--- a/src/i18n/locales/es_419.json
+++ b/src/i18n/locales/es_419.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Búsqueda",
diff --git a/src/i18n/locales/et.json b/src/i18n/locales/et.json
index bab5f155..11875bff 100644
--- a/src/i18n/locales/et.json
+++ b/src/i18n/locales/et.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Otsing",
diff --git a/src/i18n/locales/fa.json b/src/i18n/locales/fa.json
index 7a88062f..607d1c90 100644
--- a/src/i18n/locales/fa.json
+++ b/src/i18n/locales/fa.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json
index 0275c1f2..8bdd3aad 100644
--- a/src/i18n/locales/fr.json
+++ b/src/i18n/locales/fr.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Recherche",
diff --git a/src/i18n/locales/hu.json b/src/i18n/locales/hu.json
index a3ab45cf..adde6f5d 100644
--- a/src/i18n/locales/hu.json
+++ b/src/i18n/locales/hu.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/id_ID.json b/src/i18n/locales/id_ID.json
index 66ccd084..5f346d92 100644
--- a/src/i18n/locales/id_ID.json
+++ b/src/i18n/locales/id_ID.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Cari",
diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json
index ce664a61..20c89b80 100644
--- a/src/i18n/locales/ja.json
+++ b/src/i18n/locales/ja.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/lt.json b/src/i18n/locales/lt.json
index e99a17ba..05a420d2 100644
--- a/src/i18n/locales/lt.json
+++ b/src/i18n/locales/lt.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Paieška",
diff --git a/src/i18n/locales/lv.json b/src/i18n/locales/lv.json
index 33e6c70a..d4ece427 100644
--- a/src/i18n/locales/lv.json
+++ b/src/i18n/locales/lv.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Meklēšana",
diff --git a/src/i18n/locales/nl.json b/src/i18n/locales/nl.json
index f5ad886c..fd53df32 100644
--- a/src/i18n/locales/nl.json
+++ b/src/i18n/locales/nl.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Zoekbalk",
diff --git a/src/i18n/locales/no.json b/src/i18n/locales/no.json
index bc40f73c..4432c3db 100644
--- a/src/i18n/locales/no.json
+++ b/src/i18n/locales/no.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Søkebar",
diff --git a/src/i18n/locales/peo.json b/src/i18n/locales/peo.json
index 993adfea..d56e8167 100644
--- a/src/i18n/locales/peo.json
+++ b/src/i18n/locales/peo.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json
index 0c9e2a09..fc93e570 100644
--- a/src/i18n/locales/pt.json
+++ b/src/i18n/locales/pt.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Pesquisar",
diff --git a/src/i18n/locales/pt_BR.json b/src/i18n/locales/pt_BR.json
index 93b77238..3a6d5e3b 100644
--- a/src/i18n/locales/pt_BR.json
+++ b/src/i18n/locales/pt_BR.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Pesquisar",
diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json
index 759b5946..b0438bd8 100644
--- a/src/i18n/locales/ru.json
+++ b/src/i18n/locales/ru.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Панель поиска",
diff --git a/src/i18n/locales/sl.json b/src/i18n/locales/sl.json
index 8500a4ef..7390c1c3 100644
--- a/src/i18n/locales/sl.json
+++ b/src/i18n/locales/sl.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Iskanje",
diff --git a/src/i18n/locales/sv.json b/src/i18n/locales/sv.json
index 84a96db8..98ccaa99 100644
--- a/src/i18n/locales/sv.json
+++ b/src/i18n/locales/sv.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/ta.json b/src/i18n/locales/ta.json
index 2982f7ce..85c3dfa1 100644
--- a/src/i18n/locales/ta.json
+++ b/src/i18n/locales/ta.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "தேடல்",
diff --git a/src/i18n/locales/tr_TR.json b/src/i18n/locales/tr_TR.json
index c46b65b9..8bc196b6 100644
--- a/src/i18n/locales/tr_TR.json
+++ b/src/i18n/locales/tr_TR.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Arama",
diff --git a/src/i18n/locales/uk.json b/src/i18n/locales/uk.json
index dc975068..fa9619a7 100644
--- a/src/i18n/locales/uk.json
+++ b/src/i18n/locales/uk.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Пошук",
diff --git a/src/i18n/locales/vi.json b/src/i18n/locales/vi.json
index f881b95a..410ee158 100644
--- a/src/i18n/locales/vi.json
+++ b/src/i18n/locales/vi.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",
diff --git a/src/i18n/locales/zh_CN.json b/src/i18n/locales/zh_CN.json
index 4c2d78df..20eda0c5 100644
--- a/src/i18n/locales/zh_CN.json
+++ b/src/i18n/locales/zh_CN.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "搜索栏",
diff --git a/src/i18n/locales/zh_Hant.json b/src/i18n/locales/zh_Hant.json
index dc85390c..b03b870a 100644
--- a/src/i18n/locales/zh_Hant.json
+++ b/src/i18n/locales/zh_Hant.json
@@ -312,7 +312,11 @@
"hour": "Once an hour",
"day": "Once a day"
},
- "installed_packs_title": "Installed Photo Packs"
+ "installed_packs_title": "Installed Photo Packs",
+ "photo_pack_settings": {
+ "title": "{name} Settings",
+ "refresh_photos": "Refresh Photos"
+ }
},
"search": {
"title": "Search",