File tree Expand file tree Collapse file tree 7 files changed +21
-25
lines changed Expand file tree Collapse file tree 7 files changed +21
-25
lines changed Original file line number Diff line number Diff line change 4747 icon: ' user' ,
4848 },
4949 {
50- title: ' Go Home ' ,
50+ title: ' Go Frontend ' ,
5151 route: ' /' ,
5252 icon: ' arrow-back' ,
5353 },
Original file line number Diff line number Diff line change 33 import MainLayout from ' ./MainLayout.svelte'
44 import { page , inertia , useForm } from ' @inertiajs/svelte'
55 import Footer from ' @/Components/Footer.svelte'
6+ import { confirmAction } from ' @/helpers'
7+ import { toasts } from ' svelte-toasts'
68
79 $ : auth = $page .props .auth .user
810
4143 isNavCollapsed = true
4244 e .preventDefault ()
4345
44- // const confirm: ModalSettings = {
45- // type: 'confirm',
46- // title: 'Logout?',
47- // body: 'Are you sure you want to logout?',
48- // response: (r: boolean) => {
49- // if (r) {
50- // $form.post(route('logout'), {
51- // onSuccess: () => {
52- // const t: ToastSettings = {
53- // message: 'Logged out',
54- // background: 'variant-filled-success',
55- // }
56- // toastStore.trigger(t)
57- // },
58- // })
59- // }
60- // },
61- // }
62-
63- // modalStore.trigger(confirm)
46+ confirmAction (' Are you sure you want to logout?' , () => {
47+ $form .post (route (' logout' ), {
48+ onSuccess : () => {
49+ toasts .success (' Logged out' )
50+ },
51+ })
52+ })
6453 }
6554 </script >
6655
Original file line number Diff line number Diff line change 102102 </div >
103103 </div >
104104
105- <slot />
105+ <main class =" container px-2 md:px-4 lg:px-5" >
106+ <slot />
107+ </main >
106108 </div >
107109 </div >
108110</MainLayout >
Original file line number Diff line number Diff line change 2727 function handleSubmit(e ) {
2828 e .preventDefault ()
2929
30- $form .post (route (' login' ))
30+ $form .post (route (' login' ), {
31+ onSuccess : resp => {
32+ window .location .reload ()
33+ },
34+ })
3135 }
3236 </script >
3337
Original file line number Diff line number Diff line change 99 onMount (() => (ready = true ))
1010 </script >
1111
12- <div class =" container mt-5" >
12+ <div class =" mt-5" >
1313 {#if ready }
1414 <div in:fly ={{ y : - 70 , duration : 300 , easing : quintOut }}>
1515 <Title >User Dashboard</Title >
Original file line number Diff line number Diff line change 22 import { Title } from ' @/Components'
33 </script >
44
5- <div class =" container mt-5" >
5+ <div class =" mt-5" >
66 <Title >Profile</Title >
77</div >
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const appName = window.document.getElementsByTagName('title')[0]?.innerText || '
1313createInertiaApp ( {
1414 title : ( title : string | null ) => `${ title || '' } - ${ appName } ` ,
1515 resolve : ( name : string ) => {
16+ console . log ( "name" , name ) ;
1617 // set eager loading to true to get one js file. NB: Must be Enabled if Svelte
1718 const pages = import . meta. glob ( './Pages/**/*.svelte' , { eager : true } )
1819 let page = pages [ `./Pages/${ name } .svelte` ]
You can’t perform that action at this time.
0 commit comments