Skip to content

Commit 3f51448

Browse files
authored
Merge pull request #1025 from credebl/fix/forget-password-and-signup
Fixed theme for forget password reset page and signin
2 parents 9abf353 + 48a6d9e commit 3f51448

File tree

4 files changed

+55
-33
lines changed

4 files changed

+55
-33
lines changed

nextjs/src/app/reset-password/PasswordSuggestionBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const PasswordSuggestionBox = ({
7171

7272
return (
7373
<div className="mt-4 ml-6">
74-
<div className="absolute z-10 flex justify-end rounded-sm bg-white px-6 py-4 text-xs shadow-lg shadow-gray-500/50">
74+
<div className="absolute z-10 flex justify-end rounded-sm bg-popover px-6 py-4 text-xs shadow-lg shadow-gray-500/50">
7575
{show === true ? (
7676
<>
7777
{restrictedChar ? (

nextjs/src/app/reset-password/ResetPassword.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ const ResetPassword = (): JSX.Element => {
120120
</div>
121121
<div className="flex grow-1 p-10">
122122
<div className="flex w-full justify-center">
123-
<Card className="bg-card border-border relative z-10 w-full max-w-lg overflow-hidden rounded-xl border p-8 p-10 shadow-xl transition-transform duration-300 lg:max-w-md">
123+
<Card className="relative z-10 w-full max-w-lg overflow-hidden rounded-xl border p-8 shadow-xl transition-transform duration-300 lg:max-w-md">
124124
<div className="flex w-full flex-col gap-4 lg:mt-8">
125125
<div className="text-custom-900 dark:text-custom-100 font-inter flex justify-center text-center text-3xl leading-10 font-bold">
126126
Reset Password
127127
</div>
128-
<div className="font-inter h-5.061 text-secondary-foreground flex w-84 w-full flex-shrink-0 flex-col items-center justify-center text-base leading-5 font-medium">
128+
<div className="font-inter h-5.061 text-muted-foreground flex w-full flex-shrink-0 flex-col items-center justify-center text-base leading-5 font-medium">
129129
Please set new password
130130
</div>
131131
</div>
@@ -178,29 +178,30 @@ const ResetPassword = (): JSX.Element => {
178178
{...formikHandlers.getFieldProps('password')}
179179
type={passwordVisible ? 'text' : 'password'}
180180
placeholder="Please enter password"
181-
className="bg-accent w-full truncate rounded-md border py-2 pr-10 pl-4 text-sm text-gray-700 focus:ring-1 focus:outline-none dark:bg-gray-800"
181+
className=""
182182
disabled={loading}
183183
onFocus={() => setShowSuggestion(true)}
184184
onBlur={(e) => {
185185
setShowSuggestion(false)
186186
formikHandlers.handleBlur(e)
187187
}}
188188
/>
189-
<button
189+
<Button
190190
type="button"
191191
onClick={() =>
192192
setPasswordVisible(
193193
(prevVisible) => !prevVisible,
194194
)
195195
}
196-
className="text-secondary-foreground absolute top-1/2 right-2 -translate-y-1/2 transform bg-transparent hover:text-gray-800 dark:text-white dark:hover:text-white"
196+
className="absolute top-1/2 right-2 -translate-y-1/2 transform bg-transparent hover:bg-transparent hover:text-inherit"
197+
variant={'ghost'}
197198
>
198199
{passwordVisible ? (
199200
<EyeOff className="h-4 w-4" />
200201
) : (
201202
<Eye className="h-4 w-4" />
202203
)}
203-
</button>
204+
</Button>
204205
</div>
205206
{showSuggestion &&
206207
formikHandlers?.errors?.password &&
@@ -235,29 +236,30 @@ const ResetPassword = (): JSX.Element => {
235236
confirmPasswordVisible ? 'text' : 'password'
236237
}
237238
placeholder="Please re-enter password"
238-
className="bg-accent w-full truncate rounded-md border py-2 pr-10 pl-4 text-sm text-gray-700 focus:ring-1 focus:outline-none dark:bg-gray-800"
239+
className=""
239240
disabled={loading}
240241
onFocus={() => setShowSuggestion(true)}
241242
onBlur={(e) => {
242243
setShowSuggestion(false)
243244
formikHandlers.handleBlur(e)
244245
}}
245246
/>
246-
<button
247+
<Button
247248
type="button"
248249
onClick={() =>
249250
setConfirmPasswordVisible(
250251
(prevVisible) => !prevVisible,
251252
)
252253
}
253-
className="text-secondary-foreground absolute top-1/2 right-2 -translate-y-1/2 transform bg-transparent hover:text-gray-800 dark:text-white dark:hover:text-white"
254+
className="absolute top-1/2 right-2 -translate-y-1/2 transform bg-transparent hover:bg-transparent hover:text-inherit"
255+
variant={'ghost'}
254256
>
255257
{confirmPasswordVisible ? (
256258
<EyeOff className="h-4 w-4" />
257259
) : (
258260
<Eye className="h-4 w-4" />
259261
)}
260-
</button>
262+
</Button>
261263
</div>
262264
{formikHandlers?.errors?.confirmPassword &&
263265
formikHandlers?.touched?.confirmPassword && (

nextjs/src/config/svgs/Auth.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { JSX } from 'react'
2+
3+
type IconProps = React.HTMLAttributes<SVGElement>
4+
5+
export const Icons = {
6+
gitHub: (props: IconProps): JSX.Element => (
7+
<svg role="img" aria-label="GitHub logo" viewBox="0 0 438.549 438.549" {...props}>
8+
<path
9+
fill="currentColor"
10+
d="M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"
11+
></path>
12+
</svg>
13+
),
14+
15+
google: (props: IconProps): JSX.Element => (
16+
<svg role="img" aria-label="Google logo" viewBox="0 0 24 24" {...props}>
17+
<path
18+
fill="currentColor"
19+
d="M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"
20+
/>
21+
</svg>
22+
),
23+
}

nextjs/src/features/auth/components/user-auth-form.tsx

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import * as z from 'zod'
55
import {
66
Eye,
77
EyeOff,
8-
Github,
98
KeyRound,
109
Loader2,
1110
LockKeyhole,
@@ -26,6 +25,7 @@ import {
2625
passwordEncryption,
2726
} from '@/app/api/Auth'
2827
import React, { useState } from 'react'
28+
import { ToastContainer, toast } from 'react-toastify'
2929
import {
3030
generateAuthenticationOption,
3131
verifyAuthentication,
@@ -35,14 +35,13 @@ import { setRefreshToken, setToken } from '@/lib/authSlice'
3535
import { AxiosResponse } from 'axios'
3636
import { Button } from '@/components/ui/button'
3737
import { IVerifyRegistrationObj } from '@/components/profile/interfaces'
38-
import Image from 'next/image'
38+
import { Icons } from '@/config/svgs/Auth'
3939
import { Input } from '@/components/ui/input'
4040
import Link from 'next/link'
4141
import { apiStatusCodes } from '@/config/CommonConstant'
4242
import { setProfile } from '@/lib/profileSlice'
4343
import { signIn } from 'next-auth/react'
4444
import { startAuthentication } from '@simplewebauthn/browser'
45-
import { toast } from 'sonner'
4645
import { useDispatch } from 'react-redux'
4746
import { useForm } from 'react-hook-form'
4847
import { useRouter } from 'next/navigation'
@@ -287,21 +286,22 @@ export default function SignInViewPage(): React.JSX.Element {
287286

288287
return (
289288
<div className="relative flex w-full items-center justify-center">
289+
<ToastContainer />
290290
<div className="bg-card border-border relative z-10 h-full w-full max-w-md overflow-hidden rounded-xl border p-8 shadow-xl transition-transform duration-300">
291291
<div className="mb-6 text-center">
292292
<p className="text-muted-foreground text-sm">
293293
Sign in to your account to continue
294294
</p>
295295
</div>
296296

297-
<div className="bg-muted mb-4 flex overflow-hidden rounded-md text-sm font-medium">
297+
<div className="bg-muted mb-4 flex overflow-hidden rounded-md p-1 text-sm font-medium">
298298
<Button
299299
type="button"
300300
variant="ghost"
301-
className={`flex flex-1 items-center justify-center gap-1 px-4 py-2 ${
301+
className={`flex flex-1 items-center justify-center gap-1 px-4 py-2 hover:text-inherit ${
302302
isPasswordTab
303-
? 'bg-muted text-muted-foreground'
304-
: 'bg-card text-foreground'
303+
? 'bg-card text-foreground hover:bg-background'
304+
: 'bg-muted text-muted-foreground hover:bg-transparent'
305305
}`}
306306
onClick={() => setIsPasswordTab(true)}
307307
>
@@ -311,10 +311,10 @@ export default function SignInViewPage(): React.JSX.Element {
311311
<Button
312312
type="button"
313313
variant="ghost"
314-
className={`flex flex-1 items-center justify-center gap-1 px-4 py-2 ${
314+
className={`flex flex-1 items-center justify-center gap-1 px-4 py-2 hover:text-inherit ${
315315
!isPasswordTab
316-
? 'bg-muted text-muted-foreground'
317-
: 'bg-card text-foreground'
316+
? 'bg-card text-foreground hover:bg-background'
317+
: 'bg-muted text-muted-foreground hover:bg-transparent'
318318
}`}
319319
onClick={() => setIsPasswordTab(false)}
320320
>
@@ -389,8 +389,8 @@ export default function SignInViewPage(): React.JSX.Element {
389389
<Button
390390
type="button"
391391
onClick={forgotUserPassword}
392-
variant={'secondary'}
393-
className="text-secondary-foreground cursor-pointer bg-transparent shadow-none hover:bg-transparent hover:underline"
392+
variant={'default'}
393+
className="focus-visible:ring-ring text-foreground w-fit bg-transparent px-2 text-left underline-offset-4 shadow-none hover:bg-transparent hover:underline focus-visible:ring-1 focus-visible:outline-none disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
394394
>
395395
Forgot password?
396396
</Button>
@@ -411,24 +411,21 @@ export default function SignInViewPage(): React.JSX.Element {
411411
<div className="mt-6 flex flex-col gap-3">
412412
<Button
413413
type="button"
414-
className="flex w-full items-center justify-center gap-3 rounded-md border border-[var(--color-gray-300)] bg-[var(--color-white)] py-2 text-sm font-medium text-[var(--color-gray-700)] transition-all duration-200 hover:bg-[var(--color-gray-50)] hover:shadow-sm"
414+
className=""
415415
onClick={() => route.push('#')}
416+
variant={'outline'}
416417
>
417-
<Image
418-
src="https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg"
419-
alt="Google"
420-
width={15}
421-
height={15}
422-
/>
418+
<Icons.google className="mr-2 h-4 w-4" />
423419
Sign in with Google
424420
</Button>
425421

426422
<Button
427423
type="button"
428-
className="flex w-full items-center justify-center gap-2 rounded-md bg-[var(--color-black)] text-[var(--color-white)] transition-transform duration-200 hover:-translate-y-0.5 hover:bg-[var(--color-gray-800)] active:scale-95"
424+
className=""
429425
onClick={() => route.push('#')}
426+
variant={'outline'}
430427
>
431-
<Github className="h-5 w-5" />
428+
<Icons.gitHub className="mr-2 h-4 w-4" />
432429
<span className="text-sm font-medium">Sign in with GitHub</span>
433430
</Button>
434431
</div>
@@ -439,7 +436,7 @@ export default function SignInViewPage(): React.JSX.Element {
439436
</span>
440437
<Link
441438
href="/auth/sign-up"
442-
className="text-secondary hover:underline"
439+
className="text-muted-foreground hover:text-inherit hover:underline"
443440
>
444441
Create one
445442
</Link>

0 commit comments

Comments
 (0)