Skip to content

Commit e985958

Browse files
committed
fixing links
1 parent 988f0fb commit e985958

File tree

3 files changed

+50
-24
lines changed

3 files changed

+50
-24
lines changed

src/components/global/navbar/User.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ function User() {
2222
const router = useRouter();
2323

2424
const { id_token } = sessions?.user as { id_token: string} || {};
25-
const handleClose = () => {
25+
const handleClose = (url?: string) => {
2626
setAnchorEl(null);
27+
url && router.push(url)
2728
};
29+
2830
const dropdown = [
2931
["My Profile", "/my-profile", "/images/icon-container (2).svg"],
30-
["API Plans", "/api-plans", "/images/API.svg"],
31-
["API Keys", "/api-keys", "images/shield-key.svg"],
32+
["API Plans", "/apiplans", "/images/API.svg"],
33+
["API Keys", "/apiKeys", "images/shield-key.svg"],
3234
]
3335
const propsConfig = {
3436
elevation: 0,
@@ -76,14 +78,14 @@ function User() {
7678
anchorEl={anchorEl}
7779
id="user-menu"
7880
open={open}
79-
onClose={handleClose}
80-
onClick={handleClose}
81+
onClose={()=>handleClose()}
82+
onClick={()=>handleClose()}
8183
PaperProps={ propsConfig}
8284
transformOrigin={{ horizontal: 'right', vertical: 'top' }}
8385
anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}
8486
>
8587
{dropdown?.map((menuItem, index) => (
86-
<MenuItem key={index} className="ml-0" onClick={handleClose}>
88+
<MenuItem key={index} className="ml-0" onClick={() =>handleClose(menuItem[1])}>
8789
<ListItemIcon>
8890
<img src={menuItem[2]} alt="" />
8991
</ListItemIcon>
@@ -92,20 +94,20 @@ function User() {
9294
))
9395
}
9496
<Divider />
95-
<MenuItem onClick={handleClose}>
97+
<MenuItem>
9698
<Button fullWidth color="inherit"
9799
variant="outlined"
98100
onClick={() => signOut()}
99101
startIcon={<Logout fontSize="inherit" />}>
100-
Sing Out
102+
Sign Out
101103
</Button>
102104
</MenuItem>
103105
</Menu></>: <>
104106
<Button fullWidth color="inherit"
105107
variant="outlined"
106108
onClick={()=> router.push('/login')}
107109
startIcon={<Login fontSize="inherit" />}>
108-
Sing In
110+
Sign In
109111
</Button>
110112
</> }
111113
</div>

src/views/login/login.tsx

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {useRouter} from "next/router";
88
import Spinner from "@/components/common/Spinner";
99
import {mockProviders} from "next-auth/client/__tests__/helpers/mocks";
1010
import callbackUrl = mockProviders.github.callbackUrl;
11+
import { TextField } from '@mui/material';
1112

1213
const LoginComponent = () => {
1314
const {data: session, status, update} = useSession()
@@ -68,35 +69,58 @@ const LoginComponent = () => {
6869
<div className="main-box bg-dark-600" style={{height: 'auto !important', minHeight: '100vh'}}>
6970
<div style={{display: 'flex', flexDirection: 'column', alignItems: 'center'}}>
7071
<Image src={logo} alt="logo" className="mt-10 text-center"/>
71-
<div className="whitebox bg-white rounded px-10 mt-11 py-5" style={{height: '546px', width: '464px'}}>
72-
<p className="text-black text-xl font-weight-bold mt-4 text-center" style={{fontSize: '1.4rem'}}>
72+
<div className="px-10 py-5 bg-white rounded whitebox mt-11" style={{height: '546px', width: '464px'}}>
73+
<p className="mt-4 text-xl text-center text-black font-weight-bold" style={{fontSize: '1.4rem'}}>
7374
Login
7475
</p>
7576
{errorMessage && <div
76-
className="font-regular mt-5 relative block w-full rounded-lg bg-red-500 p-4 text-base leading-5 text-white opacity-100">
77+
className="relative block w-full p-4 mt-5 text-base leading-5 text-white bg-red-500 rounded-lg opacity-100 font-regular">
7778
{errorMessage}
7879
</div>}
7980
{successMessage && <div
80-
className="font-regular mt-5 relative block w-full rounded-lg bg-green-500 p-4 text-base leading-5 text-white opacity-100">
81+
className="relative block w-full p-4 mt-5 text-base leading-5 text-white bg-green-500 rounded-lg opacity-100 font-regular">
8182
{successMessage}
8283
</div>}
8384
{loading && <div className={'align-items-center d-flex flex justify-center mt-3'}>
8485
<Spinner height={'1rem'} width={'1rem'}/>
8586
</div>}
86-
<button
87+
{/* <button
8788
type="button"
8889
onClick={() => handleLoginWithGoogle()}
8990
className="w-full mt-5 text-center justify-center focus:ring-0 focus:outline-none rounded border border-dark-200 md:text-md sm:text-sm text-[10px] px-5 py-3 inline-flex items-center mb-2"
9091
>
9192
<img src="/images/google.svg" alt=""/>
9293
<span
9394
className="uppercase font-medium text-dark-600 ml-1 sm:ml-2 tracking-[1.5px]">continue with google</span>
94-
</button>
95+
</button> */}
9596

96-
<p className="text-black text-md font-weight-bold mt-5 text-center">or</p>
97-
<input
97+
{/* <p className="mt-5 text-center text-black text-md font-weight-bold">or</p> */}
98+
<br/>
99+
<br/>
100+
<br/>
101+
<TextField
102+
label="Email"
103+
id="input_email"
104+
size="small"
105+
variant="standard"
106+
type="text"
107+
className="w-full mb-6"
108+
onChange={(e) => setEmail(e.target.value)}
109+
required
110+
/>
111+
<TextField
112+
label="Password"
113+
id="input_password"
114+
size="small"
115+
variant="standard"
116+
type="password"
117+
className="w-full mb-6"
118+
onChange={(e) => setPassword(e.target.value)}
119+
required
120+
/>
121+
{/* <input
98122
type="text"
99-
className="form-control text-black bottom-border w-full mt-5 mt-lg-9"
123+
className="w-full mt-5 text-black form-control bottom-border mt-lg-9"
100124
placeholder="Email"
101125
onChange={(e) => setEmail(e.target.value)}
102126
id="email"
@@ -105,21 +129,21 @@ const LoginComponent = () => {
105129
<input
106130
type="password"
107131
onChange={(e) => setPassword(e.target.value)}
108-
className="form-control text-black bottom-border w-full mt-5 mt-lg-9"
132+
className="w-full mt-5 text-black form-control bottom-border mt-lg-9"
109133
placeholder="Password"
110134
id="password"
111135
required
112-
/>
136+
/> */}
113137
<button
114138
onClick={() => handleLogin()}
115-
className="text-white font-weight-bold text-center bg-dark-600 w-full rounded py-2 mt-8">LOGIN
139+
className="w-full py-2 mt-8 text-center text-white rounded font-weight-bold bg-dark-600">LOGIN
116140
</button>
117-
<p className="text-black text-xl font-weight-bold mt-9 text-center"
141+
<p className="text-xl text-center text-black font-weight-bold mt-9"
118142
style={{color: '#1976D2', fontSize: '14px'}}>
119143
Reset Password
120144
</p>
121145
<Link href="/register">
122-
<p className=" text-black text-xl font-weight-bold mt-5 text-center" style={{fontSize: '14px'}}>
146+
<p className="mt-5 text-xl text-center text-black font-weight-bold" style={{fontSize: '14px'}}>
123147
No account? <span style={{color: '#1976D2'}}>Create one</span>
124148
</p>
125149
</Link>

src/views/register/register.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ const RegisterComponent = () => {
220220
<p className="text-center text-black text-md font-weight-bold mt-9">
221221
By clicking “Create account” or “Continue with Google” or “Continue with Github”, you
222222
agree to the&nbsp;
223-
jiffyscan.xyz
223+
jiffyscan.xyz&nbsp;
224224
<a
225225
href="https://www.notion.so/adityaagarwal/Terms-of-Use-0012b80699cc4b948cdae9e42983035b"
226226
style={{color: '#1976D2'}}

0 commit comments

Comments
 (0)