-
changeTheme('auto')}>
-
-
{variables.getMessage('modals.main.settings.sections.appearance.theme.auto')}
+
changeTheme(THEMES.AUTO)}>
+ {themeMapping[THEMES.AUTO].icon}
+ {themeMapping[THEMES.AUTO].text}
-
changeTheme('light')}>
-
-
- {variables.getMessage('modals.main.settings.sections.appearance.theme.light')}
-
-
-
changeTheme('dark')}>
-
-
- {variables.getMessage('modals.main.settings.sections.appearance.theme.dark')}
-
-
+ {Object.entries(themeMapping)
+ .filter(([type]) => type !== THEMES.AUTO)
+ .map(([type, { className, icon, text }]) => (
+
changeTheme(type)} key={type}>
+ {icon}
+ {text}
+
+ ))}
{variables.getMessage('modals.welcome.tip')}
{variables.getMessage('modals.welcome.sections.theme.tip')}
- >
+
);
}
-export { ThemeSelection as default, ThemeSelection };
+export { ThemeSelection as default, ThemeSelection };
\ No newline at end of file
diff --git a/src/features/modals/welcome/Welcome.jsx b/src/features/modals/welcome/Welcome.jsx
index 0ba3a1e4..0b9b0cf0 100644
--- a/src/features/modals/welcome/Welcome.jsx
+++ b/src/features/modals/welcome/Welcome.jsx
@@ -37,7 +37,6 @@ class WelcomeModal extends PureComponent {
if (minus) {
return this.setState({
currentTab: this.state.currentTab - 1,
- image: this.images[this.state.currentTab - 1],
buttonText: variables.getMessage('modals.welcome.buttons.next'),
});
}
@@ -48,7 +47,7 @@ class WelcomeModal extends PureComponent {
this.setState({
currentTab: this.state.currentTab + 1,
- image: this.images[this.state.currentTab + 1],
+ image: [this.state.currentTab + 1],
buttonText:
this.state.currentTab !== this.state.finalTab
? variables.getMessage('modals.welcome.buttons.next')
@@ -60,7 +59,6 @@ class WelcomeModal extends PureComponent {
switchTab(tab) {
this.setState({
currentTab: tab,
- image: this.images[tab],
buttonText:
tab !== this.state.finalTab + 1
? variables.getMessage('modals.welcome.buttons.next')
@@ -76,7 +74,6 @@ class WelcomeModal extends PureComponent {
if (welcomeTab) {
this.setState({
currentTab: Number(welcomeTab),
- image: this.images[Number(welcomeTab)],
buttonText:
Number(welcomeTab) !== this.state.finalTab + 1
? variables.getMessage('modals.welcome.buttons.next')
@@ -97,6 +94,38 @@ class WelcomeModal extends PureComponent {
EventBus.off('refresh');
}
+ renderButtons() {
+ const { currentTab, buttonText } = this.state;
+ const { modalSkip } = this.props;
+
+ return (
+
+ {currentTab !== 0 ? (
+
+ );
+ }
+
render() {
const tabComponents = {
0:
,
@@ -114,37 +143,14 @@ class WelcomeModal extends PureComponent {
this.switchTab(tab)}
/>
{CurrentSection}
-
- {this.state.currentTab !== 0 ? (
- this.changeTab(true)}
- icon={}
- label={variables.getMessage('modals.welcome.buttons.previous')}
- />
- ) : (
- this.props.modalSkip()}
- icon={}
- label={variables.getMessage('modals.welcome.buttons.preview')}
- />
- )}
- this.changeTab()}
- icon={}
- label={this.state.buttonText}
- iconPlacement={'right'}
- />
-
+ {this.renderButtons()}
);
diff --git a/src/features/modals/welcome/components/Elements/ProgressBar/ProgressBar.jsx b/src/features/modals/welcome/components/Elements/ProgressBar/ProgressBar.jsx
index a6d310d7..acd12b64 100644
--- a/src/features/modals/welcome/components/Elements/ProgressBar/ProgressBar.jsx
+++ b/src/features/modals/welcome/components/Elements/ProgressBar/ProgressBar.jsx
@@ -1,22 +1,26 @@
import { memo } from 'react';
-function ProgressBar({ count, currentTab, switchTab }) {
+const Step = memo(({ isActive, index, onClick }) => {
+ const className = isActive ? 'step active' : 'step';
+
+ return (
+
+ {index + 1}
+
+ );
+});
+
+function ProgressBar({ numberOfTabs, currentTab, switchTab }) {
return (
- {count.map((num) => {
- let className = 'step';
-
- const index = count.indexOf(num);
- if (index === currentTab) {
- className = 'step active';
- }
-
- return (
-
switchTab(index)}>
- {index + 1}
-
- );
- })}
+ {Array.from({ length: numberOfTabs }, (_, index) => (
+
switchTab(index)}
+ />
+ ))}
);
}
diff --git a/src/features/modals/welcome/components/Layout/Content.jsx b/src/features/modals/welcome/components/Layout/Content.jsx
new file mode 100644
index 00000000..3e8d0410
--- /dev/null
+++ b/src/features/modals/welcome/components/Layout/Content.jsx
@@ -0,0 +1,7 @@
+const Content = ({ children }) => {
+ return (
+
{children}
+ )
+}
+
+export { Content as default, Content };
\ 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
index 2f988954..6f67ab9f 100644
--- a/src/features/modals/welcome/components/Layout/Panel.jsx
+++ b/src/features/modals/welcome/components/Layout/Panel.jsx
@@ -1,12 +1,6 @@
const Panel = ({ children, type }) => (
- {type === 'content' ? (
- {children}
- ) : type === 'aside' ? (
- <>{children}>
- ) : (
- children
- )}
+ {children}
);
diff --git a/src/features/modals/welcome/components/Layout/index.jsx b/src/features/modals/welcome/components/Layout/index.jsx
index 3acb6361..9f455392 100644
--- a/src/features/modals/welcome/components/Layout/index.jsx
+++ b/src/features/modals/welcome/components/Layout/index.jsx
@@ -1,3 +1,4 @@
export * from './Wrapper';
export * from './Panel';
-export * from './Header';
\ No newline at end of file
+export * from './Header';
+export * from './Content';
\ No newline at end of file
diff --git a/src/features/modals/welcome/welcome.scss b/src/features/modals/welcome/welcome.scss
index df3857e9..796c9116 100644
--- a/src/features/modals/welcome/welcome.scss
+++ b/src/features/modals/welcome/welcome.scss
@@ -89,6 +89,16 @@
}
.themesToggleArea {
+ display: grid;
+ grid-template-columns: 1fr;
+ grid-template-rows: auto auto;
+ div:nth-child(1) {
+ grid-column: span 1 / span 1 !important;
+ }
+ div:nth-child(2),
+ div:nth-child(3) {
+ grid-column: span 1 / span 1 !important;
+ }
@include themed {
.active {
background: t($modal-sidebarActive);
@@ -199,6 +209,7 @@ a.privacy {
flex-flow: column;
.shareYourMue {
+ width: -moz-fit-content;
width: fit-content;
}
@@ -305,6 +316,7 @@ a.privacy {
.welcomeButtons {
z-index: 999;
+ -webkit-backdrop-filter: blur(2px);
backdrop-filter: blur(2px);
position: sticky;
bottom: 0;