From 920ba681088890023ff8f0d4ccc55df9e76b54d8 Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Mon, 18 Mar 2024 10:08:08 +0000 Subject: [PATCH] refactor(welcome): More conistent file structure --- src/features/welcome/Welcome.jsx | 2 +- .../{ => components}/Sections/ChooseLanguage.jsx | 2 +- .../welcome/{ => components}/Sections/Final.jsx | 2 +- .../{ => components}/Sections/ImportSettings.jsx | 2 +- .../welcome/{ => components}/Sections/Intro.jsx | 2 +- .../{ => components}/Sections/PrivacyOptions.jsx | 4 ++-- .../{ => components}/Sections/StyleSelection.jsx | 4 ++-- .../{ => components}/Sections/ThemeSelection.jsx | 10 ++++++---- .../welcome/{ => components}/Sections/index.jsx | 0 9 files changed, 15 insertions(+), 13 deletions(-) rename src/features/welcome/{ => components}/Sections/ChooseLanguage.jsx (94%) rename src/features/welcome/{ => components}/Sections/Final.jsx (96%) rename src/features/welcome/{ => components}/Sections/ImportSettings.jsx (97%) rename src/features/welcome/{ => components}/Sections/Intro.jsx (98%) rename src/features/welcome/{ => components}/Sections/PrivacyOptions.jsx (94%) rename src/features/welcome/{ => components}/Sections/StyleSelection.jsx (93%) rename src/features/welcome/{ => components}/Sections/ThemeSelection.jsx (90%) rename src/features/welcome/{ => components}/Sections/index.jsx (100%) diff --git a/src/features/welcome/Welcome.jsx b/src/features/welcome/Welcome.jsx index 106261f9..14799684 100644 --- a/src/features/welcome/Welcome.jsx +++ b/src/features/welcome/Welcome.jsx @@ -19,7 +19,7 @@ import { StyleSelection, PrivacyOptions, Final, -} from './Sections'; +} from './components/Sections'; // WelcomeModal component function WelcomeModal({ modalClose, modalSkip }) { diff --git a/src/features/welcome/Sections/ChooseLanguage.jsx b/src/features/welcome/components/Sections/ChooseLanguage.jsx similarity index 94% rename from src/features/welcome/Sections/ChooseLanguage.jsx rename to src/features/welcome/components/Sections/ChooseLanguage.jsx index 0dfad872..b25b7134 100644 --- a/src/features/welcome/Sections/ChooseLanguage.jsx +++ b/src/features/welcome/components/Sections/ChooseLanguage.jsx @@ -3,7 +3,7 @@ import { MdOutlineOpenInNew } from 'react-icons/md'; import languages from '@/i18n/languages.json'; import { Radio } from 'components/Form/Settings'; -import { Header, Content } from '../components/Layout'; +import { Header, Content } from '../Layout'; function ChooseLanguage() { return ( diff --git a/src/features/welcome/Sections/Final.jsx b/src/features/welcome/components/Sections/Final.jsx similarity index 96% rename from src/features/welcome/Sections/Final.jsx rename to src/features/welcome/components/Sections/Final.jsx index 8c502a7f..8689a067 100644 --- a/src/features/welcome/Sections/Final.jsx +++ b/src/features/welcome/components/Sections/Final.jsx @@ -1,6 +1,6 @@ import variables from 'config/variables'; import languages from '@/i18n/languages.json'; -import { Header, Content } from '../components/Layout'; +import { Header, Content } from '../Layout'; function Final(props) { return ( diff --git a/src/features/welcome/Sections/ImportSettings.jsx b/src/features/welcome/components/Sections/ImportSettings.jsx similarity index 97% rename from src/features/welcome/Sections/ImportSettings.jsx rename to src/features/welcome/components/Sections/ImportSettings.jsx index 3c78556e..23cd3c8a 100644 --- a/src/features/welcome/Sections/ImportSettings.jsx +++ b/src/features/welcome/components/Sections/ImportSettings.jsx @@ -3,7 +3,7 @@ import { useState } from 'react'; import { FileUpload } from 'components/Form/Settings'; import { MdCloudUpload } from 'react-icons/md'; import { importSettings as importSettingsFunction } from 'utils/settings'; -import { Header, Content } from '../components/Layout'; +import { Header, Content } from '../Layout'; import default_settings from 'utils/data/default_settings.json'; function ImportSettings(props) { diff --git a/src/features/welcome/Sections/Intro.jsx b/src/features/welcome/components/Sections/Intro.jsx similarity index 98% rename from src/features/welcome/Sections/Intro.jsx rename to src/features/welcome/components/Sections/Intro.jsx index 88abdcb2..78c2f77e 100644 --- a/src/features/welcome/Sections/Intro.jsx +++ b/src/features/welcome/components/Sections/Intro.jsx @@ -1,7 +1,7 @@ import variables from 'config/variables'; import { useState, useEffect, useCallback } from 'react'; -import { Header, Content } from '../components/Layout'; +import { Header, Content } from '../Layout'; import { MdOutlineWavingHand, MdOpenInNew } from 'react-icons/md'; import { FaDiscord, FaGithub } from 'react-icons/fa'; diff --git a/src/features/welcome/Sections/PrivacyOptions.jsx b/src/features/welcome/components/Sections/PrivacyOptions.jsx similarity index 94% rename from src/features/welcome/Sections/PrivacyOptions.jsx rename to src/features/welcome/components/Sections/PrivacyOptions.jsx index 9df95ac1..d64b18c4 100644 --- a/src/features/welcome/Sections/PrivacyOptions.jsx +++ b/src/features/welcome/components/Sections/PrivacyOptions.jsx @@ -1,7 +1,7 @@ import variables from 'config/variables'; import { MdOutlineOpenInNew } from 'react-icons/md'; import { Checkbox } from 'components/Form/Settings'; -import { Header, Content } from '../components/Layout'; +import { Header, Content } from '../Layout'; function OfflineMode() { return ( @@ -75,4 +75,4 @@ function PrivacyOptions() { ); } -export { PrivacyOptions as default, PrivacyOptions }; \ No newline at end of file +export { PrivacyOptions as default, PrivacyOptions }; diff --git a/src/features/welcome/Sections/StyleSelection.jsx b/src/features/welcome/components/Sections/StyleSelection.jsx similarity index 93% rename from src/features/welcome/Sections/StyleSelection.jsx rename to src/features/welcome/components/Sections/StyleSelection.jsx index 6a863c0e..cff82af0 100644 --- a/src/features/welcome/Sections/StyleSelection.jsx +++ b/src/features/welcome/components/Sections/StyleSelection.jsx @@ -1,7 +1,7 @@ import variables from 'config/variables'; import { MdArchive, MdOutlineWhatshot } from 'react-icons/md'; import { useState } from 'react'; -import { Header, Content } from '../components/Layout'; +import { Header, Content } from '../Layout'; const STYLES = { NEW: 'new', @@ -50,4 +50,4 @@ const StyleSelection = () => { ); }; -export { StyleSelection as default, StyleSelection }; \ No newline at end of file +export { StyleSelection as default, StyleSelection }; diff --git a/src/features/welcome/Sections/ThemeSelection.jsx b/src/features/welcome/components/Sections/ThemeSelection.jsx similarity index 90% rename from src/features/welcome/Sections/ThemeSelection.jsx rename to src/features/welcome/components/Sections/ThemeSelection.jsx index 48b00d0a..b5d68671 100644 --- a/src/features/welcome/Sections/ThemeSelection.jsx +++ b/src/features/welcome/components/Sections/ThemeSelection.jsx @@ -2,7 +2,7 @@ import variables from 'config/variables'; import { useState } from 'react'; import { MdAutoAwesome, MdLightMode, MdDarkMode } from 'react-icons/md'; import { loadSettings } from 'utils/settings'; -import { Header, Content } from '../components/Layout'; +import { Header, Content } from '../Layout'; const THEMES = { AUTO: 'auto', @@ -13,7 +13,6 @@ const THEMES = { function ThemeSelection() { const currentTheme = localStorage.getItem('theme') || THEMES.AUTO; const [theme, setTheme] = useState(currentTheme); - const changeTheme = (type) => { setTheme(type); @@ -46,7 +45,10 @@ function ThemeSelection() { subtitle={variables.getMessage('modals.welcome.sections.theme.description')} />
-
changeTheme(THEMES.AUTO)}> +
changeTheme(THEMES.AUTO)} + > {themeMapping[THEMES.AUTO].icon} {themeMapping[THEMES.AUTO].text}
@@ -67,4 +69,4 @@ function ThemeSelection() { ); } -export { ThemeSelection as default, ThemeSelection }; \ No newline at end of file +export { ThemeSelection as default, ThemeSelection }; diff --git a/src/features/welcome/Sections/index.jsx b/src/features/welcome/components/Sections/index.jsx similarity index 100% rename from src/features/welcome/Sections/index.jsx rename to src/features/welcome/components/Sections/index.jsx