mirror of
https://github.com/mue/mue.git
synced 2026-07-14 04:24:01 +02:00
fix(welcome): Preview feature
This commit is contained in:
@@ -3,11 +3,17 @@ import variables from 'config/variables';
|
||||
import './preview.scss';
|
||||
|
||||
function Preview(props) {
|
||||
const setup = () => {
|
||||
localStorage.setItem('showWelcome', true);
|
||||
localStorage.setItem('welcomePreview', false);
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="preview-mode">
|
||||
<span className="title">{variables.getMessage('modals.main.settings.reminder.title')}</span>
|
||||
<span className="subtitle">{variables.getMessage('modals.welcome.preview.description')}</span>
|
||||
<button onClick={() => props.setup()}>
|
||||
<button onClick={() => setup()}>
|
||||
{variables.getMessage('modals.welcome.preview.continue')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -102,8 +102,8 @@ export default class Modals extends PureComponent {
|
||||
ariaHideApp={false}
|
||||
>
|
||||
<Welcome modalClose={() => this.closeWelcome()} modalSkip={() => this.previewWelcome()} />
|
||||
</Modal>*/}
|
||||
{this.state.preview && <Preview setup={() => window.location.reload()} />}
|
||||
</Modal>
|
||||
{this.state.preview && <Preview setup={() => window.location.reload()} />}*/}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -102,6 +102,14 @@ function WelcomeModal() {
|
||||
updateTabAndButtonText(tab);
|
||||
};
|
||||
|
||||
const modalSkip = () => {
|
||||
localStorage.setItem('showWelcome', false);
|
||||
localStorage.setItem('welcomePreview', true);
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
console.log(localStorage.getItem('showWelcome'));
|
||||
|
||||
const Navigation = () => {
|
||||
return (
|
||||
<div className="welcomeButtons">
|
||||
@@ -115,7 +123,7 @@ function WelcomeModal() {
|
||||
) : (
|
||||
<Button
|
||||
type="settings"
|
||||
//onClick={() => modalSkip()}
|
||||
onClick={() => modalSkip()}
|
||||
icon={<MdOutlinePreview />}
|
||||
label={variables.getMessage('modals.welcome.buttons.preview')}
|
||||
/>
|
||||
@@ -216,7 +224,7 @@ function WelcomeModal() {
|
||||
initial="enter"
|
||||
animate="center"
|
||||
exit="exit"
|
||||
transition={{ type: 'tween', duration: 1 }}
|
||||
transition={{ type: 'tween', duration: 0.8 }}
|
||||
style={{ position: 'absolute', height: '100%' }}
|
||||
>
|
||||
<div style={{ height: '100%', overflow: 'auto' }}>{tabs[currentTab]}</div>
|
||||
|
||||
Reference in New Issue
Block a user