Add transparency effects toggle to settings

This commit is contained in:
SethBurkart123
2023-11-14 17:30:19 +11:00
parent 34931775c2
commit 8dbc138638
8 changed files with 24 additions and 9 deletions
+1
View File
@@ -23,6 +23,7 @@ export const SettingsContextProvider: React.FC<{ children: ReactNode }> = ({ chi
betterSEQTAPlus: true,
shortcuts: [],
customshortcuts: [],
transparencyEffects: false,
});
const [showPicker, setShowPicker] = useState<boolean>(false);
+2
View File
@@ -22,6 +22,7 @@ const useSettingsState = ({ settingsState, setSettingsState }: SettingsProps) =>
betterSEQTAPlus: result.onoff,
shortcuts: result.shortcuts,
customshortcuts: result.customshortcuts,
transparencyEffects: result.transparencyEffects
});
if (result.DarkMode) {
@@ -39,6 +40,7 @@ const useSettingsState = ({ settingsState, setSettingsState }: SettingsProps) =>
"onoff": "betterSEQTAPlus",
"shortcuts": "shortcuts",
"customshortcuts": "customshortcuts",
"transparencyEffects": "transparencyEffects"
}), []);
const storageChangeListener = (changes: chrome.storage.StorageChange) => {
+3 -3
View File
@@ -53,11 +53,11 @@ const Settings: React.FC = () => {
description: "Customise the sidebar layout.",
modifyElement: <button onClick={() => chrome.runtime.sendMessage({ type: 'currentTab', info: 'EditSidebar' })} className='px-4 py-1 text-[0.75rem] bg-blue-500 rounded-md'>Edit</button>
},
/* {
{
title: "Transparency Effects",
description: "Enables transparency effects on certain elements such as blur. (May impact battery life)",
modifyElement: <Switch state={settingsState.betterSEQTAPlus} onChange={(isOn: boolean) => switchChange('betterSEQTAPlus', isOn)} />
}, */
modifyElement: <Switch state={settingsState.transparencyEffects} onChange={(isOn: boolean) => switchChange('transparencyEffects', isOn)} />
},
{
title: "BetterSEQTA+",
description: "Enables BetterSEQTA+ features",
+2
View File
@@ -7,6 +7,7 @@ export interface SettingsState {
betterSEQTAPlus: boolean;
shortcuts: Shortcut[];
customshortcuts: CustomShortcut[];
transparencyEffects: boolean;
}
interface ToggleItem {
@@ -55,4 +56,5 @@ export interface MainConfig {
selectedColor: string;
shortcuts: Shortcut[];
subjectfilters: Record<string, any>;
transparencyEffects: boolean;
}