diff --git a/src/components/Elements/MainModal/Main.jsx b/src/components/Elements/MainModal/Main.jsx index fe1970a7..6ac536ed 100644 --- a/src/components/Elements/MainModal/Main.jsx +++ b/src/components/Elements/MainModal/Main.jsx @@ -58,7 +58,7 @@ const MainModalContent = ({ modalClose }) => { }; return ( -
+
{ [setSubTab, setSubSection], ); - return ( -
- {sections.map((section, index) => ( - - ))} -
- ); -}); - -const Content = memo(({ sections, currentTab }) => { const hideReminder = () => { localStorage.setItem('showReminder', false); document.querySelector('.reminder-info').style.display = 'none'; @@ -65,18 +49,39 @@ const Content = memo(({ sections, currentTab }) => { [], ); + return ( +
+ {sections.map((section, index) => ( + + ))} + {reminderInfo} +
+ ); +}); + +const Content = memo(({ sections, currentTab }) => { + const hideReminder = () => { + localStorage.setItem('showReminder', false); + document.querySelector('.reminder-info').style.display = 'none'; + }; + return ( <> {sections.map( ({ label, name, component: Component }) => variables.getMessage(label) === currentTab && (
- {reminderInfo}
), diff --git a/src/components/Elements/MainModal/scss/index.scss b/src/components/Elements/MainModal/scss/index.scss index 0aef15e0..bd4d5fce 100644 --- a/src/components/Elements/MainModal/scss/index.scss +++ b/src/components/Elements/MainModal/scss/index.scss @@ -206,13 +206,12 @@ h5 { flex-flow: row; justify-content: space-between; padding: 25px; - margin-top: 20px; transition: 0.5s; @include themed { background: t($modal-sidebar); border-radius: t($borderRadius); - box-shadow: 0 0 0 1px t($modal-sidebarActive); + //box-shadow: 0 0 0 1px t($modal-sidebarActive); &:hover { background: t($modal-sidebarActive); diff --git a/src/components/Form/Settings/Checkbox/Checkbox.jsx b/src/components/Form/Settings/Checkbox/Checkbox.jsx index e76dc25f..7a3375e4 100644 --- a/src/components/Form/Settings/Checkbox/Checkbox.jsx +++ b/src/components/Form/Settings/Checkbox/Checkbox.jsx @@ -1,7 +1,7 @@ import variables from 'config/variables'; import { useEffect, useState } from 'react'; import { Checkbox as CheckboxUI, Field, Label } from '@headlessui/react'; -import { MdCheckBox } from "react-icons/md"; +import { MdCheckBox } from 'react-icons/md'; import EventBus from 'utils/eventbus'; const Checkbox = (props) => { @@ -21,10 +21,7 @@ const Checkbox = (props) => { props.onChange(value); } - variables.stats.postEvent( - 'setting', - `${props.name} ${value ? 'enabled' : 'disabled'}`, - ); + variables.stats.postEvent('setting', `${props.name} ${value ? 'enabled' : 'disabled'}`); if (props.element) { if (!document.querySelector(props.element)) { @@ -42,13 +39,13 @@ const Checkbox = (props) => { checked={checked} onChange={handleChange} disabled={props.disabled || false} - className="border border-[#484848] bg-white/5 group size-4 rounded data-[checked]:bg-neutral-900 cursor-pointer grid place-content-center" + className="border border-[#484848] bg-white/5 group size-4 rounded-sm data-[checked]:bg-neutral-900 cursor-pointer grid place-content-center" > - + ); }; -export { Checkbox as default, Checkbox }; \ No newline at end of file +export { Checkbox as default, Checkbox }; diff --git a/src/components/Layout/Settings/Item/SettingsItem.jsx b/src/components/Layout/Settings/Item/SettingsItem.jsx index b469e35c..73fb5696 100644 --- a/src/components/Layout/Settings/Item/SettingsItem.jsx +++ b/src/components/Layout/Settings/Item/SettingsItem.jsx @@ -1,5 +1,5 @@ const Row = (props) => { - const classes = `${props.final ? 'border-b-0' : 'border-b border-gray-500'} ${props.inactive ? 'opacity-50 pointer-events-none transition duration-400 ease-in-out' : ''} flex items-center min-h-[100px] justify-between py-4 transition duration-400 ease-in-out`; + const classes = `${props.inactive ? 'opacity-50 pointer-events-none transition duration-400 ease-in-out' : ''} flex items-center min-h-[100px] justify-between py-4 transition duration-400 ease-in-out`; return
{props.children}
; }; diff --git a/src/components/Layout/Settings/PreferencesWrapper/PreferencesWrapper.jsx b/src/components/Layout/Settings/PreferencesWrapper/PreferencesWrapper.jsx index e28e13e5..bb0deb3d 100644 --- a/src/components/Layout/Settings/PreferencesWrapper/PreferencesWrapper.jsx +++ b/src/components/Layout/Settings/PreferencesWrapper/PreferencesWrapper.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { Row, Content, Action } from 'components/Layout/Settings/Item'; import variables from 'config/variables'; import Slider from '../../../Form/Settings/Slider/Slider'; @@ -7,23 +7,33 @@ import values from 'utils/data/slider_values.json'; import EventBus from 'utils/eventbus'; const PreferencesWrapper = ({ children, ...props }) => { - const [shown, setShown] = useState( - localStorage.getItem(props.setting) === 'true' || props.default || false, - ); - console.log(props.default); - - EventBus.on('toggle', (setting) => { - if (setting === props.setting) { - setShown(!shown); + const [shown, setShown] = useState(() => { + if (!props.setting) { + return true; } + return localStorage.getItem(props.setting) === 'true' || props.default || false; }); + useEffect(() => { + const handleToggle = (setting) => { + if (setting === props.setting) { + setShown((prevShown) => !prevShown); + } + }; + + EventBus.on('toggle', handleToggle); + + return () => { + EventBus.off('toggle', handleToggle); + }; + }, [props.setting]); + return (
{props.zoomSetting && ( diff --git a/src/features/greeting/options/GreetingOptions.jsx b/src/features/greeting/options/GreetingOptions.jsx index a4933ef8..3d4dd181 100644 --- a/src/features/greeting/options/GreetingOptions.jsx +++ b/src/features/greeting/options/GreetingOptions.jsx @@ -23,12 +23,12 @@ import { MdEventNote, MdAdd, MdCancel, MdRefresh } from 'react-icons/md'; const GreetingOptions = () => { const { subSection } = useTab(); const [customEvents, setCustomEvents] = useState( - JSON.parse(localStorage.getItem('customEvents')) || defaultEvents + JSON.parse(localStorage.getItem('customEvents')) || defaultEvents, ); const [events, setEvents] = useState(false); const [birthday, setBirthday] = useState( - new Date(localStorage.getItem('birthday')) || defaults.birthday + new Date(localStorage.getItem('birthday')) || defaults.birthday, ); const [enableBirthday, setEnableBirthday] = useState( @@ -133,9 +133,7 @@ const GreetingOptions = () => { { return ( <> - {header} - {subSection === "events" ? ( + {/*{header}*/} + {subSection === 'events' ? ( <> { {CustomEventsSection()} ) : ( - - + <> + + +
{ onClick={() => setEvents(true)} icon={} /> - + )} ); diff --git a/src/features/misc/sections/Changelog.jsx b/src/features/misc/sections/Changelog.jsx index f89e511a..a04d35a9 100644 --- a/src/features/misc/sections/Changelog.jsx +++ b/src/features/misc/sections/Changelog.jsx @@ -49,7 +49,7 @@ function Changelog() { setTitle(changelog.name); setContent(changelog.body); setDate(new Date(changelog.published_at).toLocaleDateString()); - } + }; useEffect(() => { if (navigator.onLine === false || offlineMode) { @@ -77,9 +77,7 @@ function Changelog() { <>

{variables.getMessage('marketplace:offline.title')}

-

- {variables.getMessage('marketplace:offline.description')} -

+

{variables.getMessage('marketplace:offline.description')}

, ); } @@ -106,14 +104,15 @@ function Changelog() { } return ( -
-
- {title} - Released on {date} +
+
+

{title}

+

Published on {date}

- - {content} - + {content}
); } diff --git a/src/features/navbar/options/AppsOptions.jsx b/src/features/navbar/options/AppsOptions.jsx index 67814a0f..f5b1352e 100644 --- a/src/features/navbar/options/AppsOptions.jsx +++ b/src/features/navbar/options/AppsOptions.jsx @@ -110,9 +110,7 @@ function AppsOptions({ appsEnabled }) {