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 47
47
icon: ' user' ,
48
48
},
49
49
{
50
- title: ' Go Home ' ,
50
+ title: ' Go Frontend ' ,
51
51
route: ' /' ,
52
52
icon: ' arrow-back' ,
53
53
},
Original file line number Diff line number Diff line change 3
3
import MainLayout from ' ./MainLayout.svelte'
4
4
import { page , inertia , useForm } from ' @inertiajs/svelte'
5
5
import Footer from ' @/Components/Footer.svelte'
6
+ import { confirmAction } from ' @/helpers'
7
+ import { toasts } from ' svelte-toasts'
6
8
7
9
$ : auth = $page .props .auth .user
8
10
41
43
isNavCollapsed = true
42
44
e .preventDefault ()
43
45
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
+ })
64
53
}
65
54
</script >
66
55
Original file line number Diff line number Diff line change 102
102
</div >
103
103
</div >
104
104
105
- <slot />
105
+ <main class =" container px-2 md:px-4 lg:px-5" >
106
+ <slot />
107
+ </main >
106
108
</div >
107
109
</div >
108
110
</MainLayout >
Original file line number Diff line number Diff line change 27
27
function handleSubmit(e ) {
28
28
e .preventDefault ()
29
29
30
- $form .post (route (' login' ))
30
+ $form .post (route (' login' ), {
31
+ onSuccess : resp => {
32
+ window .location .reload ()
33
+ },
34
+ })
31
35
}
32
36
</script >
33
37
Original file line number Diff line number Diff line change 9
9
onMount (() => (ready = true ))
10
10
</script >
11
11
12
- <div class =" container mt-5" >
12
+ <div class =" mt-5" >
13
13
{#if ready }
14
14
<div in:fly ={{ y : - 70 , duration : 300 , easing : quintOut }}>
15
15
<Title >User Dashboard</Title >
Original file line number Diff line number Diff line change 2
2
import { Title } from ' @/Components'
3
3
</script >
4
4
5
- <div class =" container mt-5" >
5
+ <div class =" mt-5" >
6
6
<Title >Profile</Title >
7
7
</div >
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const appName = window.document.getElementsByTagName('title')[0]?.innerText || '
13
13
createInertiaApp ( {
14
14
title : ( title : string | null ) => `${ title || '' } - ${ appName } ` ,
15
15
resolve : ( name : string ) => {
16
+ console . log ( "name" , name ) ;
16
17
// set eager loading to true to get one js file. NB: Must be Enabled if Svelte
17
18
const pages = import . meta. glob ( './Pages/**/*.svelte' , { eager : true } )
18
19
let page = pages [ `./Pages/${ name } .svelte` ]
You can’t perform that action at this time.
0 commit comments