mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
feat(renderer): mount ModalLayer + first-launch welcome trigger
This commit is contained in:
+10
-3
@@ -1,7 +1,14 @@
|
|||||||
import { AppShell } from './components/layout/AppShell';
|
import { AppShell } from './components/layout/AppShell';
|
||||||
|
import { ModalLayer } from './components/modals/ModalLayer';
|
||||||
|
import { useWelcomeTrigger } from './hooks/use-welcome-trigger';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return <AppShell />;
|
useWelcomeTrigger();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<AppShell />
|
||||||
|
<ModalLayer />
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
export default App;
|
||||||
export default App;
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { useEffect } from 'react';
|
||||||
|
import { useAppStore } from '@/stores/app-store';
|
||||||
|
import { useSettingsStore } from '@/stores/settings-store';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On first mount, if the user hasn't dismissed the welcome dialog, open it.
|
||||||
|
* Call once at the top of App.tsx.
|
||||||
|
*/
|
||||||
|
export function useWelcomeTrigger() {
|
||||||
|
useEffect(() => {
|
||||||
|
if (!useSettingsStore.getState().welcomeDismissed) {
|
||||||
|
useAppStore.getState().openModal('welcome');
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user