kaze 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kaze/commands/install_command.rb +8 -0
  3. data/lib/kaze/commands/installs_hotwire_stack.rb +5 -2
  4. data/lib/kaze/commands/installs_inertia_stacks.rb +13 -3
  5. data/lib/kaze/version.rb +1 -1
  6. data/stubs/default/app/forms/auth/login_form.rb +2 -8
  7. data/stubs/default/app/forms/update_profile_information_form.rb +1 -1
  8. data/stubs/default/app/models/auth.rb +57 -0
  9. data/stubs/default/app/models/current.rb +1 -1
  10. data/stubs/default/app/validators/current_password_validator.rb +1 -1
  11. data/stubs/default/app/views/layouts/mailer.html.erb +367 -372
  12. data/stubs/default/app/views/layouts/mailer.text.erb +1 -4
  13. data/stubs/default/app/views/user_mailer/reset_password.html.erb +21 -26
  14. data/stubs/default/test/factories/users.rb +7 -0
  15. data/stubs/default/test/integration/auth/authentication_test.rb +43 -0
  16. data/stubs/default/test/integration/auth/password_reset_test.rb +41 -0
  17. data/stubs/default/test/integration/auth/registration_test.rb +21 -0
  18. data/stubs/default/test/integration/password_update_test.rb +28 -0
  19. data/stubs/default/test/integration/profile_test.rb +51 -0
  20. data/stubs/default/test/test_helper.rb +38 -0
  21. data/stubs/hotwire/app/components/dropdown_component.html.erb +17 -18
  22. data/stubs/hotwire/app/components/modal_component.html.erb +55 -59
  23. data/stubs/hotwire/app/controllers/application_controller.rb +1 -0
  24. data/stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb +10 -7
  25. data/stubs/hotwire/app/controllers/auth/new_password_controller.rb +3 -1
  26. data/stubs/hotwire/app/controllers/auth/password_reset_link_controller.rb +3 -1
  27. data/stubs/hotwire/app/controllers/auth/registered_user_controller.rb +4 -2
  28. data/stubs/hotwire/app/controllers/concerns/authenticate.rb +5 -20
  29. data/stubs/hotwire/app/controllers/concerns/redirect_if_authenticated.rb +19 -0
  30. data/stubs/hotwire/app/controllers/concerns/set_current_auth.rb +9 -0
  31. data/stubs/hotwire/app/controllers/password_controller.rb +1 -1
  32. data/stubs/hotwire/app/controllers/profile_controller.rb +6 -4
  33. data/stubs/hotwire/app/controllers/welcome_controller.rb +1 -1
  34. data/stubs/hotwire/app/javascript/application.js +3 -3
  35. data/stubs/hotwire/app/views/auth/forgot_password.html.erb +12 -17
  36. data/stubs/hotwire/app/views/auth/login.html.erb +0 -9
  37. data/stubs/hotwire/app/views/auth/register.html.erb +0 -13
  38. data/stubs/hotwire/app/views/auth/reset_password.html.erb +0 -7
  39. data/stubs/hotwire/app/views/dashboard/index.html.erb +9 -10
  40. data/stubs/hotwire/app/views/layouts/_navigation.html.erb +77 -87
  41. data/stubs/hotwire/app/views/layouts/application.html.erb +0 -9
  42. data/stubs/hotwire/app/views/layouts/guest.html.erb +0 -6
  43. data/stubs/hotwire/app/views/profile/edit.html.erb +19 -22
  44. data/stubs/hotwire/app/views/profile/partials/_delete_user_form.html.erb +32 -42
  45. data/stubs/hotwire/app/views/profile/partials/_update_password_form.html.erb +42 -55
  46. data/stubs/hotwire/app/views/profile/partials/_update_profile_information_form.html.erb +36 -46
  47. data/stubs/hotwire/app/views/welcome/index.html.erb +34 -46
  48. data/stubs/hotwire/config/tailwind.config.js +2 -2
  49. data/stubs/inertia-common/app/controllers/application_controller.rb +1 -0
  50. data/stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb +10 -7
  51. data/stubs/inertia-common/app/controllers/auth/new_password_controller.rb +3 -1
  52. data/stubs/inertia-common/app/controllers/auth/password_reset_link_controller.rb +3 -1
  53. data/stubs/inertia-common/app/controllers/auth/registered_user_controller.rb +4 -2
  54. data/stubs/inertia-common/app/controllers/concerns/authenticate.rb +5 -20
  55. data/stubs/inertia-common/app/controllers/concerns/handle_inertia_requests.rb +1 -1
  56. data/stubs/inertia-common/app/controllers/concerns/redirect_if_authenticated.rb +19 -0
  57. data/stubs/inertia-common/app/controllers/concerns/set_current_auth.rb +9 -0
  58. data/stubs/inertia-common/app/controllers/password_controller.rb +1 -1
  59. data/stubs/inertia-common/app/controllers/profile_controller.rb +5 -3
  60. data/stubs/inertia-common/app/controllers/welcome_controller.rb +1 -1
  61. data/stubs/inertia-common/test/integration/password_update_test.rb +28 -0
  62. data/stubs/inertia-common/test/integration/profile_test.rb +51 -0
  63. data/stubs/inertia-react-ts/app/javascript/Components/ApplicationLogo.tsx +13 -9
  64. data/stubs/inertia-react-ts/app/javascript/Components/Checkbox.tsx +15 -12
  65. data/stubs/inertia-react-ts/app/javascript/Components/DangerButton.tsx +20 -15
  66. data/stubs/inertia-react-ts/app/javascript/Components/Dropdown.tsx +119 -87
  67. data/stubs/inertia-react-ts/app/javascript/Components/InputError.tsx +14 -7
  68. data/stubs/inertia-react-ts/app/javascript/Components/InputLabel.tsx +18 -7
  69. data/stubs/inertia-react-ts/app/javascript/Components/Modal.tsx +60 -60
  70. data/stubs/inertia-react-ts/app/javascript/Components/NavLink.tsx +21 -16
  71. data/stubs/inertia-react-ts/app/javascript/Components/PrimaryButton.tsx +20 -15
  72. data/stubs/inertia-react-ts/app/javascript/Components/ResponsiveNavLink.tsx +19 -14
  73. data/stubs/inertia-react-ts/app/javascript/Components/SecondaryButton.tsx +22 -16
  74. data/stubs/inertia-react-ts/app/javascript/Components/TextInput.tsx +35 -24
  75. data/stubs/inertia-react-ts/app/javascript/Layouts/AuthenticatedLayout.tsx +157 -117
  76. data/stubs/inertia-react-ts/app/javascript/Layouts/GuestLayout.tsx +15 -15
  77. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx +52 -49
  78. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Login.tsx +90 -82
  79. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Register.tsx +118 -115
  80. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ResetPassword.tsx +63 -60
  81. data/stubs/inertia-react-ts/app/javascript/Pages/Dashboard.tsx +23 -17
  82. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Edit.tsx +31 -27
  83. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/DeleteUserForm.tsx +109 -99
  84. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/UpdatePasswordForm.tsx +121 -113
  85. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/UpdateProfileInformationForm.tsx +76 -69
  86. data/stubs/inertia-react-ts/app/javascript/Pages/Welcome.tsx +87 -63
  87. data/stubs/inertia-react-ts/app/javascript/entrypoints/application.tsx +32 -25
  88. data/stubs/inertia-react-ts/app/views/layouts/application.html.erb +0 -4
  89. data/stubs/inertia-react-ts/config/tailwind.config.js +2 -2
  90. data/stubs/inertia-react-ts/vite.config.ts +2 -5
  91. data/stubs/inertia-vue-ts/app/javascript/Components/ApplicationLogo.vue +10 -6
  92. data/stubs/inertia-vue-ts/app/javascript/Components/Checkbox.vue +18 -18
  93. data/stubs/inertia-vue-ts/app/javascript/Components/DangerButton.vue +5 -5
  94. data/stubs/inertia-vue-ts/app/javascript/Components/Dropdown.vue +60 -57
  95. data/stubs/inertia-vue-ts/app/javascript/Components/DropdownLink.vue +9 -9
  96. data/stubs/inertia-vue-ts/app/javascript/Components/InputError.vue +7 -7
  97. data/stubs/inertia-vue-ts/app/javascript/Components/InputLabel.vue +6 -6
  98. data/stubs/inertia-vue-ts/app/javascript/Components/Modal.vue +84 -74
  99. data/stubs/inertia-vue-ts/app/javascript/Components/NavLink.vue +12 -12
  100. data/stubs/inertia-vue-ts/app/javascript/Components/PrimaryButton.vue +5 -5
  101. data/stubs/inertia-vue-ts/app/javascript/Components/ResponsiveNavLink.vue +12 -12
  102. data/stubs/inertia-vue-ts/app/javascript/Components/SecondaryButton.vue +13 -13
  103. data/stubs/inertia-vue-ts/app/javascript/Components/TextInput.vue +13 -13
  104. data/stubs/inertia-vue-ts/app/javascript/Layouts/AuthenticatedLayout.vue +168 -136
  105. data/stubs/inertia-vue-ts/app/javascript/Layouts/GuestLayout.vue +15 -13
  106. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ForgotPassword.vue +56 -49
  107. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Login.vue +78 -72
  108. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Register.vue +101 -97
  109. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ResetPassword.vue +71 -68
  110. data/stubs/inertia-vue-ts/app/javascript/Pages/Dashboard.vue +22 -14
  111. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Edit.vue +34 -30
  112. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/DeleteUserForm.vue +87 -83
  113. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/UpdatePasswordForm.vue +105 -98
  114. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/UpdateProfileInformationForm.vue +69 -59
  115. data/stubs/inertia-vue-ts/app/javascript/Pages/Welcome.vue +74 -47
  116. data/stubs/inertia-vue-ts/app/views/layouts/application.html.erb +0 -4
  117. data/stubs/inertia-vue-ts/config/tailwind.config.js +2 -2
  118. data/stubs/inertia-vue-ts/vite.config.ts +2 -5
  119. metadata +18 -6
  120. data/stubs/hotwire/bin/vite +0 -27
  121. data/stubs/inertia-common/Procfile.dev +0 -3
  122. /data/stubs/{hotwire → default}/Procfile.dev +0 -0
  123. /data/stubs/hotwire/app/javascript/{alpinejs.js → alpinejs.stub} +0 -0
@@ -1,18 +1,24 @@
1
- import { ButtonHTMLAttributes } from 'react';
1
+ import { ButtonHTMLAttributes } from 'react'
2
2
 
3
- export default function SecondaryButton({ type = 'button', className = '', disabled, children, ...props }: ButtonHTMLAttributes<HTMLButtonElement>) {
4
- return (
5
- <button
6
- {...props}
7
- type={type}
8
- className={
9
- `inline-flex items-center px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-500 rounded-md font-semibold text-xs text-gray-700 dark:text-gray-300 uppercase tracking-widest shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 disabled:opacity-25 transition ease-in-out duration-150 ${
10
- disabled && 'opacity-25'
11
- } ` + className
12
- }
13
- disabled={disabled}
14
- >
15
- {children}
16
- </button>
17
- );
3
+ export default function SecondaryButton({
4
+ type = 'button',
5
+ className = '',
6
+ disabled,
7
+ children,
8
+ ...props
9
+ }: ButtonHTMLAttributes<HTMLButtonElement>) {
10
+ return (
11
+ <button
12
+ {...props}
13
+ type={type}
14
+ className={
15
+ `inline-flex items-center px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-500 rounded-md font-semibold text-xs text-gray-700 dark:text-gray-300 uppercase tracking-widest shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 disabled:opacity-25 transition ease-in-out duration-150 ${
16
+ disabled && 'opacity-25'
17
+ } ` + className
18
+ }
19
+ disabled={disabled}
20
+ >
21
+ {children}
22
+ </button>
23
+ )
18
24
  }
@@ -1,30 +1,41 @@
1
- import { forwardRef, useEffect, useImperativeHandle, useRef, InputHTMLAttributes } from 'react';
1
+ import {
2
+ forwardRef,
3
+ useEffect,
4
+ useImperativeHandle,
5
+ useRef,
6
+ InputHTMLAttributes,
7
+ } from 'react'
2
8
 
3
9
  export default forwardRef(function TextInput(
4
- { type = 'text', className = '', isFocused = false, ...props }: InputHTMLAttributes<HTMLInputElement> & { isFocused?: boolean },
5
- ref
10
+ {
11
+ type = 'text',
12
+ className = '',
13
+ isFocused = false,
14
+ ...props
15
+ }: InputHTMLAttributes<HTMLInputElement> & { isFocused?: boolean },
16
+ ref,
6
17
  ) {
7
- const localRef = useRef<HTMLInputElement>(null);
18
+ const localRef = useRef<HTMLInputElement>(null)
8
19
 
9
- useImperativeHandle(ref, () => ({
10
- focus: () => localRef.current?.focus(),
11
- }));
20
+ useImperativeHandle(ref, () => ({
21
+ focus: () => localRef.current?.focus(),
22
+ }))
12
23
 
13
- useEffect(() => {
14
- if (isFocused) {
15
- localRef.current?.focus();
16
- }
17
- }, []);
24
+ useEffect(() => {
25
+ if (isFocused) {
26
+ localRef.current?.focus()
27
+ }
28
+ }, [])
18
29
 
19
- return (
20
- <input
21
- {...props}
22
- type={type}
23
- className={
24
- 'border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm ' +
25
- className
26
- }
27
- ref={localRef}
28
- />
29
- );
30
- });
30
+ return (
31
+ <input
32
+ {...props}
33
+ type={type}
34
+ className={
35
+ 'border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm ' +
36
+ className
37
+ }
38
+ ref={localRef}
39
+ />
40
+ )
41
+ })
@@ -1,131 +1,171 @@
1
- import { useState, PropsWithChildren, ReactNode } from 'react';
2
- import ApplicationLogo from '@/Components/ApplicationLogo';
3
- import Dropdown from '@/Components/Dropdown';
4
- import NavLink from '@/Components/NavLink';
5
- import ResponsiveNavLink from '@/Components/ResponsiveNavLink';
6
- import { Link } from '@inertiajs/react';
7
- import { User } from '@/types';
8
- import { dashboard_path, logout_path, profile_edit_path } from '@/routes';
1
+ import { useState, PropsWithChildren, ReactNode } from 'react'
2
+ import ApplicationLogo from '@/Components/ApplicationLogo'
3
+ import Dropdown from '@/Components/Dropdown'
4
+ import NavLink from '@/Components/NavLink'
5
+ import ResponsiveNavLink from '@/Components/ResponsiveNavLink'
6
+ import { Link } from '@inertiajs/react'
7
+ import { User } from '@/types'
8
+ import { dashboard_path, logout_path, profile_edit_path } from '@/routes'
9
9
 
10
- export default function Authenticated({ user, header, children }: PropsWithChildren<{ user: User, header?: ReactNode }>) {
11
- const [showingNavigationDropdown, setShowingNavigationDropdown] = useState(false);
10
+ export default function Authenticated({
11
+ user,
12
+ header,
13
+ children,
14
+ }: PropsWithChildren<{ user: User; header?: ReactNode }>) {
15
+ const [showingNavigationDropdown, setShowingNavigationDropdown] =
16
+ useState(false)
12
17
 
13
- const { pathname = '' } = typeof window !== 'undefined' ? window.location : {};
18
+ const { pathname = '' } = typeof window !== 'undefined' ? window.location : {}
14
19
 
15
- return (
16
- <div className="min-h-screen bg-gray-100">
17
- <nav className="bg-white border-b border-gray-100">
18
- <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
19
- <div className="flex justify-between h-16">
20
- <div className="flex">
21
- <div className="shrink-0 flex items-center">
22
- <Link href="/">
23
- <ApplicationLogo className="block h-9 w-auto fill-current text-gray-800" />
24
- </Link>
25
- </div>
20
+ return (
21
+ <div className="min-h-screen bg-gray-100">
22
+ <nav className="bg-white border-b border-gray-100">
23
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
24
+ <div className="flex justify-between h-16">
25
+ <div className="flex">
26
+ <div className="shrink-0 flex items-center">
27
+ <Link href="/">
28
+ <ApplicationLogo className="block h-9 w-auto fill-current text-gray-800" />
29
+ </Link>
30
+ </div>
26
31
 
27
- <div className="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
28
- <NavLink href={dashboard_path()} active={pathname.match(/dashboard/) != null}>
29
- Dashboard
30
- </NavLink>
31
- </div>
32
- </div>
32
+ <div className="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
33
+ <NavLink
34
+ href={dashboard_path()}
35
+ active={pathname.match(/dashboard/) != null}
36
+ >
37
+ Dashboard
38
+ </NavLink>
39
+ </div>
40
+ </div>
33
41
 
34
- <div className="hidden sm:flex sm:items-center sm:ms-6">
35
- <div className="ms-3 relative">
36
- <Dropdown>
37
- <Dropdown.Trigger>
38
- <span className="inline-flex rounded-md">
39
- <button
40
- type="button"
41
- className="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150"
42
- >
43
- {user.name}
42
+ <div className="hidden sm:flex sm:items-center sm:ms-6">
43
+ <div className="ms-3 relative">
44
+ <Dropdown>
45
+ <Dropdown.Trigger>
46
+ <span className="inline-flex rounded-md">
47
+ <button
48
+ type="button"
49
+ className="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150"
50
+ >
51
+ {user.name}
44
52
 
45
- <svg
46
- className="ms-2 -me-0.5 h-4 w-4"
47
- xmlns="http://www.w3.org/2000/svg"
48
- viewBox="0 0 20 20"
49
- fill="currentColor"
50
- >
51
- <path
52
- fillRule="evenodd"
53
- d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
54
- clipRule="evenodd"
55
- />
56
- </svg>
57
- </button>
58
- </span>
59
- </Dropdown.Trigger>
53
+ <svg
54
+ className="ms-2 -me-0.5 h-4 w-4"
55
+ xmlns="http://www.w3.org/2000/svg"
56
+ viewBox="0 0 20 20"
57
+ fill="currentColor"
58
+ >
59
+ <path
60
+ fillRule="evenodd"
61
+ d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
62
+ clipRule="evenodd"
63
+ />
64
+ </svg>
65
+ </button>
66
+ </span>
67
+ </Dropdown.Trigger>
60
68
 
61
- <Dropdown.Content>
62
- <Dropdown.Link href={profile_edit_path()}>Profile</Dropdown.Link>
63
- <Dropdown.Link href={logout_path()} method="post" as="button">
64
- Log Out
65
- </Dropdown.Link>
66
- </Dropdown.Content>
67
- </Dropdown>
68
- </div>
69
- </div>
69
+ <Dropdown.Content>
70
+ <Dropdown.Link href={profile_edit_path()}>
71
+ Profile
72
+ </Dropdown.Link>
73
+ <Dropdown.Link
74
+ href={logout_path()}
75
+ method="post"
76
+ as="button"
77
+ >
78
+ Log Out
79
+ </Dropdown.Link>
80
+ </Dropdown.Content>
81
+ </Dropdown>
82
+ </div>
83
+ </div>
70
84
 
71
- <div className="-me-2 flex items-center sm:hidden">
72
- <button
73
- onClick={() => setShowingNavigationDropdown((previousState) => !previousState)}
74
- className="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out"
75
- >
76
- <svg className="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
77
- <path
78
- className={!showingNavigationDropdown ? 'inline-flex' : 'hidden'}
79
- strokeLinecap="round"
80
- strokeLinejoin="round"
81
- strokeWidth="2"
82
- d="M4 6h16M4 12h16M4 18h16"
83
- />
84
- <path
85
- className={showingNavigationDropdown ? 'inline-flex' : 'hidden'}
86
- strokeLinecap="round"
87
- strokeLinejoin="round"
88
- strokeWidth="2"
89
- d="M6 18L18 6M6 6l12 12"
90
- />
91
- </svg>
92
- </button>
93
- </div>
94
- </div>
95
- </div>
85
+ <div className="-me-2 flex items-center sm:hidden">
86
+ <button
87
+ onClick={() =>
88
+ setShowingNavigationDropdown(
89
+ (previousState) => !previousState,
90
+ )
91
+ }
92
+ className="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out"
93
+ >
94
+ <svg
95
+ className="h-6 w-6"
96
+ stroke="currentColor"
97
+ fill="none"
98
+ viewBox="0 0 24 24"
99
+ >
100
+ <path
101
+ className={
102
+ !showingNavigationDropdown ? 'inline-flex' : 'hidden'
103
+ }
104
+ strokeLinecap="round"
105
+ strokeLinejoin="round"
106
+ strokeWidth="2"
107
+ d="M4 6h16M4 12h16M4 18h16"
108
+ />
109
+ <path
110
+ className={
111
+ showingNavigationDropdown ? 'inline-flex' : 'hidden'
112
+ }
113
+ strokeLinecap="round"
114
+ strokeLinejoin="round"
115
+ strokeWidth="2"
116
+ d="M6 18L18 6M6 6l12 12"
117
+ />
118
+ </svg>
119
+ </button>
120
+ </div>
121
+ </div>
122
+ </div>
96
123
 
97
- <div className={(showingNavigationDropdown ? 'block' : 'hidden') + ' sm:hidden'}>
98
- <div className="pt-2 pb-3 space-y-1">
99
- <ResponsiveNavLink href={dashboard_path()} active={pathname.match(/dashboard/) != null}>
100
- Dashboard
101
- </ResponsiveNavLink>
102
- </div>
124
+ <div
125
+ className={
126
+ (showingNavigationDropdown ? 'block' : 'hidden') + ' sm:hidden'
127
+ }
128
+ >
129
+ <div className="pt-2 pb-3 space-y-1">
130
+ <ResponsiveNavLink
131
+ href={dashboard_path()}
132
+ active={pathname.match(/dashboard/) != null}
133
+ >
134
+ Dashboard
135
+ </ResponsiveNavLink>
136
+ </div>
103
137
 
104
- <div className="pt-4 pb-1 border-t border-gray-200">
105
- <div className="px-4">
106
- <div className="font-medium text-base text-gray-800">
107
- {user.name}
108
- </div>
109
- <div className="font-medium text-sm text-gray-500">{user.email}</div>
110
- </div>
138
+ <div className="pt-4 pb-1 border-t border-gray-200">
139
+ <div className="px-4">
140
+ <div className="font-medium text-base text-gray-800">
141
+ {user.name}
142
+ </div>
143
+ <div className="font-medium text-sm text-gray-500">
144
+ {user.email}
145
+ </div>
146
+ </div>
111
147
 
112
- <div className="mt-3 space-y-1">
113
- <ResponsiveNavLink href={profile_edit_path()}>Profile</ResponsiveNavLink>
114
- <ResponsiveNavLink method="post" href={logout_path()} as="button">
115
- Log Out
116
- </ResponsiveNavLink>
117
- </div>
118
- </div>
119
- </div>
120
- </nav>
148
+ <div className="mt-3 space-y-1">
149
+ <ResponsiveNavLink href={profile_edit_path()}>
150
+ Profile
151
+ </ResponsiveNavLink>
152
+ <ResponsiveNavLink method="post" href={logout_path()} as="button">
153
+ Log Out
154
+ </ResponsiveNavLink>
155
+ </div>
156
+ </div>
157
+ </div>
158
+ </nav>
121
159
 
122
- {header && (
123
- <header className="bg-white shadow">
124
- <div className="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">{header}</div>
125
- </header>
126
- )}
160
+ {header && (
161
+ <header className="bg-white shadow">
162
+ <div className="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
163
+ {header}
164
+ </div>
165
+ </header>
166
+ )}
127
167
 
128
- <main>{children}</main>
129
- </div>
130
- );
168
+ <main>{children}</main>
169
+ </div>
170
+ )
131
171
  }
@@ -1,19 +1,19 @@
1
- import ApplicationLogo from '@/Components/ApplicationLogo';
2
- import { Link } from '@inertiajs/react';
3
- import { PropsWithChildren } from 'react';
1
+ import ApplicationLogo from '@/Components/ApplicationLogo'
2
+ import { Link } from '@inertiajs/react'
3
+ import { PropsWithChildren } from 'react'
4
4
 
5
5
  export default function Guest({ children }: PropsWithChildren) {
6
- return (
7
- <div className="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100">
8
- <div>
9
- <Link href="/">
10
- <ApplicationLogo className="w-20 h-20 fill-current text-gray-500" />
11
- </Link>
12
- </div>
6
+ return (
7
+ <div className="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100">
8
+ <div>
9
+ <Link href="/">
10
+ <ApplicationLogo className="w-20 h-20 fill-current text-gray-500" />
11
+ </Link>
12
+ </div>
13
13
 
14
- <div className="w-full sm:max-w-md mt-6 px-6 py-4 bg-white shadow-md overflow-hidden sm:rounded-lg">
15
- {children}
16
- </div>
17
- </div>
18
- );
14
+ <div className="w-full sm:max-w-md mt-6 px-6 py-4 bg-white shadow-md overflow-hidden sm:rounded-lg">
15
+ {children}
16
+ </div>
17
+ </div>
18
+ )
19
19
  }
@@ -1,52 +1,55 @@
1
- import GuestLayout from '@/Layouts/GuestLayout';
2
- import InputError from '@/Components/InputError';
3
- import PrimaryButton from '@/Components/PrimaryButton';
4
- import TextInput from '@/Components/TextInput';
5
- import { Head, useForm } from '@inertiajs/react';
6
- import { FormEventHandler } from 'react';
7
- import { password_email_path } from '@/routes';
1
+ import GuestLayout from '@/Layouts/GuestLayout'
2
+ import InputError from '@/Components/InputError'
3
+ import PrimaryButton from '@/Components/PrimaryButton'
4
+ import TextInput from '@/Components/TextInput'
5
+ import { Head, useForm } from '@inertiajs/react'
6
+ import { FormEventHandler } from 'react'
7
+ import { password_email_path } from '@/routes'
8
8
 
9
9
  export default function ForgotPassword({ status }: { status?: string }) {
10
- const { data, setData, post, processing, errors } = useForm({
11
- email: '',
12
- });
13
-
14
- const submit: FormEventHandler = (e) => {
15
- e.preventDefault();
16
-
17
- post(password_email_path());
18
- };
19
-
20
- return (
21
- <GuestLayout>
22
- <Head title="Forgot Password" />
23
-
24
- <div className="mb-4 text-sm text-gray-600">
25
- Forgot your password? No problem. Just let us know your email address and we will email you a password
26
- reset link that will allow you to choose a new one.
27
- </div>
28
-
29
- {status && <div className="mb-4 font-medium text-sm text-green-600">{status}</div>}
30
-
31
- <form onSubmit={submit}>
32
- <TextInput
33
- id="email"
34
- type="email"
35
- name="email"
36
- value={data.email}
37
- className="mt-1 block w-full"
38
- isFocused={true}
39
- onChange={(e) => setData('email', e.target.value)}
40
- />
41
-
42
- <InputError message={errors.email} className="mt-2" />
43
-
44
- <div className="flex items-center justify-end mt-4">
45
- <PrimaryButton className="ms-4" disabled={processing}>
46
- Email Password Reset Link
47
- </PrimaryButton>
48
- </div>
49
- </form>
50
- </GuestLayout>
51
- );
10
+ const { data, setData, post, processing, errors } = useForm({
11
+ email: '',
12
+ })
13
+
14
+ const submit: FormEventHandler = (e) => {
15
+ e.preventDefault()
16
+
17
+ post(password_email_path())
18
+ }
19
+
20
+ return (
21
+ <GuestLayout>
22
+ <Head title="Forgot Password" />
23
+
24
+ <div className="mb-4 text-sm text-gray-600">
25
+ Forgot your password? No problem. Just let us know your email address
26
+ and we will email you a password reset link that will allow you to
27
+ choose a new one.
28
+ </div>
29
+
30
+ {status && (
31
+ <div className="mb-4 font-medium text-sm text-green-600">{status}</div>
32
+ )}
33
+
34
+ <form onSubmit={submit}>
35
+ <TextInput
36
+ id="email"
37
+ type="email"
38
+ name="email"
39
+ value={data.email}
40
+ className="mt-1 block w-full"
41
+ isFocused={true}
42
+ onChange={(e) => setData('email', e.target.value)}
43
+ />
44
+
45
+ <InputError message={errors.email} className="mt-2" />
46
+
47
+ <div className="flex items-center justify-end mt-4">
48
+ <PrimaryButton className="ms-4" disabled={processing}>
49
+ Email Password Reset Link
50
+ </PrimaryButton>
51
+ </div>
52
+ </form>
53
+ </GuestLayout>
54
+ )
52
55
  }