fix: settings inputs

This commit is contained in:
swve 2023-05-14 16:16:49 +00:00
parent 11f008dfe4
commit 0f4a154c8d
4 changed files with 115 additions and 25 deletions

View file

@ -21,7 +21,7 @@ function SettingsProfilePasswordsPage() {
{auth.isAuthenticated && (
<div>
<h1>Account Password</h1>
<h1 className='text-3xl font-bold'>Account Password</h1>
<br /><br />
<Formik
@ -35,13 +35,34 @@ function SettingsProfilePasswordsPage() {
}}
>
{({ isSubmitting }) => (
<Form>
Old Password <Field type="password" name="old_password" /><br />
New password <Field type="password" name="new_password" /><br />
<button type="submit" disabled={isSubmitting}>
<Form className="max-w-md">
<label className="block mb-2 font-bold" htmlFor="old_password">
Old Password
</label>
<Field
className="w-full px-4 py-2 mb-4 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
type="password"
name="old_password"
/>
<label className="block mb-2 font-bold" htmlFor="new_password">
New Password
</label>
<Field
className="w-full px-4 py-2 mb-4 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
type="password"
name="new_password"
/>
<button
type="submit"
disabled={isSubmitting}
className="px-6 py-3 text-white bg-black rounded-lg shadow-md hover:bg-black focus:outline-none focus:ring-2 focus:ring-blue-500"
>
Submit
</button>
</Form>
)}
</Formik>
</div>

View file

@ -12,7 +12,7 @@ function SettingsProfilePage() {
{auth.isAuthenticated && (
<div>
<h1>Profile Settings</h1>
<h1 className='text-3xl font-bold'>Profile Settings</h1>
<br /><br />
<Formik
@ -27,14 +27,44 @@ function SettingsProfilePage() {
}}
>
{({ isSubmitting }) => (
<Form>
Full name <Field type="textarea" name="full_name" /><br />
Email <Field type="email" name="email" /><br />
Bio <Field as="textarea" type="textarea" name="bio" /><br />
<button type="submit" disabled={isSubmitting}>
<Form className="max-w-md">
<label className="block mb-2 font-bold" htmlFor="full_name">
Full Name
</label>
<Field
className="w-full px-4 py-2 mb-4 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
type="textarea"
name="full_name"
/>
<label className="block mb-2 font-bold" htmlFor="email">
Email
</label>
<Field
className="w-full px-4 py-2 mb-4 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
type="email"
name="email"
/>
<label className="block mb-2 font-bold" htmlFor="bio">
Bio
</label>
<Field
as="textarea"
className="w-full px-4 py-2 mb-4 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
type="textarea"
name="bio"
/>
<button
type="submit"
disabled={isSubmitting}
className="px-6 py-3 text-white bg-black rounded-lg shadow-md hover:bg-black focus:outline-none focus:ring-2 focus:ring-blue-500"
>
Submit
</button>
</Form>
)}
</Formik>
</div>

View file

@ -37,7 +37,7 @@ function SettingsOrganizationGeneral(params: any) {
return (
<div>
<h1>Oganization Settings</h1>
<h1 className='text-3xl font-bold'>Oganization Settings</h1>
<br /><br />
{error && <p>Failed to load</p>}
{!org ? (
@ -56,14 +56,52 @@ function SettingsOrganizationGeneral(params: any) {
>
{({ isSubmitting }) => (
<Form>
Name <Field type="text" name="name" /><br />
Description <Field type="text" name="description" /><br />
Slug <Field disabled type="text" name="slug" /> <br />
Email <Field type="email" name="email" /><br />
<button type="submit" disabled={isSubmitting}>
<label className="block mb-2 font-bold" htmlFor="name">
Name
</label>
<Field
className="w-full px-4 py-2 mb-4 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
type="text"
name="name"
/>
<label className="block mb-2 font-bold" htmlFor="description">
Description
</label>
<Field
className="w-full px-4 py-2 mb-4 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
type="text"
name="description"
/>
<label className="block mb-2 font-bold" htmlFor="slug">
Slug
</label>
<Field
className="w-full px-4 py-2 mb-4 border rounded-lg bg-gray-200 cursor-not-allowed"
disabled
type="text"
name="slug"
/>
<label className="block mb-2 font-bold" htmlFor="email">
Email
</label>
<Field
className="w-full px-4 py-2 mb-4 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
type="email"
name="email"
/>
<button
type="submit"
disabled={isSubmitting}
className="px-6 py-3 text-white bg-black rounded-lg shadow-md hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-black"
>
Submit
</button>
</Form>
)}
</Formik>
)}

View file

@ -9,8 +9,9 @@ const nextConfig = {
reactStrictMode: false,
experimental: {
appDir : true,
swcFileReading: false,
},
swcMinify: true,
swcMinify: false,
compiler: {
styledComponents: true,
},