Skip to content

Commit 12ca912

Browse files
committed
FIX: small changes
1 parent 2d25b8b commit 12ca912

11 files changed

Lines changed: 241 additions & 137 deletions

File tree

.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
55
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
66

7-
DATABASE_URL="mongodb+srv://harshalvk:harshalvk2004@cluster0.b2qfuiu.mongodb.net/test"
7+
DATABASE_URL='mongodb+srv://harshalvkhobragade:pbD9mc5y83siEqvg@cluster0.mujtjjc.mongodb.net/Cluster0?retryWrites=true&w=majority&appName=Cluster0'
88
NEXTAUTH_JWT_SECRET="NEXT_AUTH_JWT_SECRET"
9-
NEXTAUTH_SECRET="NEXT_AUTH_SECRET"
9+
NEXTAUTH_SECRET="NEXT_AUTH_SECRET"
10+
NODE_ENV='development'

.gitignore

Lines changed: 125 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,135 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
29

3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
712

8-
# testing
9-
/coverage
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
1018

11-
# next.js
12-
/.next/
13-
/out/
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
1421

15-
# production
16-
/build
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
1725

18-
# misc
19-
.DS_Store
20-
*.pem
26+
# nyc test coverage
27+
.nyc_output
2128

22-
# debug
23-
npm-debug.log*
24-
yarn-debug.log*
25-
yarn-error.log*
26-
.pnpm-debug.log*
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
2734

28-
# local env files
29-
.env*.local
35+
# node-waf configuration
36+
.lock-wscript
3037

31-
# vercel
32-
.vercel
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
3340

34-
# typescript
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
3549
*.tsbuildinfo
36-
next-env.d.ts
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Microbundle cache
58+
.rpt2_cache/
59+
.rts2_cache_cjs/
60+
.rts2_cache_es/
61+
.rts2_cache_umd/
62+
63+
# Optional REPL history
64+
.node_repl_history
65+
66+
# Output of 'npm pack'
67+
*.tgz
68+
69+
# Yarn Integrity file
70+
.yarn-integrity
71+
72+
# dotenv environment variables file
73+
.env
74+
.env.test
75+
.env.production
76+
77+
# parcel-bundler cache (https://parceljs.org/)
78+
.cache
79+
.parcel-cache
80+
81+
# Next.js build output
82+
.next
83+
out
84+
85+
# Nuxt.js build / generate output
86+
.nuxt
87+
dist
88+
89+
# Gatsby files
90+
.cache/
91+
# Comment in the public line in if your project uses Gatsby and not Next.js
92+
# https://nextjs.org/blog/next-9-1#public-directory-support
93+
# public
94+
95+
# vuepress build output
96+
.vuepress/dist
97+
98+
# Serverless directories
99+
.serverless/
100+
101+
# FuseBox cache
102+
.fusebox/
103+
104+
# DynamoDB Local files
105+
.dynamodb/
106+
107+
# TernJS port file
108+
.tern-port
109+
110+
# Stores VSCode versions used for testing VSCode extensions
111+
.vscode-test
112+
113+
# yarn v2
114+
.yarn/cache
115+
.yarn/unplugged
116+
.yarn/build-state.yml
117+
.yarn/install-state.gz
118+
.pnp.*
119+
120+
.DS_*
121+
*.log
122+
logs
123+
**/*.backup.*
124+
**/*.back.*
125+
126+
node_modules
127+
bower_components
128+
129+
*.sublime*
130+
131+
psd
132+
thumb
133+
sketch
134+
135+
# End of https://mrkandreev.name/snippets/gitignore-generator/#Node,react

components/Layout/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const Sidebar = () => {
5252
/>
5353
))}
5454
{currentUser && (
55-
<SidebarItem onClick={() => signOut()} icon={BiLogOut} label='Logout'/>
55+
<SidebarItem href='' onClick={() => signOut()} icon={BiLogOut} label='Logout'/>
5656
)}
5757
<SidebarTweetButton/>
5858
</div>

components/Modal.tsx

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { useCallback } from 'react';
2-
import { AiOutlineClose } from 'react-icons/ai';
3-
import Button from './Button';
1+
import React, { useCallback } from "react";
2+
import { AiOutlineClose } from "react-icons/ai";
3+
import Button from "./Button";
44

55
interface ModalProps {
66
isOpen?: boolean;
@@ -21,19 +21,18 @@ const Modal: React.FC<ModalProps> = ({
2121
body,
2222
footer,
2323
actionLabel,
24-
disabled
24+
disabled,
2525
}) => {
26-
2726
const handleClose = useCallback(() => {
28-
if(disabled) {
27+
if (disabled) {
2928
return;
3029
}
3130

3231
onClose();
33-
}, [disabled,onClose]);
32+
}, [disabled, onClose]);
3433

3534
const handleSubmit = useCallback(() => {
36-
if(disabled) {
35+
if (disabled) {
3736
return;
3837
}
3938

@@ -46,8 +45,8 @@ const Modal: React.FC<ModalProps> = ({
4645

4746
return (
4847
<>
49-
<div
50-
className='
48+
<div
49+
className="
5150
justify-center
5251
items-center
5352
flex
@@ -60,13 +59,12 @@ const Modal: React.FC<ModalProps> = ({
6059
focus:outline-none
6160
bg-neutral-800
6261
bg-opacity-70
63-
'>
64-
<div
65-
className='relative w-full lg:w-3/6 my-6 mx-auto lg:max-w-3xl h-full lg:h-auto'
66-
>
67-
{/* Content */}
68-
<div
69-
className='
62+
"
63+
>
64+
<div className="relative w-full lg:w-3/6 my-6 mx-auto lg:max-w-3xl h-full lg:h-auto">
65+
{/* Content */}
66+
<div
67+
className="
7068
h-full
7169
lg:h-auto
7270
border-0
@@ -79,54 +77,52 @@ const Modal: React.FC<ModalProps> = ({
7977
bg-black
8078
outline-none
8179
focus:outline-none
82-
'
83-
>
84-
{/* Header */}
85-
<div
86-
className='
80+
"
81+
>
82+
{/* Header */}
83+
<div
84+
className="
8785
flex
8886
items-center
8987
justify-between
9088
p-10
9189
rounded-t
92-
'
93-
>
94-
<h3 className='text-3xl font-semibold text-white'>{title}</h3>
95-
<button
96-
onClick={handleClose}
97-
className='
90+
"
91+
>
92+
<h3 className="text-3xl font-semibold text-white">{title}</h3>
93+
<button
94+
onClick={handleClose}
95+
className="
9896
p-1
9997
ml-auto
10098
border-0
10199
text-white
102100
hover:opacity-70
103101
transition
104-
'
105-
>
106-
<AiOutlineClose size={20}/>
107-
</button>
108-
</div>
109-
{/* Body */}
110-
<div className='realtive p-10 flex-auto'>
111-
{body}
112-
</div>
113-
{/* Footer */}
114-
<div className='flex flex-col gap-2 p-10'>
115-
<Button
116-
disabled={disabled}
117-
label={actionLabel}
118-
secondary
119-
fullWidth
120-
large
121-
onClick={handleSubmit}
122-
/>
123-
{footer}
124-
</div>
102+
"
103+
>
104+
<AiOutlineClose size={20} />
105+
</button>
106+
</div>
107+
{/* Body */}
108+
<div className="realtive p-10 flex-auto">{body}</div>
109+
{/* Footer */}
110+
<div className="flex flex-col gap-2 p-10">
111+
<Button
112+
disabled={disabled}
113+
label={actionLabel}
114+
secondary
115+
fullWidth
116+
large
117+
onClick={handleSubmit}
118+
/>
119+
{footer}
125120
</div>
126121
</div>
122+
</div>
127123
</div>
128124
</>
129-
)
130-
}
125+
);
126+
};
131127

132-
export default Modal;
128+
export default Modal;

components/modals/RegisterModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import useRegisterModal from '@/hooks/useRegisterModal';
88
import axios from 'axios';
99
import { toast } from 'react-hot-toast';
1010
import { signIn } from 'next-auth/react';
11+
import { JsxElement } from 'typescript';
1112

1213
const RegisterModal = () => {
1314
const loginModal = useLoginModal();

next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@next-auth/prisma-adapter": "^1.0.5",
1313
"@prisma/client": "^4.12.0",
1414
"@types/node": "18.15.11",
15-
"@types/react": "18.0.33",
15+
"@types/react": "^18.0.33",
1616
"@types/react-dom": "18.0.11",
1717
"axios": "^1.3.5",
1818
"bcrypt": "^5.1.0",

0 commit comments

Comments
 (0)