-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#151 button #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/#151 button #185
Changes from 12 commits
d22ee06
e2fedcc
c3ed4fa
c1e5b6a
59d77c4
8033cb3
cecdf67
ae69835
2d9fb44
7b8dc97
a956a56
e831166
f03fc37
6522d30
f1dcebe
d49a2cb
d06d933
3bb3ee7
bbcd006
7344308
0fd6f10
b0c18d0
c9d467a
825848e
bae6688
a1f5f6c
16ff554
30aa572
97b6d2c
74783f6
9cad109
38010e5
30f6191
df82848
2f41ccd
f607791
57ec970
f9bdb31
1b760d6
6642a44
b98633d
ca54379
4ba1beb
1565a62
1d2092a
2f22f6c
73bc6c7
36f413b
e1f82ca
b680e5c
9450b33
e248704
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,66 +65,72 @@ const Setpasswordpage = () => { | |
| return ( | ||
| <AuthCard> | ||
| {/* logo */} | ||
| <div className="pt-7 flex flex-col items-center gap-4"> | ||
| <div className="flex flex-col items-center gap-4"> | ||
| <div className="flex flex-col items-center gap-2"> | ||
| <p className="text-center text-2xl font-bold">Set your Password</p> | ||
| <p className="text-center"> | ||
| <p className="text-2xl font-bold">Set your Password</p> | ||
| <p className="text-center text-sm font-normal"> | ||
| We've sent the code to{" "} | ||
| <span className="underline mr-1">{username}</span> | ||
| check your email | ||
| <span className="underline text-sm font-normal"> | ||
| example@pixel.design | ||
| </span> | ||
| </p> | ||
| <p className="text-sm font-normal">check your email</p> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove hardcoded email and implement proper email masking. The email address is currently hardcoded and displayed in plain text, which has two issues:
Apply this diff to implement proper email masking: - <p className="text-center text-sm font-normal">
- We've sent the code to{" "}
- <span className="underline text-sm font-normal">
- example@pixel.design
- </span>
- </p>
+ <p className="text-center text-sm font-normal">
+ We've sent the code to{" "}
+ <span className="underline text-sm font-normal">
+ {username ? maskEmail(username) : ''}
+ </span>
+ </p>Add this utility function at the top of the file: const maskEmail = (email: string) => {
const [name, domain] = email.split('@');
return `${name[0]}${'*'.repeat(name.length - 2)}${name.slice(-1)}@${domain}`;
}; |
||
| </div> | ||
| </div> | ||
| {/* otp input */} | ||
| <form | ||
| className="w-full flex flex-col items-center gap-4" | ||
| className="w-full flex flex-col items-center " | ||
| onSubmit={handleSubmit(handleSubmitForm)} | ||
| > | ||
| <InputOTP | ||
| maxLength={6} | ||
| pattern={REGEXP_ONLY_DIGITS_AND_CHARS} | ||
| name={otpRegister.name} | ||
| onChange={(value: string) => { | ||
| setValue("otp", value); | ||
| }} | ||
| > | ||
| <InputOTPGroup> | ||
| <InputOTPSlot index={0} /> | ||
| <InputOTPSlot index={1} /> | ||
| <InputOTPSlot index={2} /> | ||
| <InputOTPSlot index={3} /> | ||
| <InputOTPSlot index={4} /> | ||
| <InputOTPSlot index={5} /> | ||
| </InputOTPGroup> | ||
| </InputOTP> | ||
| <span className="text-xs text-error-400">{errors.otp?.message}</span> | ||
| <div className="pb-4"> | ||
| <InputOTP | ||
| maxLength={6} | ||
| pattern={REGEXP_ONLY_DIGITS_AND_CHARS} | ||
| name={otpRegister.name} | ||
| onChange={(value: string) => { | ||
| setValue("otp", value); | ||
| }} | ||
| > | ||
| <InputOTPGroup> | ||
| <InputOTPSlot index={0} /> | ||
| <InputOTPSlot index={1} /> | ||
| <InputOTPSlot index={2} /> | ||
| <InputOTPSlot index={3} /> | ||
| <InputOTPSlot index={4} /> | ||
| <InputOTPSlot index={5} /> | ||
| </InputOTPGroup> | ||
| </InputOTP> | ||
| <span className="text-xs text-error-400">{errors.otp?.message}</span> | ||
| </div> | ||
|
|
||
| {/* input */} | ||
| <Input | ||
| label="Password" | ||
| type="password" | ||
| className="font-normal text-xs text-gray-500" | ||
| placeholder="********" | ||
| {...register("newPassword")} | ||
| error={errors.newPassword?.message} | ||
| /> | ||
| <Input | ||
| label="Confirm Password" | ||
| type="password" | ||
| className="font-normal text-xs text-gray-500" | ||
| placeholder="********" | ||
| {...register("confirmPassword")} | ||
| error={errors.confirmPassword?.message} | ||
| /> | ||
| {/* button reset */} | ||
| <div className="pb-7 w-full"> | ||
| <Button | ||
| isLoading={mutation.isPending} | ||
| className="w-full text-lg font-bold bg-primary-600 hover:bg-primary-500" | ||
| variant="secondary" | ||
| > | ||
| Reset | ||
| </Button> | ||
| <div className="w-full flex flex-col gap-5"> | ||
| <Input | ||
| label="Password" | ||
| type="password" | ||
| className="font-normal text-xs text-gray-500" | ||
| placeholder="********" | ||
| {...register("newPassword")} | ||
| error={errors.newPassword?.message} | ||
| /> | ||
| <Input | ||
| label="Confirm Password" | ||
| type="password" | ||
| className="font-normal text-xs text-gray-500" | ||
| placeholder="********" | ||
| {...register("confirmPassword")} | ||
| error={errors.confirmPassword?.message} | ||
| /> | ||
| {/* button reset */} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Implement password strength validation. The password fields lack visual feedback for password strength requirements. Add password strength indicators and requirements:
Example implementation: const validatePassword = (password: string) => {
const requirements = [
{ regex: /.{8,}/, message: "At least 8 characters" },
{ regex: /[0-9]/, message: "At least 1 number" },
{ regex: /[a-z]/, message: "At least 1 lowercase letter" },
{ regex: /[A-Z]/, message: "At least 1 uppercase letter" },
{ regex: /[^A-Za-z0-9]/, message: "At least 1 special character" }
];
return requirements.map(req => ({
met: req.regex.test(password),
message: req.message
}));
}; |
||
| <div className="pb-7 w-full"> | ||
| <Button | ||
| isLoading={mutation.isPending} | ||
| className="w-full text-sm font-bold bg-primary text-foreground" | ||
| variant="primary" | ||
| > | ||
| Reset | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| </form> | ||
| </AuthCard> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,9 +2,9 @@ | |||||
| "use client"; | ||||||
| import { Button } from "@repo/ui/components/button"; | ||||||
| import { | ||||||
| InputOTP, | ||||||
| InputOTPGroup, | ||||||
| InputOTPSlot, | ||||||
| InputOTP, | ||||||
| InputOTPGroup, | ||||||
| InputOTPSlot, | ||||||
| } from "@repo/ui/components/input-otp"; | ||||||
| import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp"; | ||||||
|
|
||||||
|
|
@@ -96,15 +96,15 @@ export const SignupOtpForm = (props: SignupOtpFormProps) => { | |||||
| <div className="pb-7 w-full"> | ||||||
| <Button | ||||||
| className="w-full text-lg font-bold bg-primary-600 hover:bg-primary-500" | ||||||
| variant="secondary" | ||||||
| variant="primary" | ||||||
| isLoading={muutation.isPending} | ||||||
| > | ||||||
| Verify | ||||||
| </Button> | ||||||
| </div> | ||||||
| <div className="pb-7"> | ||||||
| <p> | ||||||
| didnt recieved code yet? <Countdown date={Date.now() + 120000} /> | ||||||
| didnt recieveddqqdqdqdqdqdqdqdqdq code yet? <Countdown date={Date.now() + 120000} /> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the typo in the text. There's a typo in the text that needs to be corrected. - didnt recieveddqqdqdqdqdqdqdqdqdq code yet?
+ didn't receive code yet?📝 Committable suggestion
Suggested change
|
||||||
| </p> | ||||||
| </div> | ||||||
| </form> | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused import
The
AttachmentLandingcomponent is imported but not used in this file.-import { AttachmentLanding } from "@repo/ui/components/attachment/attachmentLanding/attachmentLanding";