diff --git a/.env b/.env
index 83c60e7c..bfd410d0 100644
--- a/.env
+++ b/.env
@@ -1,11 +1,11 @@
-// API URLs
+# API URLs
API_URL=https://api.muetab.com/v2
SPONSORS_URL=https://sponsors.muetab.com
GITHUB_URL=https://api.github.com
DDG_IMAGE_PROXY=https://external-content.duckduckgo.com/iu/?u=
OPENSTREETMAP_URL=https://www.openstreetmap.org
-// Mue URLs
+# Mue URLs
WEBSITE_URL=https://muetab.com
PRIVACY_URL=https://muetab.com/privacy
BLOG_POST=https://blog.muetab.com/posts/version-7-0
@@ -17,7 +17,7 @@ DONATE_LINK=https://muetab.com/donate
SENTRY_DSN =https://430352fd4b174d688ebd82fc85c22c58@o1217438.ingest.sentry.io/6359480
KNOWLEDGEBASE=https://support.muetab.com
-// Mue Info
+# Mue Info
ORG_NAME=mue
REPO_NAME=mue
EMAIL=hello@muetab.com
diff --git a/index.html b/index.html
index 8b63da51..a55b8434 100644
--- a/index.html
+++ b/index.html
@@ -11,28 +11,103 @@
diff --git a/src/components/modals/main/marketplace/sections/Added.jsx b/src/features/modals/main/marketplace/sections/Added.jsx
similarity index 96%
rename from src/components/modals/main/marketplace/sections/Added.jsx
rename to src/features/modals/main/marketplace/sections/Added.jsx
index 8f08d199..fa7c9acd 100644
--- a/src/components/modals/main/marketplace/sections/Added.jsx
+++ b/src/features/modals/main/marketplace/sections/Added.jsx
@@ -1,16 +1,16 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdUpdate, MdOutlineExtensionOff, MdSendTimeExtension } from 'react-icons/md';
import { toast } from 'react-toastify';
import Modal from 'react-modal';
import SideloadFailedModal from '../SideloadFailedModal';
-import FileUpload from '../../settings/FileUpload';
+import FileUpload from '../../../../../components/Form/Settings/FileUpload/FileUpload';
import Item from '../Item';
import Items from '../Items';
-import Dropdown from '../../settings/Dropdown';
-import Header, { CustomActions } from '../../settings/Header';
-import Button from '../../settings/Button';
+import Dropdown from '../../../../../components/Form/Settings/Dropdown/Dropdown';
+import { Header, CustomActions } from 'components/Layout/Settings';
+import { Button } from 'components/Elements';
import { install, uninstall, urlParser } from 'modules/helpers/marketplace';
diff --git a/src/components/modals/main/marketplace/sections/Create.jsx b/src/features/modals/main/marketplace/sections/Create.jsx
similarity index 95%
rename from src/components/modals/main/marketplace/sections/Create.jsx
rename to src/features/modals/main/marketplace/sections/Create.jsx
index cac66197..c0560f37 100644
--- a/src/components/modals/main/marketplace/sections/Create.jsx
+++ b/src/features/modals/main/marketplace/sections/Create.jsx
@@ -1,5 +1,5 @@
/* eslint-disable no-unused-vars */
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdOutlineExtensionOff } from 'react-icons/md';
diff --git a/src/components/modals/main/marketplace/sections/Marketplace.jsx b/src/features/modals/main/marketplace/sections/Marketplace.jsx
similarity index 98%
rename from src/components/modals/main/marketplace/sections/Marketplace.jsx
rename to src/features/modals/main/marketplace/sections/Marketplace.jsx
index e7b7af76..55e22162 100644
--- a/src/components/modals/main/marketplace/sections/Marketplace.jsx
+++ b/src/features/modals/main/marketplace/sections/Marketplace.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { toast } from 'react-toastify';
import {
@@ -12,9 +12,9 @@ import {
import Item from '../Item';
import Items from '../Items';
-import Dropdown from '../../settings/Dropdown';
-import Header from '../../settings/Header';
-import Button from '../../settings/Button';
+import Dropdown from '../../../../../components/Form/Settings/Dropdown/Dropdown';
+import { Header } from 'components/Layout/Settings';
+import { Button } from 'components/Elements';
import { install, urlParser, uninstall } from 'modules/helpers/marketplace';
diff --git a/src/components/modals/main/scss/index.scss b/src/features/modals/main/scss/index.scss
similarity index 100%
rename from src/components/modals/main/scss/index.scss
rename to src/features/modals/main/scss/index.scss
diff --git a/src/components/modals/main/scss/marketplace/_main.scss b/src/features/modals/main/scss/marketplace/_main.scss
similarity index 100%
rename from src/components/modals/main/scss/marketplace/_main.scss
rename to src/features/modals/main/scss/marketplace/_main.scss
diff --git a/src/components/modals/main/scss/marketplace/modules/_buttons.scss b/src/features/modals/main/scss/marketplace/modules/_buttons.scss
similarity index 100%
rename from src/components/modals/main/scss/marketplace/modules/_buttons.scss
rename to src/features/modals/main/scss/marketplace/modules/_buttons.scss
diff --git a/src/components/modals/main/scss/marketplace/modules/_item.scss b/src/features/modals/main/scss/marketplace/modules/_item.scss
similarity index 100%
rename from src/components/modals/main/scss/marketplace/modules/_item.scss
rename to src/features/modals/main/scss/marketplace/modules/_item.scss
diff --git a/src/components/modals/main/scss/marketplace/modules/_lightbox.scss b/src/features/modals/main/scss/marketplace/modules/_lightbox.scss
similarity index 100%
rename from src/components/modals/main/scss/marketplace/modules/_lightbox.scss
rename to src/features/modals/main/scss/marketplace/modules/_lightbox.scss
diff --git a/src/components/modals/main/scss/modules/_links.scss b/src/features/modals/main/scss/modules/_links.scss
similarity index 100%
rename from src/components/modals/main/scss/modules/_links.scss
rename to src/features/modals/main/scss/modules/_links.scss
diff --git a/src/components/modals/main/scss/modules/_navbar.scss b/src/features/modals/main/scss/modules/_navbar.scss
similarity index 100%
rename from src/components/modals/main/scss/modules/_navbar.scss
rename to src/features/modals/main/scss/modules/_navbar.scss
diff --git a/src/components/modals/main/scss/modules/_scrollbars.scss b/src/features/modals/main/scss/modules/_scrollbars.scss
similarity index 100%
rename from src/components/modals/main/scss/modules/_scrollbars.scss
rename to src/features/modals/main/scss/modules/_scrollbars.scss
diff --git a/src/components/modals/main/scss/modules/_sidebar.scss b/src/features/modals/main/scss/modules/_sidebar.scss
similarity index 100%
rename from src/components/modals/main/scss/modules/_sidebar.scss
rename to src/features/modals/main/scss/modules/_sidebar.scss
diff --git a/src/components/modals/main/scss/modules/_tab-content.scss b/src/features/modals/main/scss/modules/_tab-content.scss
similarity index 100%
rename from src/components/modals/main/scss/modules/_tab-content.scss
rename to src/features/modals/main/scss/modules/_tab-content.scss
diff --git a/src/components/modals/main/scss/settings/_main.scss b/src/features/modals/main/scss/settings/_main.scss
similarity index 100%
rename from src/components/modals/main/scss/settings/_main.scss
rename to src/features/modals/main/scss/settings/_main.scss
diff --git a/src/components/modals/main/scss/settings/modules/_material-ui.scss b/src/features/modals/main/scss/settings/modules/_material-ui.scss
similarity index 100%
rename from src/components/modals/main/scss/settings/modules/_material-ui.scss
rename to src/features/modals/main/scss/settings/modules/_material-ui.scss
diff --git a/src/components/modals/main/scss/settings/modules/tabs/_about.scss b/src/features/modals/main/scss/settings/modules/tabs/_about.scss
similarity index 100%
rename from src/components/modals/main/scss/settings/modules/tabs/_about.scss
rename to src/features/modals/main/scss/settings/modules/tabs/_about.scss
diff --git a/src/components/modals/main/scss/settings/modules/tabs/_changelog.scss b/src/features/modals/main/scss/settings/modules/tabs/_changelog.scss
similarity index 100%
rename from src/components/modals/main/scss/settings/modules/tabs/_changelog.scss
rename to src/features/modals/main/scss/settings/modules/tabs/_changelog.scss
diff --git a/src/components/modals/main/scss/settings/modules/tabs/_order.scss b/src/features/modals/main/scss/settings/modules/tabs/_order.scss
similarity index 100%
rename from src/components/modals/main/scss/settings/modules/tabs/_order.scss
rename to src/features/modals/main/scss/settings/modules/tabs/_order.scss
diff --git a/src/components/modals/main/scss/settings/modules/tabs/_stats.scss b/src/features/modals/main/scss/settings/modules/tabs/_stats.scss
similarity index 100%
rename from src/components/modals/main/scss/settings/modules/tabs/_stats.scss
rename to src/features/modals/main/scss/settings/modules/tabs/_stats.scss
diff --git a/src/components/modals/main/scss/settings/react-color-picker-gradient-picker-custom-styles.scss b/src/features/modals/main/scss/settings/react-color-picker-gradient-picker-custom-styles.scss
similarity index 100%
rename from src/components/modals/main/scss/settings/react-color-picker-gradient-picker-custom-styles.scss
rename to src/features/modals/main/scss/settings/react-color-picker-gradient-picker-custom-styles.scss
diff --git a/src/components/modals/main/settings/ResetModal.jsx b/src/features/modals/main/settings/ResetModal.jsx
similarity index 93%
rename from src/components/modals/main/settings/ResetModal.jsx
rename to src/features/modals/main/settings/ResetModal.jsx
index bc88c0da..97b18029 100644
--- a/src/components/modals/main/settings/ResetModal.jsx
+++ b/src/features/modals/main/settings/ResetModal.jsx
@@ -1,9 +1,8 @@
import { memo } from 'react';
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { MdClose, MdRestartAlt } from 'react-icons/md';
import { setDefaultSettings } from 'modules/helpers/settings';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
+import { Tooltip } from 'components/Elements';
function ResetModal({ modalClose }) {
const reset = () => {
variables.stats.postEvent('setting', 'Reset');
diff --git a/src/components/modals/main/settings/sections/About.jsx b/src/features/modals/main/settings/sections/About.jsx
similarity index 98%
rename from src/components/modals/main/settings/sections/About.jsx
rename to src/features/modals/main/settings/sections/About.jsx
index ab6d8b67..0c849d3a 100644
--- a/src/components/modals/main/settings/sections/About.jsx
+++ b/src/features/modals/main/settings/sections/About.jsx
@@ -1,12 +1,11 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdEmail, MdContactPage } from 'react-icons/md';
import { FaDiscord, FaTwitter } from 'react-icons/fa';
import { SiGithubsponsors, SiOpencollective } from 'react-icons/si';
import { BiDonateHeart } from 'react-icons/bi';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
+import { Tooltip } from 'components/Elements';
import other_contributors from 'modules/other_contributors.json';
export default class About extends PureComponent {
@@ -20,8 +19,8 @@ export default class About extends PureComponent {
update: variables.getMessage('modals.main.settings.sections.about.version.checking_update'),
loading: variables.getMessage('modals.main.loading'),
image: document.body.classList.contains('dark')
- ? 'icons/mue_about.png'
- : 'icons/mue_about.png',
+ ? 'src/assets/icons/mue_about.png'
+ : 'src/assets/icons/mue_about.png',
};
this.controller = new AbortController();
}
diff --git a/src/components/modals/main/settings/sections/Advanced.jsx b/src/features/modals/main/settings/sections/Advanced.jsx
similarity index 94%
rename from src/components/modals/main/settings/sections/Advanced.jsx
rename to src/features/modals/main/settings/sections/Advanced.jsx
index 21f82be7..047fa967 100644
--- a/src/components/modals/main/settings/sections/Advanced.jsx
+++ b/src/features/modals/main/settings/sections/Advanced.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { useState } from 'react';
import Modal from 'react-modal';
import {
@@ -10,17 +10,12 @@ import {
import { exportSettings, importSettings } from 'modules/helpers/settings/modals';
-import FileUpload from '../FileUpload';
-import Text from '../Text';
-import Switch from '../Switch';
+import { FileUpload, Text, Switch, Dropdown } from 'components/Form/Settings';
import ResetModal from '../ResetModal';
-import Dropdown from '../Dropdown';
-import Header from '../Header';
-import { Row, Content, Action } from '../SettingsItem';
-import Section from '../Section';
+import { Header, Section, Row, Content, Action } from 'components/Layout/Settings';
-import time_zones from 'components/widgets/time/timezones.json';
+import time_zones from 'features/widgets/time/timezones.json';
export default function AdvancedSettings() {
const [resetModal, setResetModal] = useState(false);
diff --git a/src/components/modals/main/settings/sections/Appearance.jsx b/src/features/modals/main/settings/sections/Appearance.jsx
similarity index 96%
rename from src/components/modals/main/settings/sections/Appearance.jsx
rename to src/features/modals/main/settings/sections/Appearance.jsx
index 2ec167a4..e147d724 100644
--- a/src/components/modals/main/settings/sections/Appearance.jsx
+++ b/src/features/modals/main/settings/sections/Appearance.jsx
@@ -1,17 +1,9 @@
import { memo, useState } from 'react';
-import variables from 'modules/variables';
+import variables from 'config/variables';
-import Checkbox from '../Checkbox';
-import Dropdown from '../Dropdown';
-import Radio from '../Radio';
-import Slider from '../Slider';
-import Text from '../Text';
-import Header from '../Header';
-
-import { Row, Content, Action } from '../SettingsItem';
-
-import Section from '../Section';
+import { Checkbox, Dropdown, Radio, Slider, Text } from 'components/Form/Settings';
+import { Header, Section, Row, Content, Action } from 'components/Layout/Settings';
import { MdAccessibility } from 'react-icons/md';
diff --git a/src/components/modals/main/settings/sections/Changelog.jsx b/src/features/modals/main/settings/sections/Changelog.jsx
similarity index 98%
rename from src/components/modals/main/settings/sections/Changelog.jsx
rename to src/features/modals/main/settings/sections/Changelog.jsx
index 8e5d75a3..658bde63 100644
--- a/src/components/modals/main/settings/sections/Changelog.jsx
+++ b/src/features/modals/main/settings/sections/Changelog.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import { MdOutlineWifiOff } from 'react-icons/md';
import Modal from 'react-modal';
diff --git a/src/components/modals/main/settings/sections/Date.jsx b/src/features/modals/main/settings/sections/Date.jsx
similarity index 94%
rename from src/components/modals/main/settings/sections/Date.jsx
rename to src/features/modals/main/settings/sections/Date.jsx
index 3b132dec..2e9b6049 100644
--- a/src/components/modals/main/settings/sections/Date.jsx
+++ b/src/features/modals/main/settings/sections/Date.jsx
@@ -1,12 +1,10 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { useState } from 'react';
-import Header from '../Header';
-import Checkbox from '../Checkbox';
-import Dropdown from '../Dropdown';
+import { Header } from 'components/Layout/Settings';
+import { Checkbox, Dropdown } from 'components/Form/Settings';
-import { Row, Content, Action } from '../SettingsItem';
-import PreferencesWrapper from '../PreferencesWrapper';
+import { Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
export default function Date() {
const [dateType, setDateType] = useState(localStorage.getItem('dateType') || 'long');
diff --git a/src/components/modals/main/settings/sections/Experimental.jsx b/src/features/modals/main/settings/sections/Experimental.jsx
similarity index 88%
rename from src/components/modals/main/settings/sections/Experimental.jsx
rename to src/features/modals/main/settings/sections/Experimental.jsx
index 33ee130b..835a5d83 100644
--- a/src/components/modals/main/settings/sections/Experimental.jsx
+++ b/src/features/modals/main/settings/sections/Experimental.jsx
@@ -1,13 +1,13 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { useState, memo } from 'react';
-import Checkbox from '../Checkbox';
-import Slider from '../Slider';
+import Checkbox from '../../../../../components/Form/Settings/Checkbox/Checkbox';
+import Slider from '../../../../../components/Form/Settings/Slider/Slider';
import { TextField } from '@mui/material';
import EventBus from 'modules/helpers/eventbus';
import { values } from 'modules/helpers/settings/modals';
-import { Row, Content, Action } from '../SettingsItem';
+import { Row, Content, Action } from '../../../../../components/Layout/Settings/Item/SettingsItem';
function ExperimentalSettings() {
const [eventType, setEventType] = useState();
diff --git a/src/components/modals/main/settings/sections/Greeting.jsx b/src/features/modals/main/settings/sections/Greeting.jsx
similarity index 90%
rename from src/components/modals/main/settings/sections/Greeting.jsx
rename to src/features/modals/main/settings/sections/Greeting.jsx
index a1968f16..e4489309 100644
--- a/src/components/modals/main/settings/sections/Greeting.jsx
+++ b/src/features/modals/main/settings/sections/Greeting.jsx
@@ -1,13 +1,8 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { useState } from 'react';
-import Header from '../Header';
-import Checkbox from '../Checkbox';
-import Switch from '../Switch';
-import Text from '../Text';
-
-import { Row, Content, Action } from '../SettingsItem';
-import PreferencesWrapper from '../PreferencesWrapper';
+import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
+import { Checkbox, Switch, Text } from 'components/Form/Settings';
const GreetingSettings = () => {
const [birthday, setBirthday] = useState(
diff --git a/src/components/modals/main/settings/sections/Language.jsx b/src/features/modals/main/settings/sections/Language.jsx
similarity index 95%
rename from src/components/modals/main/settings/sections/Language.jsx
rename to src/features/modals/main/settings/sections/Language.jsx
index 4de0b07c..43ca854c 100644
--- a/src/components/modals/main/settings/sections/Language.jsx
+++ b/src/features/modals/main/settings/sections/Language.jsx
@@ -1,11 +1,11 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdOutlineOpenInNew } from 'react-icons/md';
-import Radio from '../Radio';
+import { Radio } from 'components/Form/Settings';
-import languages from 'modules/languages.json';
+import languages from '@/i18n/languages.json';
export default class LanguageSettings extends PureComponent {
constructor() {
diff --git a/src/components/modals/main/settings/sections/Message.jsx b/src/features/modals/main/settings/sections/Message.jsx
similarity index 95%
rename from src/components/modals/main/settings/sections/Message.jsx
rename to src/features/modals/main/settings/sections/Message.jsx
index 2a06a23d..a1cdbdf3 100644
--- a/src/components/modals/main/settings/sections/Message.jsx
+++ b/src/features/modals/main/settings/sections/Message.jsx
@@ -1,14 +1,11 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdCancel, MdAdd, MdOutlineTextsms } from 'react-icons/md';
import { toast } from 'react-toastify';
import { TextareaAutosize } from '@mui/material';
-import { Row, Content, Action } from '../SettingsItem';
-import Header from '../Header';
-
+import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
import EventBus from 'modules/helpers/eventbus';
-import PreferencesWrapper from '../PreferencesWrapper';
export default class Message extends PureComponent {
constructor() {
diff --git a/src/components/modals/main/settings/sections/Navbar.jsx b/src/features/modals/main/settings/sections/Navbar.jsx
similarity index 95%
rename from src/components/modals/main/settings/sections/Navbar.jsx
rename to src/features/modals/main/settings/sections/Navbar.jsx
index 75b3390e..941c10c4 100644
--- a/src/components/modals/main/settings/sections/Navbar.jsx
+++ b/src/features/modals/main/settings/sections/Navbar.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { useState, memo } from 'react';
@@ -7,12 +7,12 @@ import { MdAddLink } from 'react-icons/md';
import AddModal from './quicklinks/AddModal';
-import Checkbox from '../Checkbox';
-import Dropdown from '../Dropdown';
-import Button from '../Button';
+import Checkbox from '../../../../../components/Form/Settings/Checkbox/Checkbox';
+import Dropdown from '../../../../../components/Form/Settings/Dropdown/Dropdown';
+import { Button } from 'components/Elements';
-import { Row, Content, Action } from '../SettingsItem';
-import Header from '../Header';
+import { Row, Content, Action } from '../../../../../components/Layout/Settings/Item/SettingsItem';
+import { Header } from 'components/Layout/Settings';
import { getTitleFromUrl, isValidUrl } from 'modules/helpers/settings/modals';
import QuickLink from './quicklinks/QuickLink';
diff --git a/src/components/modals/main/settings/sections/Overview.jsx b/src/features/modals/main/settings/sections/Overview.jsx
similarity index 99%
rename from src/components/modals/main/settings/sections/Overview.jsx
rename to src/features/modals/main/settings/sections/Overview.jsx
index 00582b86..ef1b1460 100644
--- a/src/components/modals/main/settings/sections/Overview.jsx
+++ b/src/features/modals/main/settings/sections/Overview.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdOutlineDragIndicator } from 'react-icons/md';
import { sortableContainer, sortableElement } from '@muetab/react-sortable-hoc';
diff --git a/src/components/modals/main/settings/sections/QuickLinks.jsx b/src/features/modals/main/settings/sections/QuickLinks.jsx
similarity index 96%
rename from src/components/modals/main/settings/sections/QuickLinks.jsx
rename to src/features/modals/main/settings/sections/QuickLinks.jsx
index 156f500a..8c3d93b3 100644
--- a/src/components/modals/main/settings/sections/QuickLinks.jsx
+++ b/src/features/modals/main/settings/sections/QuickLinks.jsx
@@ -1,19 +1,16 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import { MdAddLink, MdLinkOff } from 'react-icons/md';
-import Header from '../Header';
-import Checkbox from '../Checkbox';
-import Dropdown from '../Dropdown';
-import Button from '../Button';
+import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
+import { Checkbox, Dropdown } from 'components/Form/Settings';
+import { Button } from 'components/Elements';
import Modal from 'react-modal';
-import { Row, Content, Action } from '../SettingsItem';
import AddModal from './quicklinks/AddModal';
import EventBus from 'modules/helpers/eventbus';
import QuickLink from './quicklinks/QuickLink';
import { getTitleFromUrl, isValidUrl } from 'modules/helpers/settings/modals';
-import PreferencesWrapper from '../PreferencesWrapper';
export default class QuickLinks extends PureComponent {
constructor() {
diff --git a/src/components/modals/main/settings/sections/Quote.jsx b/src/features/modals/main/settings/sections/Quote.jsx
similarity index 96%
rename from src/components/modals/main/settings/sections/Quote.jsx
rename to src/features/modals/main/settings/sections/Quote.jsx
index 02e42ffa..5da3afa2 100644
--- a/src/components/modals/main/settings/sections/Quote.jsx
+++ b/src/features/modals/main/settings/sections/Quote.jsx
@@ -1,15 +1,17 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import React, { PureComponent } from 'react';
import { MdCancel, MdAdd, MdSource, MdOutlineFormatQuote } from 'react-icons/md';
import TextareaAutosize from '@mui/material/TextareaAutosize';
-import Header from '../Header';
-import Checkbox from '../Checkbox';
-import Dropdown from '../Dropdown';
-
-import { Row, Content, Action } from '../SettingsItem';
-import Section from '../Section';
-import PreferencesWrapper from '../PreferencesWrapper';
+import {
+ Header,
+ Row,
+ Content,
+ Action,
+ Section,
+ PreferencesWrapper,
+} from 'components/Layout/Settings';
+import { Checkbox, Dropdown } from 'components/Form/Settings';
import { toast } from 'react-toastify';
import EventBus from 'modules/helpers/eventbus';
diff --git a/src/components/modals/main/settings/sections/Search.jsx b/src/features/modals/main/settings/sections/Search.jsx
similarity index 93%
rename from src/components/modals/main/settings/sections/Search.jsx
rename to src/features/modals/main/settings/sections/Search.jsx
index 65701ca6..4d146e0b 100644
--- a/src/components/modals/main/settings/sections/Search.jsx
+++ b/src/features/modals/main/settings/sections/Search.jsx
@@ -1,18 +1,14 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { toast } from 'react-toastify';
import { MenuItem, TextField } from '@mui/material';
-import Header from '../Header';
-import Dropdown from '../Dropdown';
-import Checkbox from '../Checkbox';
-
-import { Row, Content, Action } from '../SettingsItem';
+import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
+import { Dropdown, Checkbox } from 'components/Form/Settings';
import EventBus from 'modules/helpers/eventbus';
-import searchEngines from 'components/widgets/search/search_engines.json';
-import PreferencesWrapper from '../PreferencesWrapper';
+import searchEngines from 'features/widgets/search/search_engines.json';
export default class SearchSettings extends PureComponent {
constructor() {
diff --git a/src/components/modals/main/settings/sections/Stats.jsx b/src/features/modals/main/settings/sections/Stats.jsx
similarity index 97%
rename from src/components/modals/main/settings/sections/Stats.jsx
rename to src/features/modals/main/settings/sections/Stats.jsx
index d6303344..2baf932c 100644
--- a/src/components/modals/main/settings/sections/Stats.jsx
+++ b/src/features/modals/main/settings/sections/Stats.jsx
@@ -1,12 +1,12 @@
/* eslint-disable array-callback-return */
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdShowChart, MdRestartAlt, MdDownload } from 'react-icons/md';
import { FaTrophy } from 'react-icons/fa';
import { toast } from 'react-toastify';
-import Button from '../../settings/Button';
-import Header, { CustomActions } from '../../settings/Header';
+import { Button } from 'components/Elements';
+import { Header, CustomActions } from 'components/Layout/Settings';
import { saveFile } from 'modules/helpers/settings/modals';
diff --git a/src/components/modals/main/settings/sections/Time.jsx b/src/features/modals/main/settings/sections/Time.jsx
similarity index 95%
rename from src/components/modals/main/settings/sections/Time.jsx
rename to src/features/modals/main/settings/sections/Time.jsx
index 656ece02..8d4f9f11 100644
--- a/src/components/modals/main/settings/sections/Time.jsx
+++ b/src/features/modals/main/settings/sections/Time.jsx
@@ -1,13 +1,8 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import React, { useState } from 'react';
-import Header from '../Header';
-import Checkbox from '../Checkbox';
-import Dropdown from '../Dropdown';
-import Radio from '../Radio';
-
-import PreferencesWrapper from '../PreferencesWrapper';
-import { Row, Content, Action } from '../SettingsItem';
+import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
+import { Checkbox, Dropdown, Radio } from 'components/Form/Settings';
import { MdRefresh } from 'react-icons/md';
diff --git a/src/components/modals/main/settings/sections/Weather.jsx b/src/features/modals/main/settings/sections/Weather.jsx
similarity index 95%
rename from src/components/modals/main/settings/sections/Weather.jsx
rename to src/features/modals/main/settings/sections/Weather.jsx
index 36b89f1c..951b9bd8 100644
--- a/src/components/modals/main/settings/sections/Weather.jsx
+++ b/src/features/modals/main/settings/sections/Weather.jsx
@@ -1,18 +1,12 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdAutoAwesome } from 'react-icons/md';
-import Header from '../Header';
-import Radio from '../Radio';
-import Dropdown from '../Dropdown';
-import Checkbox from '../Checkbox';
+import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
+import { Radio, Dropdown, Checkbox } from 'components/Form/Settings';
import { TextField } from '@mui/material';
-import PreferencesWrapper from '../PreferencesWrapper';
-
-import { Row, Content, Action } from '../SettingsItem';
-
export default class WeatherSettings extends PureComponent {
constructor() {
super();
diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/features/modals/main/settings/sections/background/Background.jsx
similarity index 96%
rename from src/components/modals/main/settings/sections/background/Background.jsx
rename to src/features/modals/main/settings/sections/background/Background.jsx
index f3cd4345..2c866b0a 100644
--- a/src/components/modals/main/settings/sections/background/Background.jsx
+++ b/src/features/modals/main/settings/sections/background/Background.jsx
@@ -1,16 +1,20 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MenuItem } from '@mui/material';
import { MdSource, MdOutlineKeyboardArrowRight, MdOutlineAutoAwesome } from 'react-icons/md';
-import Header from '../../Header';
-import Checkbox from '../../Checkbox';
-import ChipSelect from '../../ChipSelect';
-import Dropdown from '../../Dropdown';
-import Slider from '../../Slider';
-import Radio from '../../Radio';
-import { Row, Content, Action } from '../../SettingsItem';
-import Text from '../../Text';
+import { Header } from 'components/Layout/Settings';
+import Checkbox from '../../../../../../components/Form/Settings/Checkbox/Checkbox';
+import ChipSelect from '../../../../../../components/Form/Settings/ChipSelect/ChipSelect';
+import Dropdown from '../../../../../../components/Form/Settings/Dropdown/Dropdown';
+import Slider from '../../../../../../components/Form/Settings/Slider/Slider';
+import Radio from '../../../../../../components/Form/Settings/Radio/Radio';
+import {
+ Row,
+ Content,
+ Action,
+} from '../../../../../../components/Layout/Settings/Item/SettingsItem';
+import Text from '../../../../../../components/Form/Settings/Text/Text';
import ColourSettings from './Colour';
import CustomSettings from './Custom';
diff --git a/src/components/modals/main/settings/sections/background/Colour.jsx b/src/features/modals/main/settings/sections/background/Colour.jsx
similarity index 97%
rename from src/components/modals/main/settings/sections/background/Colour.jsx
rename to src/features/modals/main/settings/sections/background/Colour.jsx
index 31fe9a12..bac05a8e 100644
--- a/src/components/modals/main/settings/sections/background/Colour.jsx
+++ b/src/features/modals/main/settings/sections/background/Colour.jsx
@@ -1,8 +1,12 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, Fragment } from 'react';
import { ColorPicker } from '@muetab/react-color-gradient-picker';
import { toast } from 'react-toastify';
-import { Row, Content, Action } from '../../SettingsItem';
+import {
+ Row,
+ Content,
+ Action,
+} from '../../../../../../components/Layout/Settings/Item/SettingsItem';
import hexToRgb from 'modules/helpers/background/hexToRgb';
import rgbToHex from 'modules/helpers/background/rgbToHex';
diff --git a/src/components/modals/main/settings/sections/background/Custom.jsx b/src/features/modals/main/settings/sections/background/Custom.jsx
similarity index 97%
rename from src/components/modals/main/settings/sections/background/Custom.jsx
rename to src/features/modals/main/settings/sections/background/Custom.jsx
index 69aa6ef4..5b8af1aa 100644
--- a/src/components/modals/main/settings/sections/background/Custom.jsx
+++ b/src/features/modals/main/settings/sections/background/Custom.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import { toast } from 'react-toastify';
import {
@@ -13,10 +13,9 @@ import EventBus from 'modules/helpers/eventbus';
import { compressAccurately, filetoDataURL } from 'image-conversion';
import { videoCheck } from 'modules/helpers/background/widget';
-import Checkbox from '../../Checkbox';
-import FileUpload from '../../FileUpload';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
+import Checkbox from '../../../../../../components/Form/Settings/Checkbox/Checkbox';
+import FileUpload from '../../../../../../components/Form/Settings/FileUpload/FileUpload';
+import { Tooltip } from 'components/Elements';
import Modal from 'react-modal';
import CustomURLModal from './CustomURLModal';
diff --git a/src/components/modals/main/settings/sections/background/CustomURLModal.jsx b/src/features/modals/main/settings/sections/background/CustomURLModal.jsx
similarity index 93%
rename from src/components/modals/main/settings/sections/background/CustomURLModal.jsx
rename to src/features/modals/main/settings/sections/background/CustomURLModal.jsx
index f779e7ca..c903c30e 100644
--- a/src/components/modals/main/settings/sections/background/CustomURLModal.jsx
+++ b/src/features/modals/main/settings/sections/background/CustomURLModal.jsx
@@ -1,8 +1,7 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { useState, memo } from 'react';
import { MdClose, MdOutlineAddLink } from 'react-icons/md';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
+import { Tooltip } from 'components/Elements';
function CustomURLModal({ modalClose, urlError, modalCloseOnly }) {
const [url, setURL] = useState();
diff --git a/src/components/modals/main/settings/sections/overview_skeletons/Clock.jsx b/src/features/modals/main/settings/sections/overview_skeletons/Clock.jsx
similarity index 100%
rename from src/components/modals/main/settings/sections/overview_skeletons/Clock.jsx
rename to src/features/modals/main/settings/sections/overview_skeletons/Clock.jsx
diff --git a/src/components/modals/main/settings/sections/overview_skeletons/Date.jsx b/src/features/modals/main/settings/sections/overview_skeletons/Date.jsx
similarity index 100%
rename from src/components/modals/main/settings/sections/overview_skeletons/Date.jsx
rename to src/features/modals/main/settings/sections/overview_skeletons/Date.jsx
diff --git a/src/components/modals/main/settings/sections/overview_skeletons/Greeting.jsx b/src/features/modals/main/settings/sections/overview_skeletons/Greeting.jsx
similarity index 100%
rename from src/components/modals/main/settings/sections/overview_skeletons/Greeting.jsx
rename to src/features/modals/main/settings/sections/overview_skeletons/Greeting.jsx
diff --git a/src/components/modals/main/settings/sections/overview_skeletons/Message.jsx b/src/features/modals/main/settings/sections/overview_skeletons/Message.jsx
similarity index 100%
rename from src/components/modals/main/settings/sections/overview_skeletons/Message.jsx
rename to src/features/modals/main/settings/sections/overview_skeletons/Message.jsx
diff --git a/src/components/modals/main/settings/sections/overview_skeletons/QuickLinks.jsx b/src/features/modals/main/settings/sections/overview_skeletons/QuickLinks.jsx
similarity index 100%
rename from src/components/modals/main/settings/sections/overview_skeletons/QuickLinks.jsx
rename to src/features/modals/main/settings/sections/overview_skeletons/QuickLinks.jsx
diff --git a/src/components/modals/main/settings/sections/overview_skeletons/Quote.jsx b/src/features/modals/main/settings/sections/overview_skeletons/Quote.jsx
similarity index 100%
rename from src/components/modals/main/settings/sections/overview_skeletons/Quote.jsx
rename to src/features/modals/main/settings/sections/overview_skeletons/Quote.jsx
diff --git a/src/components/modals/main/settings/sections/quicklinks/AddModal.jsx b/src/features/modals/main/settings/sections/quicklinks/AddModal.jsx
similarity index 96%
rename from src/components/modals/main/settings/sections/quicklinks/AddModal.jsx
rename to src/features/modals/main/settings/sections/quicklinks/AddModal.jsx
index d59f406b..fe0c7c12 100644
--- a/src/components/modals/main/settings/sections/quicklinks/AddModal.jsx
+++ b/src/features/modals/main/settings/sections/quicklinks/AddModal.jsx
@@ -1,10 +1,9 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { useState, memo } from 'react';
import { TextareaAutosize } from '@mui/material';
import { MdAddLink, MdClose } from 'react-icons/md';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
+import { Tooltip } from 'components/Elements';
function AddModal({ urlError, iconError, addLink, closeModal, edit, editData, editLink }) {
const [name, setName] = useState(edit ? editData.name : '');
const [url, setUrl] = useState(edit ? editData.url : '');
diff --git a/src/components/modals/main/settings/sections/quicklinks/QuickLink.jsx b/src/features/modals/main/settings/sections/quicklinks/QuickLink.jsx
similarity index 97%
rename from src/components/modals/main/settings/sections/quicklinks/QuickLink.jsx
rename to src/features/modals/main/settings/sections/quicklinks/QuickLink.jsx
index ad8a1f2c..41b462df 100644
--- a/src/components/modals/main/settings/sections/quicklinks/QuickLink.jsx
+++ b/src/features/modals/main/settings/sections/quicklinks/QuickLink.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { MdEdit, MdCancel } from 'react-icons/md';
diff --git a/src/components/modals/main/tabs/Addons.jsx b/src/features/modals/main/tabs/Addons.jsx
similarity index 92%
rename from src/components/modals/main/tabs/Addons.jsx
rename to src/features/modals/main/tabs/Addons.jsx
index 9f548fda..2c42d393 100644
--- a/src/components/modals/main/tabs/Addons.jsx
+++ b/src/features/modals/main/tabs/Addons.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { memo } from 'react';
import Tabs from './backend/Tabs';
diff --git a/src/components/modals/main/tabs/Marketplace.jsx b/src/features/modals/main/tabs/Marketplace.jsx
similarity index 96%
rename from src/components/modals/main/tabs/Marketplace.jsx
rename to src/features/modals/main/tabs/Marketplace.jsx
index 5876ed17..a158c562 100644
--- a/src/components/modals/main/tabs/Marketplace.jsx
+++ b/src/features/modals/main/tabs/Marketplace.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { memo } from 'react';
import Tabs from './backend/Tabs';
diff --git a/src/components/modals/main/tabs/Settings.jsx b/src/features/modals/main/tabs/Settings.jsx
similarity index 98%
rename from src/components/modals/main/tabs/Settings.jsx
rename to src/features/modals/main/tabs/Settings.jsx
index 94489c33..474ac45d 100644
--- a/src/components/modals/main/tabs/Settings.jsx
+++ b/src/features/modals/main/tabs/Settings.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { memo } from 'react';
import Tabs from './backend/Tabs';
diff --git a/src/components/modals/main/tabs/backend/Tab.jsx b/src/features/modals/main/tabs/backend/Tab.jsx
similarity index 99%
rename from src/components/modals/main/tabs/backend/Tab.jsx
rename to src/features/modals/main/tabs/backend/Tab.jsx
index 98e81634..a172a089 100644
--- a/src/components/modals/main/tabs/backend/Tab.jsx
+++ b/src/features/modals/main/tabs/backend/Tab.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { memo, useState, useEffect } from 'react';
import {
MdSettings as Settings,
diff --git a/src/components/modals/main/tabs/backend/Tabs.jsx b/src/features/modals/main/tabs/backend/Tabs.jsx
similarity index 97%
rename from src/components/modals/main/tabs/backend/Tabs.jsx
rename to src/features/modals/main/tabs/backend/Tabs.jsx
index 9814b853..bf7643d3 100644
--- a/src/components/modals/main/tabs/backend/Tabs.jsx
+++ b/src/features/modals/main/tabs/backend/Tabs.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import {
MdSettings,
@@ -8,7 +8,7 @@ import {
MdClose,
} from 'react-icons/md';
import Tab from './Tab';
-import Button from '../../settings/Button';
+import { Button } from 'components/Elements';
import ErrorBoundary from '../../../ErrorBoundary';
class Tabs extends PureComponent {
diff --git a/src/features/modals/welcome/Sections/ChooseLanguage.jsx b/src/features/modals/welcome/Sections/ChooseLanguage.jsx
new file mode 100644
index 00000000..4f47c66c
--- /dev/null
+++ b/src/features/modals/welcome/Sections/ChooseLanguage.jsx
@@ -0,0 +1,40 @@
+import variables from 'config/variables';
+import { MdOutlineOpenInNew } from 'react-icons/md';
+import languages from '@/i18n/languages.json';
+
+import { Radio } from 'components/Form/Settings';
+import { Header } from '../components/Layout';
+
+function ChooseLanguage() {
+ return (
+ <>
+
+
+ GitHub
+
+
+
+ Weblate
+
+
+
+
+
+ >
+ );
+}
+
+export { ChooseLanguage as default, ChooseLanguage };
diff --git a/src/features/modals/welcome/Sections/Final.jsx b/src/features/modals/welcome/Sections/Final.jsx
new file mode 100644
index 00000000..1256ac44
--- /dev/null
+++ b/src/features/modals/welcome/Sections/Final.jsx
@@ -0,0 +1,45 @@
+import variables from 'config/variables';
+import languages from '@/i18n/languages.json';
+import { Header } from '../components/Layout';
+
+function Final(props) {
+ return (
+ <>
+
+
{variables.getMessage('modals.welcome.sections.final.changes')}
+
+ {variables.getMessage('modals.welcome.sections.final.changes_description')}
+
+
+
props.switchTab(1)}>
+
+ {variables.getMessage('modals.main.settings.sections.language.title')}:{' '}
+ {languages.find((i) => i.value === localStorage.getItem('language')).name}
+
+
+
props.switchTab(3)}>
+
+ {variables.getMessage('modals.main.settings.sections.appearance.theme.title')}:{' '}
+ {variables.getMessage(
+ 'modals.main.settings.sections.appearance.theme.' + localStorage.getItem('theme'),
+ )}
+
+
+ {/*}
+ {this.state.importedSettings.length !== 0 && (
+
this.props.switchTab(2)}>
+ {variables.getMessage('modals.main.settings.sections.final.imported', {
+ amount: this.state.importedSettings.length,
+ })}{' '}
+ {this.state.importedSettings.length}
+
+ )}*/}
+
+ >
+ );
+}
+
+export { Final as default, Final };
diff --git a/src/features/modals/welcome/Sections/ImportSettings.jsx b/src/features/modals/welcome/Sections/ImportSettings.jsx
new file mode 100644
index 00000000..01b5f1f2
--- /dev/null
+++ b/src/features/modals/welcome/Sections/ImportSettings.jsx
@@ -0,0 +1,69 @@
+import variables from 'config/variables';
+import { useState } from 'react';
+import { FileUpload } from 'components/Form/Settings';
+import { MdCloudUpload } from 'react-icons/md';
+import { importSettings as importSettingsFunction } from 'modules/helpers/settings/modals';
+import { Header } from '../components/Layout';
+import default_settings from 'modules/default_settings.json';
+
+function ImportSettings(props) {
+ const [importedSettings, setImportedSettings] = useState([]);
+
+ const importSettings = (e) => {
+ importSettingsFunction(e);
+
+ const settings = [];
+ const data = JSON.parse(e.target.result);
+ Object.keys(data).forEach((setting) => {
+ // language and theme already shown, the others are only used internally
+ if (
+ setting === 'language' ||
+ setting === 'theme' ||
+ setting === 'firstRun' ||
+ setting === 'showWelcome' ||
+ setting === 'showReminder'
+ ) {
+ return;
+ }
+
+ const defaultSetting = default_settings.find((i) => i.name === setting);
+ if (defaultSetting !== undefined) {
+ if (data[setting] === String(defaultSetting.value)) {
+ return;
+ }
+ }
+
+ settings.push({
+ name: setting,
+ value: data[setting],
+ });
+ });
+
+ setImportedSettings(settings);
+ props.switchTab(5);
+ };
+ return (
+ <>
+
+
document.getElementById('file-input').click()}>
+
+ {variables.getMessage('modals.main.settings.buttons.import')}
+
+
importSettings(e)}
+ />
+ {variables.getMessage('modals.welcome.tip')}
+
+ {variables.getMessage('modals.welcome.sections.settings.tip')}
+
+ >
+ );
+}
+
+export { ImportSettings as default, ImportSettings };
diff --git a/src/features/modals/welcome/Sections/Intro.jsx b/src/features/modals/welcome/Sections/Intro.jsx
new file mode 100644
index 00000000..e1bc475c
--- /dev/null
+++ b/src/features/modals/welcome/Sections/Intro.jsx
@@ -0,0 +1,82 @@
+import variables from 'config/variables';
+import { useState, useEffect } from 'react';
+
+import { Header } from '../components/Layout';
+import { MdOutlineWavingHand, MdOpenInNew } from 'react-icons/md';
+import { FaDiscord, FaGithub } from 'react-icons/fa';
+
+function Intro() {
+const [welcomeImage, setWelcomeImage] = useState(0);
+
+useEffect(() => {
+ const timer = setInterval(() => {
+ setWelcomeImage(prevWelcomeImage => prevWelcomeImage < 3 ? prevWelcomeImage + 1 : 0);
+ }, 3000);
+
+ // Cleanup function to clear the interval when the component unmounts
+ return () => clearInterval(timer);
+ }, [welcomeImage]);
+
+ return (
+ <>
+
+
+
+
#shareyourmue
+
+
+
+
+
+
+
+ {variables.getMessage('modals.welcome.sections.intro.title')}
+
+
+ {variables.getMessage('modals.welcome.sections.intro.description')}
+
+
+
+
+
+ >
+ );
+}
+
+export { Intro as default, Intro };
diff --git a/src/features/modals/welcome/Sections/PrivacyOptions.jsx b/src/features/modals/welcome/Sections/PrivacyOptions.jsx
new file mode 100644
index 00000000..34b68fa4
--- /dev/null
+++ b/src/features/modals/welcome/Sections/PrivacyOptions.jsx
@@ -0,0 +1,59 @@
+import variables from 'config/variables';
+import { MdOutlineOpenInNew } from 'react-icons/md';
+import { Checkbox } from 'components/Form/Settings';
+import { Header } from '../components/Layout';
+
+function PrivacyOptions() {
+ return (
+ <>
+
+
+
+ {variables.getMessage('modals.welcome.sections.privacy.offline_mode_description')}
+
+
+
+ {variables.getMessage('modals.welcome.sections.privacy.ddg_proxy_description')}
+
+
+ {variables.getMessage('modals.welcome.sections.privacy.links.title')}
+
+
+ {variables.getMessage('modals.welcome.sections.privacy.links.privacy_policy')}
+
+
+
+
+ {variables.getMessage('modals.welcome.sections.privacy.links.source_code')}
+
+
+ >
+ );
+}
+
+export { PrivacyOptions as default, PrivacyOptions };
diff --git a/src/features/modals/welcome/Sections/StyleSelection.jsx b/src/features/modals/welcome/Sections/StyleSelection.jsx
new file mode 100644
index 00000000..ae267508
--- /dev/null
+++ b/src/features/modals/welcome/Sections/StyleSelection.jsx
@@ -0,0 +1,41 @@
+import variables from 'config/variables';
+import { MdArchive, MdOutlineWhatshot } from 'react-icons/md';
+import { useState } from 'react';
+import { Header } from '../components/Layout';
+
+function StyleSelection() {
+ const widgetStyle = localStorage.getItem('widgetStyle');
+ const [style, setStyle] = useState({
+ newStyle: widgetStyle === 'legacy' ? 'toggle newStyle' : 'toggle newStyle active',
+ legacyStyle: widgetStyle === 'legacy' ? 'toggle legacyStyle active' : 'toggle legacyStyle',
+ });
+
+ const changeStyle = (type) => {
+ setStyle({
+ newStyle: type === 'new' ? 'toggle newStyle active' : 'toggle newStyle',
+ legacyStyle: type === 'legacy' ? 'toggle legacyStyle active' : 'toggle legacyStyle',
+ });
+
+ localStorage.setItem('widgetStyle', type);
+ };
+
+ return (
+ <>
+
+
+
+
changeStyle('legacy')}>
+
+ {variables.getMessage('modals.welcome.sections.style.legacy')}
+
+
changeStyle('new')}>
+
+ {variables.getMessage('modals.welcome.sections.style.modern')}
+
+
+
+ >
+ )
+}
+
+export { StyleSelection as default, StyleSelection };
\ No newline at end of file
diff --git a/src/features/modals/welcome/Sections/ThemeSelection.jsx b/src/features/modals/welcome/Sections/ThemeSelection.jsx
new file mode 100644
index 00000000..0bc5321b
--- /dev/null
+++ b/src/features/modals/welcome/Sections/ThemeSelection.jsx
@@ -0,0 +1,56 @@
+import variables from 'config/variables';
+import { useState } from 'react';
+import { MdAutoAwesome, MdLightMode, MdDarkMode } from 'react-icons/md';
+import { loadSettings } from 'modules/helpers/settings';
+import { Header } from '../components/Layout';
+
+function ThemeSelection() {
+ const [theme, setTheme] = useState({
+ autoClass: 'toggle auto active',
+ lightClass: 'toggle lightTheme',
+ darkClass: 'toggle darkTheme',
+ });
+
+ const changeTheme = (type) => {
+ setTheme({
+ autoClass: type === 'auto' ? 'toggle auto active' : 'toggle auto',
+ lightClass: type === 'light' ? 'toggle lightTheme active' : 'toggle lightTheme',
+ darkClass: type === 'dark' ? 'toggle darkTheme active' : 'toggle darkTheme',
+ });
+
+ localStorage.setItem('theme', type);
+ loadSettings(true);
+ };
+ return (
+ <>
+
+
+
changeTheme('auto')}>
+
+ {variables.getMessage('modals.main.settings.sections.appearance.theme.auto')}
+
+
+
changeTheme('light')}>
+
+
+ {variables.getMessage('modals.main.settings.sections.appearance.theme.light')}
+
+
+
changeTheme('dark')}>
+
+
+ {variables.getMessage('modals.main.settings.sections.appearance.theme.dark')}
+
+
+
+
+ {variables.getMessage('modals.welcome.tip')}
+ {variables.getMessage('modals.welcome.sections.theme.tip')}
+ >
+ );
+}
+
+export { ThemeSelection as default, ThemeSelection };
diff --git a/src/features/modals/welcome/Sections/index.jsx b/src/features/modals/welcome/Sections/index.jsx
new file mode 100644
index 00000000..2884bb5d
--- /dev/null
+++ b/src/features/modals/welcome/Sections/index.jsx
@@ -0,0 +1,7 @@
+export * from './Intro';
+export * from './ChooseLanguage';
+export * from './ImportSettings';
+export * from './ThemeSelection';
+export * from './StyleSelection';
+export * from './PrivacyOptions';
+export * from './Final';
\ No newline at end of file
diff --git a/src/components/modals/welcome/Welcome.jsx b/src/features/modals/welcome/Welcome.jsx
similarity index 73%
rename from src/components/modals/welcome/Welcome.jsx
rename to src/features/modals/welcome/Welcome.jsx
index b6107488..227a6b85 100644
--- a/src/components/modals/welcome/Welcome.jsx
+++ b/src/features/modals/welcome/Welcome.jsx
@@ -1,32 +1,42 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdArrowBackIosNew, MdArrowForwardIos, MdOutlinePreview } from 'react-icons/md';
import EventBus from 'modules/helpers/eventbus';
-import WelcomeSections from './WelcomeSections';
-import ProgressBar from './ProgressBar';
-import Button from '../main/settings/Button';
+import { ProgressBar } from './components/Elements';
+import { Button } from 'components/Elements';
+import { Wrapper, Panel } from './components/Layout';
import './welcome.scss';
+import {
+ Intro,
+ ChooseLanguage,
+ ImportSettings,
+ ThemeSelection,
+ StyleSelection,
+ PrivacyOptions,
+ Final,
+} from './Sections';
+
class WelcomeModal extends PureComponent {
constructor() {
super();
this.state = {
- image: './././icons/undraw_celebration.svg',
+ image: '/src/assets/icons/undraw_celebration.svg',
currentTab: 0,
finalTab: 5,
buttonText: variables.getMessage('modals.welcome.buttons.next'),
};
this.images = [
- './././icons/undraw_celebration.svg',
- './././icons/undraw_around_the_world_modified.svg',
- './././icons/undraw_add_files_modified.svg',
- './././icons/undraw_dark_mode.svg',
- './././icons/undraw_making_art.svg',
- './././icons/undraw_private_data_modified.svg',
- './././icons/undraw_upgrade_modified.svg',
+ '/src/assets/icons/undraw_celebration.svg',
+ '/src/assets/icons/undraw_around_the_world_modified.svg',
+ '/src/assets/icons/undraw_add_files_modified.svg',
+ '/src/assets/icons/undraw_dark_mode.svg',
+ '/src/assets/icons/undraw_making_art.svg',
+ '/src/assets/icons/undraw_private_data_modified.svg',
+ '/src/assets/icons/undraw_upgrade_modified.svg',
];
}
@@ -98,9 +108,20 @@ class WelcomeModal extends PureComponent {
}
render() {
+ const tabComponents = {
+ 0: ,
+ 1: ,
+ 2: this.switchTab(tab)} />,
+ 3: ,
+ 4: ,
+ 5: ,
+ 6: this.switchTab(tab)} />,
+ };
+
+ let CurrentSection = tabComponents[this.state.currentTab] || ;
return (
-
-
+
+
this.switchTab(tab)}
/>
-
-
-
- this.switchTab(tab)}
- />
-
+
+
+ {CurrentSection}
{this.state.currentTab !== 0 ? (
-
-
+
+
);
}
}
diff --git a/src/components/modals/welcome/WelcomeSections.jsx b/src/features/modals/welcome/WelcomeSections.jsx
similarity index 97%
rename from src/components/modals/welcome/WelcomeSections.jsx
rename to src/features/modals/welcome/WelcomeSections.jsx
index e256b91d..bcea9f67 100644
--- a/src/components/modals/welcome/WelcomeSections.jsx
+++ b/src/features/modals/welcome/WelcomeSections.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import {
@@ -13,16 +13,13 @@ import {
MdOutlineOpenInNew,
} from 'react-icons/md';
import { FaDiscord, FaGithub } from 'react-icons/fa';
-
-import Radio from '../main/settings/Radio';
-import Checkbox from '../main/settings/Checkbox';
-import FileUpload from '../main/settings/FileUpload';
+import { Radio, Checkbox, FileUpload } from 'components/Form/Settings';
import { loadSettings } from 'modules/helpers/settings';
import { importSettings } from 'modules/helpers/settings/modals';
import default_settings from 'modules/default_settings.json';
-import languages from 'modules/languages.json';
+import languages from '@/i18n/languages.json';
class WelcomeSections extends PureComponent {
constructor() {
@@ -146,7 +143,7 @@ class WelcomeSections extends PureComponent {
diff --git a/src/components/modals/welcome/ProgressBar.jsx b/src/features/modals/welcome/components/Elements/ProgressBar/ProgressBar.jsx
similarity index 79%
rename from src/components/modals/welcome/ProgressBar.jsx
rename to src/features/modals/welcome/components/Elements/ProgressBar/ProgressBar.jsx
index 70e27738..a6d310d7 100644
--- a/src/components/modals/welcome/ProgressBar.jsx
+++ b/src/features/modals/welcome/components/Elements/ProgressBar/ProgressBar.jsx
@@ -21,4 +21,7 @@ function ProgressBar({ count, currentTab, switchTab }) {
);
}
-export default memo(ProgressBar);
+const MemoizedProgressBar = memo(ProgressBar);
+
+export default MemoizedProgressBar;
+export { MemoizedProgressBar as ProgressBar };
\ No newline at end of file
diff --git a/src/features/modals/welcome/components/Elements/ProgressBar/index.jsx b/src/features/modals/welcome/components/Elements/ProgressBar/index.jsx
new file mode 100644
index 00000000..979a48fd
--- /dev/null
+++ b/src/features/modals/welcome/components/Elements/ProgressBar/index.jsx
@@ -0,0 +1 @@
+export * from './ProgressBar';
\ No newline at end of file
diff --git a/src/features/modals/welcome/components/Elements/index.jsx b/src/features/modals/welcome/components/Elements/index.jsx
new file mode 100644
index 00000000..979a48fd
--- /dev/null
+++ b/src/features/modals/welcome/components/Elements/index.jsx
@@ -0,0 +1 @@
+export * from './ProgressBar';
\ No newline at end of file
diff --git a/src/features/modals/welcome/components/Layout/Header.jsx b/src/features/modals/welcome/components/Layout/Header.jsx
new file mode 100644
index 00000000..46ba683e
--- /dev/null
+++ b/src/features/modals/welcome/components/Layout/Header.jsx
@@ -0,0 +1,12 @@
+function Header({ title, subtitle }) {
+ return (
+ <>
+
{title}
+
+ {subtitle}
+
+ >
+ );
+}
+
+export { Header as default, Header };
diff --git a/src/features/modals/welcome/components/Layout/Layout.jsx b/src/features/modals/welcome/components/Layout/Layout.jsx
new file mode 100644
index 00000000..1785b539
--- /dev/null
+++ b/src/features/modals/welcome/components/Layout/Layout.jsx
@@ -0,0 +1,7 @@
+function Layout() {
+ return (
+
Cheese
+ )
+}
+
+export { Layout as default, Layout };
\ No newline at end of file
diff --git a/src/features/modals/welcome/components/Layout/Panel.jsx b/src/features/modals/welcome/components/Layout/Panel.jsx
new file mode 100644
index 00000000..05beebd8
--- /dev/null
+++ b/src/features/modals/welcome/components/Layout/Panel.jsx
@@ -0,0 +1,5 @@
+const Panel = ({ children, type }) => (
+
{type === 'content' ? {children}
: children}
+);
+
+export { Panel as default, Panel };
diff --git a/src/features/modals/welcome/components/Layout/Wrapper.jsx b/src/features/modals/welcome/components/Layout/Wrapper.jsx
new file mode 100644
index 00000000..cb786559
--- /dev/null
+++ b/src/features/modals/welcome/components/Layout/Wrapper.jsx
@@ -0,0 +1,5 @@
+const Wrapper = ({ children }) => (
+
{children}
+)
+
+export { Wrapper as default, Wrapper };
\ No newline at end of file
diff --git a/src/features/modals/welcome/components/Layout/index.jsx b/src/features/modals/welcome/components/Layout/index.jsx
new file mode 100644
index 00000000..3acb6361
--- /dev/null
+++ b/src/features/modals/welcome/components/Layout/index.jsx
@@ -0,0 +1,3 @@
+export * from './Wrapper';
+export * from './Panel';
+export * from './Header';
\ No newline at end of file
diff --git a/src/features/modals/welcome/components/index.jsx b/src/features/modals/welcome/components/index.jsx
new file mode 100644
index 00000000..9ec85a93
--- /dev/null
+++ b/src/features/modals/welcome/components/index.jsx
@@ -0,0 +1,2 @@
+export * from './Layout';
+export * from './Elements';
\ No newline at end of file
diff --git a/src/components/modals/welcome/welcome.scss b/src/features/modals/welcome/welcome.scss
similarity index 100%
rename from src/components/modals/welcome/welcome.scss
rename to src/features/modals/welcome/welcome.scss
diff --git a/src/components/widgets/Widgets.jsx b/src/features/widgets/Widgets.jsx
similarity index 95%
rename from src/components/widgets/Widgets.jsx
rename to src/features/widgets/Widgets.jsx
index f407f411..66fc0708 100644
--- a/src/components/widgets/Widgets.jsx
+++ b/src/features/widgets/Widgets.jsx
@@ -7,6 +7,7 @@ import Search from './search/Search';
import QuickLinks from './quicklinks/QuickLinks';
import Date from './time/Date';
import Message from './message/Message';
+import { WidgetsLayout } from 'components/Layout';
import EventBus from 'modules/helpers/eventbus';
@@ -73,9 +74,9 @@ export default class Widgets extends PureComponent {
render() {
// don't show when welcome is there
return this.state.welcome !== 'false' ? (
-
+
) : (
-
+
>}>
{this.enabled('searchBar') && }
{this.state.order.map((element, key) => (
@@ -83,7 +84,7 @@ export default class Widgets extends PureComponent {
))}
{this.enabled('weatherEnabled') && this.online ? : null}
-
+
);
}
}
diff --git a/src/components/widgets/background/Background.jsx b/src/features/widgets/background/Background.jsx
similarity index 99%
rename from src/components/widgets/background/Background.jsx
rename to src/features/widgets/background/Background.jsx
index 88802b43..4b9e3374 100644
--- a/src/components/widgets/background/Background.jsx
+++ b/src/features/widgets/background/Background.jsx
@@ -1,6 +1,6 @@
/* eslint-disable no-unused-expressions */
// todo: rewrite this mess
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import PhotoInformation from './PhotoInformation';
diff --git a/src/components/widgets/background/ExcludeModal.jsx b/src/features/widgets/background/ExcludeModal.jsx
similarity index 94%
rename from src/components/widgets/background/ExcludeModal.jsx
rename to src/features/widgets/background/ExcludeModal.jsx
index 9a916671..85b50814 100644
--- a/src/components/widgets/background/ExcludeModal.jsx
+++ b/src/features/widgets/background/ExcludeModal.jsx
@@ -1,7 +1,8 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { memo } from 'react';
import EventBus from 'modules/helpers/eventbus';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
+import { Tooltip } from 'components/Elements';
+
import { MdClose, MdDone } from 'react-icons/md';
function ExcludeModal({ modalClose, info }) {
diff --git a/src/components/widgets/background/Favourite.jsx b/src/features/widgets/background/Favourite.jsx
similarity index 98%
rename from src/components/widgets/background/Favourite.jsx
rename to src/features/widgets/background/Favourite.jsx
index ca2d2472..0702bd71 100644
--- a/src/components/widgets/background/Favourite.jsx
+++ b/src/features/widgets/background/Favourite.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdStar, MdStarBorder } from 'react-icons/md';
diff --git a/src/components/widgets/background/Maximise.jsx b/src/features/widgets/background/Maximise.jsx
similarity index 95%
rename from src/components/widgets/background/Maximise.jsx
rename to src/features/widgets/background/Maximise.jsx
index 03485fad..ce8a588f 100644
--- a/src/components/widgets/background/Maximise.jsx
+++ b/src/features/widgets/background/Maximise.jsx
@@ -1,10 +1,9 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import { MdCropFree } from 'react-icons/md';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
+import { Tooltip } from 'components/Elements';
class Maximise extends PureComponent {
constructor() {
super();
diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/features/widgets/background/PhotoInformation.jsx
similarity index 98%
rename from src/components/widgets/background/PhotoInformation.jsx
rename to src/features/widgets/background/PhotoInformation.jsx
index dc2f7239..cea2440b 100644
--- a/src/components/widgets/background/PhotoInformation.jsx
+++ b/src/features/widgets/background/PhotoInformation.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { useState, memo } from 'react';
import Favourite from './Favourite';
import {
@@ -14,9 +14,10 @@ import {
MdCategory as Category,
MdVisibilityOff as VisibilityOff,
} from 'react-icons/md';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
+import { Tooltip } from 'components/Elements';
+
import Modal from 'react-modal';
-import ShareModal from 'components/helpers/sharemodal/ShareModal';
+import { ShareModal } from 'components/Elements';
import ExcludeModal from './ExcludeModal';
/**
diff --git a/src/components/widgets/background/scss/_photoinformation.scss b/src/features/widgets/background/scss/_photoinformation.scss
similarity index 100%
rename from src/components/widgets/background/scss/_photoinformation.scss
rename to src/features/widgets/background/scss/_photoinformation.scss
diff --git a/src/components/widgets/background/scss/index.scss b/src/features/widgets/background/scss/index.scss
similarity index 100%
rename from src/components/widgets/background/scss/index.scss
rename to src/features/widgets/background/scss/index.scss
diff --git a/src/components/widgets/greeting/Greeting.jsx b/src/features/widgets/greeting/Greeting.jsx
similarity index 99%
rename from src/components/widgets/greeting/Greeting.jsx
rename to src/features/widgets/greeting/Greeting.jsx
index 3f6c32e7..bde1295a 100644
--- a/src/components/widgets/greeting/Greeting.jsx
+++ b/src/features/widgets/greeting/Greeting.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import { nth, convertTimezone } from 'modules/helpers/date';
diff --git a/src/components/widgets/greeting/greeting.scss b/src/features/widgets/greeting/greeting.scss
similarity index 100%
rename from src/components/widgets/greeting/greeting.scss
rename to src/features/widgets/greeting/greeting.scss
diff --git a/src/components/widgets/message/Message.jsx b/src/features/widgets/message/Message.jsx
similarity index 100%
rename from src/components/widgets/message/Message.jsx
rename to src/features/widgets/message/Message.jsx
diff --git a/src/components/widgets/message/message.scss b/src/features/widgets/message/message.scss
similarity index 100%
rename from src/components/widgets/message/message.scss
rename to src/features/widgets/message/message.scss
diff --git a/src/components/widgets/navbar/Apps.jsx b/src/features/widgets/navbar/Apps.jsx
similarity index 97%
rename from src/components/widgets/navbar/Apps.jsx
rename to src/features/widgets/navbar/Apps.jsx
index 79f9166b..68f4e1ad 100644
--- a/src/components/widgets/navbar/Apps.jsx
+++ b/src/features/widgets/navbar/Apps.jsx
@@ -1,9 +1,10 @@
// TODO: make it work with pins or on click or smth
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, memo, useState } from 'react';
import { MdPlaylistRemove, MdOutlineApps } from 'react-icons/md';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
+import { Tooltip } from 'components/Elements';
+
import { shift, useFloating } from '@floating-ui/react-dom';
import EventBus from 'modules/helpers/eventbus';
diff --git a/src/components/widgets/navbar/Navbar.jsx b/src/features/widgets/navbar/Navbar.jsx
similarity index 97%
rename from src/components/widgets/navbar/Navbar.jsx
rename to src/features/widgets/navbar/Navbar.jsx
index c9ce3467..ccceabc1 100644
--- a/src/components/widgets/navbar/Navbar.jsx
+++ b/src/features/widgets/navbar/Navbar.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import { MdRefresh, MdSettings } from 'react-icons/md';
@@ -7,8 +7,7 @@ import Notes from './Notes';
import Todo from './Todo';
import Apps from './Apps';
import Maximise from '../background/Maximise';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
+import { Tooltip } from 'components/Elements';
import EventBus from 'modules/helpers/eventbus';
import './scss/index.scss';
diff --git a/src/components/widgets/navbar/Notes.jsx b/src/features/widgets/navbar/Notes.jsx
similarity index 97%
rename from src/components/widgets/navbar/Notes.jsx
rename to src/features/widgets/navbar/Notes.jsx
index 11880812..42fe1104 100644
--- a/src/components/widgets/navbar/Notes.jsx
+++ b/src/features/widgets/navbar/Notes.jsx
@@ -1,11 +1,12 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, memo, useState } from 'react';
import { MdContentCopy, MdAssignment, MdPushPin, MdDownload } from 'react-icons/md';
import { useFloating, shift } from '@floating-ui/react-dom';
import TextareaAutosize from '@mui/material/TextareaAutosize';
import { toast } from 'react-toastify';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
+import { Tooltip } from 'components/Elements';
+
import { saveFile } from 'modules/helpers/settings/modals';
import EventBus from 'modules/helpers/eventbus';
diff --git a/src/components/widgets/navbar/Todo.jsx b/src/features/widgets/navbar/Todo.jsx
similarity index 98%
rename from src/components/widgets/navbar/Todo.jsx
rename to src/features/widgets/navbar/Todo.jsx
index 1990b627..11fe8046 100644
--- a/src/components/widgets/navbar/Todo.jsx
+++ b/src/features/widgets/navbar/Todo.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, memo, useState } from 'react';
import {
@@ -10,7 +10,8 @@ import {
MdPlaylistRemove,
} from 'react-icons/md';
import TextareaAutosize from '@mui/material/TextareaAutosize';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
+import { Tooltip } from 'components/Elements';
+
import Checkbox from '@mui/material/Checkbox';
import { shift, useFloating } from '@floating-ui/react-dom';
import { sortableContainer, sortableElement, sortableHandle } from '@muetab/react-sortable-hoc';
diff --git a/src/components/widgets/navbar/scss/_apps.scss b/src/features/widgets/navbar/scss/_apps.scss
similarity index 100%
rename from src/components/widgets/navbar/scss/_apps.scss
rename to src/features/widgets/navbar/scss/_apps.scss
diff --git a/src/components/widgets/navbar/scss/_notes.scss b/src/features/widgets/navbar/scss/_notes.scss
similarity index 100%
rename from src/components/widgets/navbar/scss/_notes.scss
rename to src/features/widgets/navbar/scss/_notes.scss
diff --git a/src/components/widgets/navbar/scss/_todo.scss b/src/features/widgets/navbar/scss/_todo.scss
similarity index 100%
rename from src/components/widgets/navbar/scss/_todo.scss
rename to src/features/widgets/navbar/scss/_todo.scss
diff --git a/src/components/widgets/navbar/scss/index.scss b/src/features/widgets/navbar/scss/index.scss
similarity index 100%
rename from src/components/widgets/navbar/scss/index.scss
rename to src/features/widgets/navbar/scss/index.scss
diff --git a/src/components/widgets/quicklinks/QuickLinks.jsx b/src/features/widgets/quicklinks/QuickLinks.jsx
similarity index 98%
rename from src/components/widgets/quicklinks/QuickLinks.jsx
rename to src/features/widgets/quicklinks/QuickLinks.jsx
index 85587df1..cff5b8b1 100644
--- a/src/components/widgets/quicklinks/QuickLinks.jsx
+++ b/src/features/widgets/quicklinks/QuickLinks.jsx
@@ -1,5 +1,6 @@
import { PureComponent, createRef } from 'react';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
+import { Tooltip } from 'components/Elements';
+
import EventBus from 'modules/helpers/eventbus';
import './quicklinks.scss';
diff --git a/src/components/widgets/quicklinks/quicklinks.scss b/src/features/widgets/quicklinks/quicklinks.scss
similarity index 100%
rename from src/components/widgets/quicklinks/quicklinks.scss
rename to src/features/widgets/quicklinks/quicklinks.scss
diff --git a/src/components/widgets/quote/Quote.jsx b/src/features/widgets/quote/Quote.jsx
similarity index 98%
rename from src/components/widgets/quote/Quote.jsx
rename to src/features/widgets/quote/Quote.jsx
index 2de5fc7c..49b37c93 100644
--- a/src/components/widgets/quote/Quote.jsx
+++ b/src/features/widgets/quote/Quote.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import {
MdContentCopy,
@@ -11,9 +11,10 @@ import {
import { toast } from 'react-toastify';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
+import { Tooltip } from 'components/Elements';
+
import Modal from 'react-modal';
-import ShareModal from 'components/helpers/sharemodal/ShareModal';
+import { ShareModal } from 'components/Elements';
import offline_quotes from './offline_quotes.json';
diff --git a/src/components/widgets/quote/offline_quotes.json b/src/features/widgets/quote/offline_quotes.json
similarity index 100%
rename from src/components/widgets/quote/offline_quotes.json
rename to src/features/widgets/quote/offline_quotes.json
diff --git a/src/components/widgets/quote/quote.scss b/src/features/widgets/quote/quote.scss
similarity index 100%
rename from src/components/widgets/quote/quote.scss
rename to src/features/widgets/quote/quote.scss
diff --git a/src/components/widgets/search/Search.jsx b/src/features/widgets/search/Search.jsx
similarity index 96%
rename from src/components/widgets/search/Search.jsx
rename to src/features/widgets/search/Search.jsx
index 790f2131..897fde51 100644
--- a/src/components/widgets/search/Search.jsx
+++ b/src/features/widgets/search/Search.jsx
@@ -1,18 +1,17 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import { MdSearch, MdMic, MdScreenSearchDesktop } from 'react-icons/md';
import { BsGoogle } from 'react-icons/bs';
import { SiDuckduckgo, SiMicrosoftbing, SiYahoo, SiBaidu } from 'react-icons/si';
import { FaYandex } from 'react-icons/fa';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
-import AutocompleteInput from 'components/helpers/autocomplete/Autocomplete';
+import { Tooltip } from 'components/Elements';
+import AutocompleteInput from 'features/helpers/autocomplete/Autocomplete';
import EventBus from 'modules/helpers/eventbus';
import './search.scss';
-import searchEngines from 'components/widgets/search/search_engines.json';
+import searchEngines from 'features/widgets/search/search_engines.json';
export default class Search extends PureComponent {
constructor() {
diff --git a/src/components/widgets/search/search.scss b/src/features/widgets/search/search.scss
similarity index 100%
rename from src/components/widgets/search/search.scss
rename to src/features/widgets/search/search.scss
diff --git a/src/components/widgets/search/search_engines.json b/src/features/widgets/search/search_engines.json
similarity index 100%
rename from src/components/widgets/search/search_engines.json
rename to src/features/widgets/search/search_engines.json
diff --git a/src/components/widgets/time/Clock.jsx b/src/features/widgets/time/Clock.jsx
similarity index 100%
rename from src/components/widgets/time/Clock.jsx
rename to src/features/widgets/time/Clock.jsx
diff --git a/src/components/widgets/time/Date.jsx b/src/features/widgets/time/Date.jsx
similarity index 99%
rename from src/components/widgets/time/Date.jsx
rename to src/features/widgets/time/Date.jsx
index 123125ee..29ae1223 100644
--- a/src/components/widgets/time/Date.jsx
+++ b/src/features/widgets/time/Date.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import { nth, convertTimezone } from '../../../modules/helpers/date';
diff --git a/src/components/widgets/time/clock.scss b/src/features/widgets/time/clock.scss
similarity index 100%
rename from src/components/widgets/time/clock.scss
rename to src/features/widgets/time/clock.scss
diff --git a/src/components/widgets/time/date.scss b/src/features/widgets/time/date.scss
similarity index 100%
rename from src/components/widgets/time/date.scss
rename to src/features/widgets/time/date.scss
diff --git a/src/components/widgets/time/timezones.json b/src/features/widgets/time/timezones.json
similarity index 100%
rename from src/components/widgets/time/timezones.json
rename to src/features/widgets/time/timezones.json
diff --git a/src/components/widgets/weather/Expanded.jsx b/src/features/widgets/weather/Expanded.jsx
similarity index 98%
rename from src/components/widgets/weather/Expanded.jsx
rename to src/features/widgets/weather/Expanded.jsx
index 3796f82b..070c660a 100644
--- a/src/components/widgets/weather/Expanded.jsx
+++ b/src/features/widgets/weather/Expanded.jsx
@@ -6,8 +6,7 @@ import { MdDisabledVisible } from 'react-icons/md';
import WeatherIcon from './WeatherIcon';
import WindDirectionIcon from './WindDirectionIcon';
-import Tooltip from 'components/helpers/tooltip/Tooltip';
-
+import { Tooltip } from 'components/Elements';
function Expanded({ state: { weather, icon }, weatherType, variables }) {
/**
* If the localStorage item is true and the weatherType is greater than or equal to 3, or if the
diff --git a/src/components/widgets/weather/Weather.jsx b/src/features/widgets/weather/Weather.jsx
similarity index 99%
rename from src/components/widgets/weather/Weather.jsx
rename to src/features/widgets/weather/Weather.jsx
index 67774fb4..64399e2f 100644
--- a/src/components/widgets/weather/Weather.jsx
+++ b/src/features/widgets/weather/Weather.jsx
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { PureComponent } from 'react';
import WeatherIcon from './WeatherIcon';
diff --git a/src/components/widgets/weather/WeatherIcon.jsx b/src/features/widgets/weather/WeatherIcon.jsx
similarity index 100%
rename from src/components/widgets/weather/WeatherIcon.jsx
rename to src/features/widgets/weather/WeatherIcon.jsx
diff --git a/src/components/widgets/weather/WindDirectionIcon.jsx b/src/features/widgets/weather/WindDirectionIcon.jsx
similarity index 100%
rename from src/components/widgets/weather/WindDirectionIcon.jsx
rename to src/features/widgets/weather/WindDirectionIcon.jsx
diff --git a/src/components/widgets/weather/weather.scss b/src/features/widgets/weather/weather.scss
similarity index 100%
rename from src/components/widgets/weather/weather.scss
rename to src/features/widgets/weather/weather.scss
diff --git a/src/modules/languages.json b/src/i18n/languages.json
similarity index 100%
rename from src/modules/languages.json
rename to src/i18n/languages.json
diff --git a/src/translations/bn.json b/src/i18n/locales/bn.json
similarity index 100%
rename from src/translations/bn.json
rename to src/i18n/locales/bn.json
diff --git a/src/translations/de_DE.json b/src/i18n/locales/de_DE.json
similarity index 100%
rename from src/translations/de_DE.json
rename to src/i18n/locales/de_DE.json
diff --git a/src/translations/en_GB.json b/src/i18n/locales/en_GB.json
similarity index 100%
rename from src/translations/en_GB.json
rename to src/i18n/locales/en_GB.json
diff --git a/src/translations/en_US.json b/src/i18n/locales/en_US.json
similarity index 100%
rename from src/translations/en_US.json
rename to src/i18n/locales/en_US.json
diff --git a/src/translations/es.json b/src/i18n/locales/es.json
similarity index 100%
rename from src/translations/es.json
rename to src/i18n/locales/es.json
diff --git a/src/translations/es_419.json b/src/i18n/locales/es_419.json
similarity index 100%
rename from src/translations/es_419.json
rename to src/i18n/locales/es_419.json
diff --git a/src/translations/fr.json b/src/i18n/locales/fr.json
similarity index 100%
rename from src/translations/fr.json
rename to src/i18n/locales/fr.json
diff --git a/src/translations/id_ID.json b/src/i18n/locales/id_ID.json
similarity index 100%
rename from src/translations/id_ID.json
rename to src/i18n/locales/id_ID.json
diff --git a/src/translations/nl.json b/src/i18n/locales/nl.json
similarity index 100%
rename from src/translations/nl.json
rename to src/i18n/locales/nl.json
diff --git a/src/translations/no.json b/src/i18n/locales/no.json
similarity index 100%
rename from src/translations/no.json
rename to src/i18n/locales/no.json
diff --git a/src/translations/pt.json b/src/i18n/locales/pt.json
similarity index 100%
rename from src/translations/pt.json
rename to src/i18n/locales/pt.json
diff --git a/src/translations/pt_BR.json b/src/i18n/locales/pt_BR.json
similarity index 100%
rename from src/translations/pt_BR.json
rename to src/i18n/locales/pt_BR.json
diff --git a/src/translations/ru.json b/src/i18n/locales/ru.json
similarity index 100%
rename from src/translations/ru.json
rename to src/i18n/locales/ru.json
diff --git a/src/translations/tr_TR.json b/src/i18n/locales/tr_TR.json
similarity index 100%
rename from src/translations/tr_TR.json
rename to src/i18n/locales/tr_TR.json
diff --git a/src/translations/zh_CN.json b/src/i18n/locales/zh_CN.json
similarity index 100%
rename from src/translations/zh_CN.json
rename to src/i18n/locales/zh_CN.json
diff --git a/src/index.jsx b/src/index.jsx
index 717c7075..c29d2565 100644
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -4,7 +4,7 @@ import * as Sentry from '@sentry/react';
import App from './App';
import ErrorBoundary from './ErrorBoundary';
-import variables from './modules/variables';
+import variables from './config/variables';
import './scss/index.scss';
// the toast css is based on default so we need to import it
diff --git a/src/modules/helpers/settings/index.js b/src/modules/helpers/settings/index.js
index 54416de5..dbcdcb98 100644
--- a/src/modules/helpers/settings/index.js
+++ b/src/modules/helpers/settings/index.js
@@ -1,8 +1,8 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import experimentalInit from '../experimental';
import defaultSettings from 'modules/default_settings.json';
-import languages from 'modules/languages.json';
+import languages from '@/i18n/languages.json';
/**
* It sets the default settings for the extension
diff --git a/src/modules/helpers/settings/modals.js b/src/modules/helpers/settings/modals.js
index 24aa52a0..847bbabc 100644
--- a/src/modules/helpers/settings/modals.js
+++ b/src/modules/helpers/settings/modals.js
@@ -1,4 +1,4 @@
-import variables from 'modules/variables';
+import variables from 'config/variables';
import { toast } from 'react-toastify';
/**
diff --git a/src/modules/translations.js b/src/modules/translations.js
index ff1f9ca1..c0afa5d1 100644
--- a/src/modules/translations.js
+++ b/src/modules/translations.js
@@ -1,19 +1,19 @@
import I18n from '@eartharoid/i18n';
-import * as de_DE from '../translations/de_DE.json';
-import * as en_GB from '../translations/en_GB.json';
-import * as en_US from '../translations/en_US.json';
-import * as es from '../translations/es.json';
-import * as es_419 from '../translations/es_419.json';
-import * as fr from '../translations/fr.json';
-import * as nl from '../translations/nl.json';
-import * as no from '../translations/no.json';
-import * as ru from '../translations/ru.json';
-import * as zh_CN from '../translations/zh_CN.json';
-import * as id_ID from '../translations/id_ID.json';
-import * as tr_TR from '../translations/tr_TR.json';
-import * as pt_BR from '../translations/pt_BR.json';
-import * as bn from '../translations/bn.json';
+import * as de_DE from 'translations/de_DE.json';
+import * as en_GB from 'translations/en_GB.json';
+import * as en_US from 'translations/en_US.json';
+import * as es from 'translations/es.json';
+import * as es_419 from 'translations/es_419.json';
+import * as fr from 'translations/fr.json';
+import * as nl from 'translations/nl.json';
+import * as no from 'translations/no.json';
+import * as ru from 'translations/ru.json';
+import * as zh_CN from 'translations/zh_CN.json';
+import * as id_ID from 'translations/id_ID.json';
+import * as tr_TR from 'translations/tr_TR.json';
+import * as pt_BR from 'translations/pt_BR.json';
+import * as bn from 'translations/bn.json';
/**
* Initialise the i18n object.
@@ -57,4 +57,4 @@ export const translations = {
tr_TR,
pt_BR,
bn,
-};
\ No newline at end of file
+};
diff --git a/src/scss/index.scss b/src/scss/index.scss
index d42e224c..bbe9de53 100644
--- a/src/scss/index.scss
+++ b/src/scss/index.scss
@@ -122,12 +122,6 @@ body {
place-items: center;
width: 100vw;
height: 100vh;
- .criticalError-message {
- color: #fff;
- }
- p {
- color: #ffffffc0;
- }
.criticalError-actions {
display: flex;
@@ -137,10 +131,7 @@ body {
button,
a {
- background: #0e1013;
- box-shadow: 0 0 0 1px #484848;
border: 0;
- color: #fff;
border-radius: 12px;
padding: 10px 30px 10px 30px;
font-size: 1rem;
@@ -152,9 +143,58 @@ body {
transition: 0.5s;
cursor: pointer;
text-decoration: none;
+ }
+}
- &:hover {
- background: #1e1e1e;
+/* light theme critical error */
+@media (prefers-color-scheme: dark) {
+ /** {
+ background-color: #000000 !important;
+ }*/
+
+ .criticalError {
+ .criticalError-message {
+ color: #fff;
+ }
+
+ p {
+ color: rgba(255, 255, 255, 0.7529411765);
+ }
+
+ a {
+ background: #0e1013;
+ box-shadow: 0 0 0 1px #484848;
+ color: #fff;
+
+ &:hover {
+ background: #1e1e1e;
+ }
+ }
+ }
+}
+
+@media (prefers-color-scheme: light) {
+ * {
+ background-color: #ffffff !important;
+ }
+
+ .criticalError {
+ .criticalError-message {
+ color: #000;
+ }
+
+ p {
+ color: rgba(0, 0, 0, 0.7529411765);
+ }
+
+ a {
+ background: #fdfdfd;
+ box-shadow: 0 0 0 1px #484848;
+ color: #000;
+
+ &:hover {
+ background: #f5f5f5;
+ }
}
}
}
diff --git a/vite.config.mjs b/vite.config.mjs
index bc4155c8..0f26c652 100644
--- a/vite.config.mjs
+++ b/vite.config.mjs
@@ -1,4 +1,4 @@
-import { defineConfig } from 'vite';
+import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import fs from 'fs';
@@ -63,39 +63,48 @@ const prepareBuilds = () => ({
},
});
-export default defineConfig({
- plugins: [react(), prepareBuilds(), progress()],
- server: {
- open: true,
- hmr: {
- protocol: 'ws',
- host: 'localhost',
+export default defineConfig(({ command, mode }) => {
+ const env = loadEnv(mode, process.cwd(), '');
+ return {
+ define: {
+ __APP_ENV__: JSON.stringify(env.APP_ENV),
},
- },
- build: {
- minify: isProd ? 'esbuild' : false,
- sourcemap: !isProd,
- rollupOptions: {
- output: {
- manualChunks(id) {
- if (id.includes('node_modules')) {
- if (id.includes('@mui')) {
- return 'vendor_mui';
- }
+ plugins: [react(), prepareBuilds(), progress()],
+ server: {
+ open: true,
+ hmr: {
+ protocol: 'ws',
+ host: 'localhost',
+ },
+ },
+ build: {
+ minify: isProd ? 'esbuild' : false,
+ sourcemap: !isProd,
+ rollupOptions: {
+ output: {
+ manualChunks(id) {
+ if (id.includes('node_modules')) {
+ if (id.includes('@mui')) {
+ return 'vendor_mui';
+ }
- return 'vendor';
- }
+ return 'vendor';
+ }
+ },
},
},
},
- },
- resolve: {
- extensions: ['.js', '.jsx'],
- alias: {
- components: path.resolve(__dirname, './src/components'),
- modules: path.resolve(__dirname, './src/modules'),
- translations: path.resolve(__dirname, './src/translations'),
- scss: path.resolve(__dirname, './src/scss'),
+ resolve: {
+ extensions: ['.js', '.jsx'],
+ alias: {
+ '@': path.resolve(__dirname, './src'),
+ features: path.resolve(__dirname, './src/features'),
+ components: path.resolve(__dirname, './src/components'),
+ modules: path.resolve(__dirname, './src/modules'),
+ translations: path.resolve(__dirname, './src/i18n/locales'),
+ config: path.resolve(__dirname, './src/config'),
+ scss: path.resolve(__dirname, './src/scss'),
+ },
},
- },
+ };
});