import Switch from '../components/Switch'; import Slider from '../components/Slider'; import PickerSwatch from '../components/PickerSwatch'; import { SettingsList } from '../types/SettingsProps'; import { useSettingsContext } from '../SettingsContext'; import browser from 'webextension-polyfill' const Settings: React.FC = () => { const { settingsState, setSettingsState } = useSettingsContext(); const switchChange = (key: string, isOn: boolean) => { setSettingsState({ ...settingsState, [key]: isOn, }); }; const sliderChange = (key: string, value: number) => { setSettingsState({ ...settingsState, [key]: value, }); }; const settings: SettingsList[] = [ { title: "Transparency Effects", description: "Enables transparency effects on certain elements such as blur. (May impact battery life)", modifyElement: switchChange('transparencyEffects', isOn)} /> }, { title: "Animated Background", description: "Adds an animated background to BetterSEQTA. (May impact battery life)", modifyElement: switchChange('animatedBackground', isOn)} /> }, { title: "Animated Background Speed", description: "Controls the speed of the animated background.", modifyElement: sliderChange('animatedBackgroundSpeed', value)} /> }, { title: "Custom Theme Colour", description: "Customise the overall theme colour of SEQTA Learn.", modifyElement: }, { title: "Telemetry", description: "Enables/disables error collecting.", modifyElement: switchChange('telemetry', isOn)} /> }, { title: "Edit Sidebar Layout", description: "Customise the sidebar layout.", modifyElement: }, { title: "Notification Collector", description: "Uncaps the 9+ limit for notifications, showing the real number.", modifyElement: switchChange('notificationCollector', isOn)} /> }, { title: "Lesson Alerts", description: "Sends a native browser notification ~5 minutes prior to lessons.", modifyElement: switchChange('lessonAlerts', isOn)} /> }, { title: "BetterSEQTA+", description: "Enables BetterSEQTA+ features", modifyElement: switchChange('betterSEQTAPlus', isOn)} /> } ]; return (
{settings.map((setting, index) => (

{setting.title}

{setting.description}

{setting.modifyElement}
))}
); }; export default Settings;