forked from sinamics/ztnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sinamics#479 from sinamics/auth-layout-take2
Improved public auth pages layout
- Loading branch information
Showing
25 changed files
with
486 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { useState } from "react"; | ||
import { api } from "~/utils/api"; | ||
import cn from "classnames"; | ||
import { toast } from "react-hot-toast"; | ||
import { useTrpcApiErrorHandler } from "~/hooks/useTrpcApiHandler"; | ||
import FormInput from "./formInput"; | ||
import FormSubmitButtons from "./formSubmitButton"; | ||
|
||
interface FormData { | ||
email: string; | ||
|
@@ -44,43 +45,30 @@ const ForgotPasswordForm: React.FC = () => { | |
}); | ||
}; | ||
return ( | ||
<div className="z-10 flex justify-center self-center"> | ||
<div className="w-100 mx-auto rounded-2xl border p-12"> | ||
<div className="mb-4"> | ||
<h3 className="text-2xl font-semibold">Forgot Password </h3> | ||
<p className="text-gray-500"> | ||
We will send you a reset link if the email exist | ||
</p> | ||
</div> | ||
<form className="space-y-5" onSubmit={submitHandler}> | ||
<div className="space-y-2"> | ||
<label className="text-sm font-medium tracking-wide">Email</label> | ||
<input | ||
className="input w-full rounded-lg border border-gray-300 px-4 py-2 text-base focus:border-primary/25 focus:outline-none" | ||
value={formData.email} | ||
onChange={handleChange} | ||
type="email" | ||
name="email" | ||
placeholder="[email protected]" | ||
/> | ||
</div> | ||
<div className="pt-5"> | ||
<button | ||
type="submit" | ||
className={cn( | ||
"btn btn-block btn-primary cursor-pointer rounded-full p-3 font-semibold tracking-wide shadow-lg", | ||
)} | ||
> | ||
{loading ? <span className="loading loading-spinner"></span> : null} | ||
Send Email | ||
</button> | ||
</div> | ||
</form> | ||
<div className="pt-5 text-center text-xs text-gray-400"> | ||
<span>Copyright © {new Date().getFullYear()} Kodea Solutions</span> | ||
</div> | ||
<form className="space-y-5" onSubmit={submitHandler}> | ||
<FormInput | ||
label="Email" | ||
name="email" | ||
type="text" | ||
value={formData.email} | ||
onChange={handleChange} | ||
placeholder="[email protected]" | ||
icon={ | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 16 16" | ||
fill="currentColor" | ||
className="h-4 w-4 opacity-70" | ||
> | ||
<path d="M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z" /> | ||
<path d="M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z" /> | ||
</svg> | ||
} | ||
/> | ||
<div className="pt-5"> | ||
<FormSubmitButtons loading={loading} title="Send Email" /> | ||
</div> | ||
</div> | ||
</form> | ||
); | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import cn from "classnames"; | ||
|
||
interface SubmitButtonProps { | ||
loading: boolean; | ||
title: string; | ||
} | ||
|
||
const FormSubmitButtons: React.FC<SubmitButtonProps> = ({ loading, title }) => ( | ||
<button | ||
type="submit" | ||
className={cn( | ||
"btn btn-block btn-primary border cursor-pointer font-semibold tracking-wide shadow-lg", | ||
)} | ||
> | ||
{loading ? <span className="loading loading-spinner"></span> : null} | ||
{title} | ||
</button> | ||
); | ||
|
||
export default FormSubmitButtons; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { useState } from "react"; | ||
import { api } from "~/utils/api"; | ||
import cn from "classnames"; | ||
import { toast } from "react-hot-toast"; | ||
import { useTrpcApiErrorHandler } from "~/hooks/useTrpcApiHandler"; | ||
import FormInput from "./formInput"; | ||
import FormSubmitButtons from "./formSubmitButton"; | ||
|
||
interface FormData { | ||
email: string; | ||
|
@@ -33,7 +34,7 @@ const MfaRecoveryForm: React.FC = () => { | |
onSuccess: () => { | ||
setLoading(false); | ||
setFormData({ email: "" }); | ||
toast.success("Password reset link sent to your email if the account exist!", { | ||
toast.success("2FA reset procedure sent to your email if the account exist!", { | ||
duration: 10000, | ||
}); | ||
}, | ||
|
@@ -44,43 +45,31 @@ const MfaRecoveryForm: React.FC = () => { | |
}); | ||
}; | ||
return ( | ||
<div className="z-10 flex justify-center self-center"> | ||
<div className="w-100 mx-auto rounded-2xl border border-primary p-12"> | ||
<div className="mb-4"> | ||
<h3 className="text-2xl font-semibold">2FA Recovery</h3> | ||
<p className="text-gray-500"> | ||
We will send you instructions on how to recover your account | ||
</p> | ||
</div> | ||
<form className="space-y-5" onSubmit={submitHandler}> | ||
<div className="space-y-2"> | ||
<label className="text-sm font-medium tracking-wide">Email</label> | ||
<input | ||
className="input w-full rounded-lg border border-gray-300 px-4 py-2 text-base focus:border-primary/25 focus:outline-none" | ||
value={formData.email} | ||
onChange={handleChange} | ||
type="email" | ||
name="email" | ||
placeholder="[email protected]" | ||
/> | ||
</div> | ||
<div className="pt-5"> | ||
<button | ||
type="submit" | ||
className={cn( | ||
"btn btn-block btn-primary cursor-pointer rounded-full p-3 font-semibold tracking-wide shadow-lg", | ||
)} | ||
> | ||
{loading ? <span className="loading loading-spinner"></span> : null} | ||
Send Email | ||
</button> | ||
</div> | ||
</form> | ||
<div className="pt-5 text-center text-xs text-gray-400"> | ||
<span>Copyright © {new Date().getFullYear()} Kodea Solutions</span> | ||
</div> | ||
<form className="space-y-5" onSubmit={submitHandler}> | ||
<FormInput | ||
label="Email" | ||
name="email" | ||
type="email" | ||
value={formData.email} | ||
onChange={handleChange} | ||
placeholder="[email protected]" | ||
icon={ | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 16 16" | ||
fill="currentColor" | ||
className="h-4 w-4 opacity-70" | ||
> | ||
<path d="M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z" /> | ||
<path d="M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z" /> | ||
</svg> | ||
} | ||
/> | ||
|
||
<div className="pt-5"> | ||
<FormSubmitButtons loading={loading} title="Send Email" /> | ||
</div> | ||
</div> | ||
</form> | ||
); | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.