From e0043f58ea970f5556bfe8707b133f7b0f69568a Mon Sep 17 00:00:00 2001 From: YashMehra Date: Sun, 29 Sep 2024 01:37:55 +0530 Subject: [PATCH 01/22] test2 --- src/app/login/loginPage.module.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/login/loginPage.module.css b/src/app/login/loginPage.module.css index 742f68a..8ceb0eb 100644 --- a/src/app/login/loginPage.module.css +++ b/src/app/login/loginPage.module.css @@ -1,4 +1,4 @@ -.container{ +/* .container{ display: flex; align-items: center; justify-content: center; @@ -59,4 +59,4 @@ font-weight: 400; font-size: 14px; } -} \ No newline at end of file +} */ \ No newline at end of file From 3237e1cb349b2e7caf89c6cbd9fc57278bd3559e Mon Sep 17 00:00:00 2001 From: YashMehra Date: Sun, 29 Sep 2024 01:38:28 +0530 Subject: [PATCH 02/22] test3 --- src/app/login/loginPage.module.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/login/loginPage.module.css b/src/app/login/loginPage.module.css index 8ceb0eb..742f68a 100644 --- a/src/app/login/loginPage.module.css +++ b/src/app/login/loginPage.module.css @@ -1,4 +1,4 @@ -/* .container{ +.container{ display: flex; align-items: center; justify-content: center; @@ -59,4 +59,4 @@ font-weight: 400; font-size: 14px; } -} */ \ No newline at end of file +} \ No newline at end of file From 7e80620088d940c182974f8b767cb76b1bcf94f9 Mon Sep 17 00:00:00 2001 From: Yash Mehra Date: Sun, 29 Sep 2024 01:40:45 +0530 Subject: [PATCH 03/22] Update README.md --- README.md | Bin 1435 -> 2851 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 7a9e38cad76522ba172b6a11d136b05a1fabbcb4..e1e2024b4f9d5fc3da43b495bf74ba942094af94 100644 GIT binary patch literal 2851 zcmai0O>g5i5WNS;e;6b{(HeG)ejaj5yv;U;Y*HuNUPDV`iH$@GBxT3_^?fsxVmrv9 z7sI5;`FQi@4bSPi@fH2iuTD=+Pp+u&Z5Oy^7wv{=CEx0PMO|ak+J}}_y=@Zp(YlIS zUvhA?~+Yr6O+P9{?I-ZQpNuQ< z`Odq_f4ZJbF6cH<7yQPS9O0Qmq^(Ug8H#M$hGQgt?KoI=1rwsAz(zbyX&Y?PKVs9m z!~s4f7BwK*MKVS3FtIVg`aV)&5?3C^;)Nh`eoi-RQXe?xCDy^aH2d9^rzf++q$mfz z&r4%jo0z7ED0V($`t=ru<>GR`_r+{%Ws>!7GRd(;Us%&nW8Dit6foT!zrIhj?j4fw z&NMddrs~yDs<~xKzN#9Otxw52`o1)~xwBQBv{XL~eiu2z9eqa+J|y zvj`?Bq{ZO%jcXZugb{3P4c#yAkcEU%nq*ccGPTCRuOv9!y|IDi%W!aQ5n4<>2!cWg z(*snOEO>>Q4VR=5uJAz_uMTRQMX{@Q=W{@xy+>K6^w}mfYA*SWDR|}m3oI&2#oXRc zMsx3?^IPc~>7I8UV6AEVR$ME~Xk!iik3*@{fSHi!5G)f|yp$Pl;2?(8ZA7C20W=&? z5j+)(M5r|CL0wg`ZjoyCp|ySBw~Tc~>>hPWU49B!d* z%FPip)xLdyD+9G9pdh&$FX z)1DEPh5$ph-Z5|#_aIIDliYpGRFS(+Q0$k1xFdsb>}NS9V9A+B;EA{k{AQ|IhY;Jb z;eL^`qv*-``%oEY|J5s)2^d*G&>tv2WcP*X>}eciyR#{sJr+7(@E1CU5PlW24`7R! zTr#F+gsFJQ0!1>}gc&tOc?L_k^Km| z#PpWLMRO#Dk?a^889fw6tAq@Ob{N_Kp{lOFkpM4(f#0(K?Poy7NZVfJ{a~GCU^2;D zPcpI>!U_z7hudL*Kr_Zc4t&Np$2X>0HuN^W^72rR^Uk{&WsZ7Vu{j)D`ObcJ2ovsQ zsV}H1XkU$i9jGJ39kW2+X<=Ypo+Gqqd|!@f=OIR)@{3VAc*p{MaJ;Md-#W~M2G38J z7pD*xm~(jRKwJZ(s3NDk%hMAgdVYR}Qq}suvZ%J6tW)aZ<$R7Eyk#$-ck`X^!%Vc? WnU?3mu9|5Y}gd|HB-CQbS|~?pq*~YfE#5Ya3`dI83QmtC79QN+Whh@wvag&#tVd z&9!jg57zGN%sekMw|f@}KSP`M{I9O>;-}|()gfM1RgZ(axR$W1Rx|{;W2;n)Xw+ba zfg3tF-P2}k0~_Ts#h19)KBm|qV64|xy6S<0WuKFxN~M9hvZgoTSPjPBn;pmMNut$y zxmYgF&ghy|UB9D`YJzf;PT#l?^_;@klkS-seqb*{$GuYIfMS;^YP;RmChnJue&}*6 z;*gOfEEh);`t)x89#TyH#;f%B!@xal5*r}Hi#2{PQ7?bLxVV@Q{^xi#F>;hKP#xre zPDlj}ac(kj9KB{x|Hw!{Pcb1PZd}HfkPKjg>LYd1xb~P(Z^0=z+A(W7J;r z;003l^miWEEDCyI*ny+c!5owD%@mdk%x%J^X_ep>Hp}X4rW|zRjkXfH$G)d+kQYPG zhZm!EpF2#!*j+W;8ca#4+zoif&){Uxca`+Q06a^flhRjD)R^xm`rL%&H ZmxV8+*cD}QQw03GE4Z+Q7RzE$d Date: Sun, 29 Sep 2024 02:10:07 +0530 Subject: [PATCH 04/22] update --- src/app/about/page.jsx | 24 ++-- src/app/contact/page.jsx | 4 +- src/app/login/page.jsx | 8 +- src/app/posts/[slug]/page.jsx | 110 +++++++++---------- src/app/write/page.jsx | 3 +- src/components/cardList/CardList.jsx | 74 ++++++------- src/components/categoryList/CategoryList.jsx | 84 +++++++------- src/components/featured/Featured.jsx | 13 ++- src/components/featured/featured.module.css | 2 +- src/components/footer/Footer.jsx | 2 +- 10 files changed, 162 insertions(+), 162 deletions(-) diff --git a/src/app/about/page.jsx b/src/app/about/page.jsx index e91e68f..a38f3b4 100644 --- a/src/app/about/page.jsx +++ b/src/app/about/page.jsx @@ -1,8 +1,8 @@ -import Image from 'next/image' -import React from 'react' +import Image from 'next/image'; +import React from 'react'; import styles from "./aboutpage.module.css" -import Link from 'next/link' +import Link from 'next/link'; const page = () => { @@ -19,25 +19,25 @@ const page = () => { Welcome to BlogHub - A World of Stories, Insights, and Ideas at Your Fingertips!

- At BlogHub, we believe that everyone has a story to tell, a perspective to share, and an idea that can inspire others. Whether you're an experienced blogger, a curious reader, or someone looking to dive into writing for the first time, BlogHub is your digital home for insightful, engaging, and thought-provoking content.
+ At BlogHub, we believe that everyone has a story to tell, a perspective to share, and an idea that can inspire others. Whether you're an experienced blogger, a curious reader, or someone looking to dive into writing for the first time, BlogHub is your digital home for insightful, engaging, and thought-provoking content.

Why BlogHub?


- BlogHub is more than just a blogging platform—it's a community-driven space where passion meets purpose. We're committed to creating a vibrant ecosystem for writers and readers alike, fostering meaningful conversations across a variety of interests. From personal experiences to professional advice, trending topics to timeless tales, our platform is designed to bring diverse voices together in one place.
+ BlogHub is more than just a blogging platform—it's a community-driven space where passion meets purpose. We're committed to creating a vibrant ecosystem for writers and readers alike, fostering meaningful conversations across a variety of interests. From personal experiences to professional advice, trending topics to timeless tales, our platform is designed to bring diverse voices together in one place.

-

What You'll Find Here:


+

What You'll Find Here:


- Diverse Range of Topics: Whether you're passionate about coding, fashion, culture, travel, food, or Style, BlogHub offers a vast array of topics to explore. Our writers come from all walks of life, sharing their unique perspectives and expertise on the subjects that matter most to them—and to you.
+ Diverse Range of Topics: Whether you're passionate about coding, fashion, culture, travel, food, or Style, BlogHub offers a vast array of topics to explore. Our writers come from all walks of life, sharing their unique perspectives and expertise on the subjects that matter most to them—and to you.

- Quality Content: We prioritize well-researched, thought-out, and engaging content. Whether it's an in-depth tutorial, a heartfelt narrative, or a trending topic analysis, you'll find articles that are both informative and enjoyable to read.
+ Quality Content: We prioritize well-researched, thought-out, and engaging content. Whether it's an in-depth tutorial, a heartfelt narrative, or a trending topic analysis, you'll find articles that are both informative and enjoyable to read.

Engaging and Interactive: BlogHub is all about interaction and engagement. You can comment on posts, join discussions, and even reach out to your favorite bloggers directly. Our platform encourages the exchange of ideas, fostering a sense of community among readers and writers.

A Platform for Writers: For aspiring bloggers or seasoned writers looking to grow their audience, BlogHub provides the perfect stage. Publish your content, connect with readers, and build your personal brand. Our user-friendly interface makes it easy to create beautiful, well-organized posts that captivate your audience.

- Stay Inspired and Informed: With fresh content uploaded regularly, BlogHub keeps you inspired with new ideas and perspectives. Whether you’re learning a new skill, seeking advice, or simply browsing for inspiration, there's always something new to discover.
+ Stay Inspired and Informed: With fresh content uploaded regularly, BlogHub keeps you inspired with new ideas and perspectives. Whether you're learning a new skill, seeking advice, or simply browsing for inspiration, there's always something new to discover.

Our Mission:


@@ -45,13 +45,13 @@ const page = () => {

Join Our Community:


- BlogHub is more than just a place to read or write—it's a place to belong. When you join BlogHub, you're not just a reader or a writer; you become part of a global community of thinkers, creators, and learners. Whether you're sharing your latest travel adventure, offering advice on personal growth, or simply exploring what others have to say, you're contributing to a bigger conversation.
+ BlogHub is more than just a place to read or write—it's a place to belong. When you join BlogHub, you're not just a reader or a writer; you become part of a global community of thinkers, creators, and learners. Whether you're sharing your latest travel adventure, offering advice on personal growth, or simply exploring what others have to say, you're contributing to a bigger conversation.

Ready to Start Your Blogging Journey?


- If you're ready to dive into a world of content that educates, entertains, and connects, BlogHub is the place for you. Sign up today to start reading, writing, and interacting with a growing community of bloggers and readers. Whatever your passion, there's a place for it on BlogHub.
+ If you're ready to dive into a world of content that educates, entertains, and connects, BlogHub is the place for you. Sign up today to start reading, writing, and interacting with a growing community of bloggers and readers. Whatever your passion, there's a place for it on BlogHub.

- So, whether you're here to read or to write, to learn or to share, welcome to BlogHub—the home of inspired content, meaningful conversations, and stories that matter.
+ So, whether you're here to read or to write, to learn or to share, welcome to BlogHub—the home of inspired content, meaningful conversations, and stories that matter.

diff --git a/src/app/contact/page.jsx b/src/app/contact/page.jsx index 83e036b..0787ed9 100644 --- a/src/app/contact/page.jsx +++ b/src/app/contact/page.jsx @@ -57,7 +57,7 @@ const ContactPage = () => {

Reach out to us !

- If you're experiencing any difficulties while using our platform, don't hesitate to reach out. Below are some common issues we can assist you with:
+ If you are experiencing any difficulties while using our platform, do nott hesitate to reach out. Below are some common issues we can assist you with:

Account & Functionality Issues:
@@ -75,7 +75,7 @@ const ContactPage = () => { We take user experience seriously and are committed to ensuring a safe and smooth environment for all. Let us know how we can help resolve your issue.

- Contact us today, and we'll get back to you promptly! + Contact us today, and we'll get back to you promptly!

diff --git a/src/app/login/page.jsx b/src/app/login/page.jsx index e353ddc..df552e0 100644 --- a/src/app/login/page.jsx +++ b/src/app/login/page.jsx @@ -7,7 +7,7 @@ import {FaFacebookF } from "react-icons/fa"; import { useRouter } from 'next/navigation'; import Facebook from "next-auth/providers/facebook"; -const page = () => { +const Page = () => { const {data,status} = useSession() @@ -24,12 +24,12 @@ const page = () => { return (
-
signIn("google")}> Sign in with Google
-
signIn("github")}> Sign in with Github
+
signIn("google")}> google Sign in with Google
+
signIn("github")}>google Sign in with Github
signIn("facebook")}> Sign in with Facebook
) } -export default page +export default Page; diff --git a/src/app/posts/[slug]/page.jsx b/src/app/posts/[slug]/page.jsx index 49a6772..d01b3b3 100644 --- a/src/app/posts/[slug]/page.jsx +++ b/src/app/posts/[slug]/page.jsx @@ -1,66 +1,66 @@ -// import Menu from "@/components/Menu/Menu"; -// import styles from "./singlePage.module.css"; -// import Image from "next/image"; -// import Comments from "@/components/comments/Comments"; +import Menu from "@/components/Menu/Menu"; +import styles from "./singlePage.module.css"; +import Image from "next/image"; +import Comments from "@/components/comments/Comments"; -// const getData = async (slug) => { -// const res = await fetch(`http://localhost:3000/api/posts/${slug}`, { -// cache: "no-store", -// }); +const getData = async (slug) => { + const res = await fetch(`http://localhost:3000/api/posts/${slug}`, { + cache: "no-store", + }); -// if (!res.ok) { -// throw new Error("Failed"); -// } + if (!res.ok) { + throw new Error("Failed"); + } -// return res.json(); -// }; + return res.json(); +}; -// const SinglePage = async ({ params }) => { -// const { slug } = params; +const SinglePage = async ({ params }) => { + const { slug } = params; -// const data = await getData(slug); + const data = await getData(slug); -// return ( -//
-//
-//
-//

{data?.title}

-//
-// {data?.user?.image && ( -//
-// -//
-// )} -//
-// {data?.user.name} -// {data?.createdAt.substring(0,10)} -//
-//
-//
-// {data?.img && ( -//
-// -//
-// )} -//
-//
-//
-//
-//
-// -//
-//
-// -//
-//
-// ); -// }; + return ( +
+
+
+

{data?.title}

+
+ {data?.user?.image && ( +
+ +
+ )} +
+ {data?.user.name} + {data?.createdAt.substring(0,10)} +
+
+
+ {data?.img && ( +
+ +
+ )} +
+
+
+
+
+ +
+
+ +
+
+ ); +}; -// export default SinglePage; +export default SinglePage; diff --git a/src/app/write/page.jsx b/src/app/write/page.jsx index 96fe5f5..93f7a0f 100644 --- a/src/app/write/page.jsx +++ b/src/app/write/page.jsx @@ -13,11 +13,10 @@ import { getDownloadURL, } from "firebase/storage"; import { app } from "@/utils/firebase"; -import ReactQuill from "react-quill"; - const WritePage = () => { const { status } = useSession(); + const ReactQuill = dynamic(()=> import('react-quill'), {ssr: false}); const router = useRouter(); const [open, setOpen] = useState(false); diff --git a/src/components/cardList/CardList.jsx b/src/components/cardList/CardList.jsx index a519f46..9972f60 100644 --- a/src/components/cardList/CardList.jsx +++ b/src/components/cardList/CardList.jsx @@ -1,50 +1,50 @@ -// import React from "react"; -// import styles from "./cardList.module.css"; -// import Pagination from "../pagination/Pagination"; -// import Image from "next/image"; -// import Card from "../card/Card"; +import React from "react"; +import styles from "./cardList.module.css"; +import Pagination from "../pagination/Pagination"; +import Image from "next/image"; +import Card from "../card/Card"; -// const getData = async (page, cat) => { -// const res = await fetch( -// `http://localhost:3000/api/posts?page=${page}&cat=${cat || ""}`, -// { -// cache: "no-store", -// } -// ); +const getData = async (page, cat) => { + const res = await fetch( + `http://localhost:3000/api/posts?page=${page}&cat=${cat || ""}`, + { + cache: "no-store", + } + ); -// if (!res.ok) { -// throw new Error("Failed"); -// } + if (!res.ok) { + throw new Error("Failed"); + } -// return res.json(); -// }; -// const CardList = async ({ page, cat }) => { + return res.json(); +}; +const CardList = async ({ page, cat }) => { -// const { posts, count } = await getData(page, cat); + const { posts, count } = await getData(page, cat); -// const POST_PER_PAGE = 4; + const POST_PER_PAGE = 4; -// const hasPrev = POST_PER_PAGE * (page - 1) > 0; -// const hasNext = POST_PER_PAGE * (page - 1) + POST_PER_PAGE < count; + const hasPrev = POST_PER_PAGE * (page - 1) > 0; + const hasNext = POST_PER_PAGE * (page - 1) + POST_PER_PAGE < count; -// return ( -// <> -//
-//

Recent Posts

-//
-// {posts?.map((item) => ( -// -// ))} -//
-// -//
+ return ( + <> +
+

Recent Posts

+
+ {posts?.map((item) => ( + + ))} +
+ +
-// -// ); -// }; + + ); +}; -// export default CardList; +export default CardList; diff --git a/src/components/categoryList/CategoryList.jsx b/src/components/categoryList/CategoryList.jsx index 750ee58..5b73218 100644 --- a/src/components/categoryList/CategoryList.jsx +++ b/src/components/categoryList/CategoryList.jsx @@ -1,47 +1,47 @@ -// import React from "react"; -// import styles from "./categoryList.module.css"; -// import Link from "next/link"; -// import Image from "next/image"; +import React from "react"; +import styles from "./categoryList.module.css"; +import Link from "next/link"; +import Image from "next/image"; -// const getData = async () => { -// const res = await fetch("http://localhost:3000/api/categories", { -// cache: "no-store", -// }); +const getData = async () => { + const res = await fetch("http://localhost:3000/api/categories", { + cache: "no-store", + }); -// if (!res.ok) { -// throw new Error("Failed"); -// } + if (!res.ok) { + throw new Error("Failed"); + } -// return res.json(); -// }; + return res.json(); +}; -// const CategoryList = async () => { -// const data = await getData(); -// return ( -//
-//

Popular Categories 🔥

-//
-// {data?.map((item) => ( -// -// {item.img && ( -// -// )} -// {item.title} -// -// ))} -//
-//
-// ); -// }; +const CategoryList = async () => { + const data = await getData(); + return ( +
+

Popular Categories 🔥

+
+ {data?.map((item) => ( + + {item.img && ( + + )} + {item.title} + + ))} +
+
+ ); +}; -// export default CategoryList; \ No newline at end of file +export default CategoryList; \ No newline at end of file diff --git a/src/components/featured/Featured.jsx b/src/components/featured/Featured.jsx index b32469a..8bceeea 100644 --- a/src/components/featured/Featured.jsx +++ b/src/components/featured/Featured.jsx @@ -7,22 +7,23 @@ const Featured = () => { return (

- Welcome2 BLOG HUB! Discover new Blogs and Write what's on your Mind. + Welcome2 BLOG HUB! Discover new Blogs and Write what's on your Mind.

- + mainfeature

Information & Creation:(Blog Hub)

- Used Front-End : Next.js/ React.js/ - - Used (Backend) : Node.js/ MongoDB/ Prisma-ORM/ Firebase/ + Used Front-End : Next.js/ React.js/
+
+ Used (Backend) : Node.js/ MongoDB/ Prisma-ORM/ Firebase/
+
Used (authentication) : Auth.js/ Google-Cloud/ Meta-developer/ GitHub developer/ - Used Dependencies : "eslint, "eslint-config-next", "next": "13.4.19","next-auth", "react", "react-dom", "react-icons", "react-quill, prisma-adapter, prisma-client, firebase, swr. +

diff --git a/src/components/featured/featured.module.css b/src/components/featured/featured.module.css index a93ccb3..1ede7ac 100644 --- a/src/components/featured/featured.module.css +++ b/src/components/featured/featured.module.css @@ -17,7 +17,7 @@ .imgContainer { flex: 1; - height: 500px; + height: 450px; position: relative; box-shadow: var(--boxshadow); } diff --git a/src/components/footer/Footer.jsx b/src/components/footer/Footer.jsx index 62b5c3c..51c9245 100644 --- a/src/components/footer/Footer.jsx +++ b/src/components/footer/Footer.jsx @@ -15,7 +15,7 @@ const Footer = () => {

Blog Hub

- Blog Hub is an interactive blogging website where user can write, discover and discuss blogs. It offer various genres of topics for the user to choose from ranging from fashion, cultures and coding etc. Discover all new features of Bog Hub and don't fprget to write a blog ;) + Blog Hub is an interactive blogging website where user can write, discover and discuss blogs. It offer various genres of topics for the user to choose from ranging from fashion, cultures and coding etc. Discover all new features of Blog Hub and don't forget to write a blog ;)

From 70de6a3661c23499167e81779d33b609e7d814e2 Mon Sep 17 00:00:00 2001 From: YashMehra Date: Sun, 29 Sep 2024 02:17:40 +0530 Subject: [PATCH 05/22] . --- src/app/contact/page.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/contact/page.jsx b/src/app/contact/page.jsx index 0787ed9..4f3b161 100644 --- a/src/app/contact/page.jsx +++ b/src/app/contact/page.jsx @@ -57,7 +57,7 @@ const ContactPage = () => {

Reach out to us !

- If you are experiencing any difficulties while using our platform, do nott hesitate to reach out. Below are some common issues we can assist you with:
+ If you are experiencing any difficulties while using our platform, do not hesitate to reach out. Below are some common issues we can assist you with:

Account & Functionality Issues:
From 0e8ef647bc4dd0526e4cc570f11487622898a25f Mon Sep 17 00:00:00 2001 From: YashMehra Date: Sun, 29 Sep 2024 02:42:35 +0530 Subject: [PATCH 06/22] 01 --- src/components/menuPosts/MenuPosts.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/menuPosts/MenuPosts.jsx b/src/components/menuPosts/MenuPosts.jsx index ef584a3..759e1ab 100644 --- a/src/components/menuPosts/MenuPosts.jsx +++ b/src/components/menuPosts/MenuPosts.jsx @@ -1,5 +1,5 @@ import { PrismaClient } from '@prisma/client'; -import styles from './menuposts.module.css'; +import styles from './menuPosts.module.css'; import Image from 'next/image'; import Link from 'next/link'; From 2c8c71a4c976dbe8a052bbb4183cc9a7af05d24a Mon Sep 17 00:00:00 2001 From: YashMehra Date: Sun, 29 Sep 2024 02:54:50 +0530 Subject: [PATCH 07/22] 02 --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index dad8da4..4ec622c 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,9 @@ "version": "0.1.0", "private": true, "scripts": { + "postinstall": "prisma generate", "dev": "next dev", - "build": "next build", + "build": "prisma generate && next build", "start": "next start", "lint": "next lint" }, From 9217278b72d0981e651261a654397619013a263b Mon Sep 17 00:00:00 2001 From: YashMehra Date: Sun, 29 Sep 2024 03:18:48 +0530 Subject: [PATCH 08/22] 03 --- src/app/posts/[slug]/page.jsx | 2 +- src/components/cardList/CardList.jsx | 2 +- src/components/categoryList/CategoryList.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/posts/[slug]/page.jsx b/src/app/posts/[slug]/page.jsx index d01b3b3..87f844a 100644 --- a/src/app/posts/[slug]/page.jsx +++ b/src/app/posts/[slug]/page.jsx @@ -5,7 +5,7 @@ import Image from "next/image"; import Comments from "@/components/comments/Comments"; const getData = async (slug) => { - const res = await fetch(`http://localhost:3000/api/posts/${slug}`, { + const res = await fetch(`https://hub-blog.vercel.app/api/posts/${slug}`, { cache: "no-store", }); diff --git a/src/components/cardList/CardList.jsx b/src/components/cardList/CardList.jsx index 9972f60..8fb9d6a 100644 --- a/src/components/cardList/CardList.jsx +++ b/src/components/cardList/CardList.jsx @@ -9,7 +9,7 @@ import Card from "../card/Card"; const getData = async (page, cat) => { const res = await fetch( - `http://localhost:3000/api/posts?page=${page}&cat=${cat || ""}`, + `https://hub-blog.vercel.app/api/posts?page=${page}&cat=${cat || ""}`, { cache: "no-store", } diff --git a/src/components/categoryList/CategoryList.jsx b/src/components/categoryList/CategoryList.jsx index 5b73218..c870286 100644 --- a/src/components/categoryList/CategoryList.jsx +++ b/src/components/categoryList/CategoryList.jsx @@ -4,7 +4,7 @@ import Link from "next/link"; import Image from "next/image"; const getData = async () => { - const res = await fetch("http://localhost:3000/api/categories", { + const res = await fetch("https://hub-blog.vercel.app/api/categories", { cache: "no-store", }); From 0101d2bc118c1127a3bf988cb0cb20c647cb61f7 Mon Sep 17 00:00:00 2001 From: YashMehra Date: Sun, 29 Sep 2024 04:20:43 +0530 Subject: [PATCH 09/22] 04 --- src/utils/auth.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/auth.js b/src/utils/auth.js index b14b27a..ba44e0a 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -7,7 +7,7 @@ import { getServerSession } from "next-auth"; export const authOptions = { adapter: PrismaAdapter(prisma), - + providers: [ GoogleProvider({ clientId: process.env.GOOGLE_ID, @@ -18,10 +18,11 @@ export const authOptions = { clientSecret: process.env.GITHUB_SECRET, }), FacebookProvider({ - clientId: process.env.FACEBOOK_ID, - clientSecret: process.env.FACEBOOK_SECRET, + clientId: process.env.FACEBOOK_ID, + clientSecret: process.env.FACEBOOK_SECRET, }), ], + secret: process.env.NEXTAUTH_SECRET, // This should now work correctly }; export const getAuthSession = () => getServerSession(authOptions); From 0d169f26b3c7ffbfd890111bce710ec0006808ef Mon Sep 17 00:00:00 2001 From: YashMehra Date: Sun, 29 Sep 2024 16:08:12 +0530 Subject: [PATCH 10/22] 05 --- src/app/about/aboutpage.module.css | 33 +++++++----- src/app/blog/blogPage.module.css | 34 +++++++++++-- src/app/write/page.jsx | 3 +- src/components/authLinks/AuthLinks.jsx | 4 +- src/components/card/Card.jsx | 2 +- src/components/card/card.module.css | 51 ++++++++++++++++++- .../categoryList/categoryList.module.css | 5 ++ src/components/comments/Comments.jsx | 2 +- src/components/featured/Featured.jsx | 14 ++--- src/components/featured/featured.module.css | 36 ++++++++++--- 10 files changed, 143 insertions(+), 41 deletions(-) diff --git a/src/app/about/aboutpage.module.css b/src/app/about/aboutpage.module.css index 8f25ae2..7604314 100644 --- a/src/app/about/aboutpage.module.css +++ b/src/app/about/aboutpage.module.css @@ -46,34 +46,39 @@ @media screen and (max-width:1025px) { - .title{ - font-size: 25px; - } - - .rightimg{ - height:300px; + .imgContainer{ + width: 100%; + } + .img{ + height:600px; } } @media screen and (max-width:756px){ - .rightimg{ - height: 200px; + .img{ + height: 500px; + } + .description{ + font-size: 18px; } } @media screen and (max-width:640px) { - .container{ - flex-direction: column; + .title{ + font-size: 30px; + } + .img{ + height: 400px; } - .rightimg{ - height: 350px; + .description{ + font-size: 15px; } } @media screen and (max-width:455px) { - .rightimg{ - height: 250px; + .img{ + height: 300px; } } \ No newline at end of file diff --git a/src/app/blog/blogPage.module.css b/src/app/blog/blogPage.module.css index 5998f84..ad89e91 100644 --- a/src/app/blog/blogPage.module.css +++ b/src/app/blog/blogPage.module.css @@ -1,12 +1,38 @@ .title{ -background-color: coral; -color: white; +color: orangered; padding: 5px 10px; -text-align: center; +text-align: start; text-transform: capitalize; +font-size: 80px; } .content{ display: flex; gap: 50px; -} \ No newline at end of file +} + +@media screen and (max-width:1280px) { + + .title { + font-size: 72px; + } +} + +@media screen and (max-width:1024px) { + + .title { + font-size: 65px; + } +} + +@media screen and (max-width:768px) { + .title{ + font-size: 54px; + } +} + +@media screen and (max-width:640px) { + .title{ + font-size: 44px; + } +} diff --git a/src/app/write/page.jsx b/src/app/write/page.jsx index 93f7a0f..9cbedcd 100644 --- a/src/app/write/page.jsx +++ b/src/app/write/page.jsx @@ -13,6 +13,7 @@ import { getDownloadURL, } from "firebase/storage"; import { app } from "@/utils/firebase"; +import dynamic from "next/dynamic"; const WritePage = () => { const { status } = useSession(); @@ -79,7 +80,7 @@ const WritePage = () => { const handleSubmit = async () => { - const res = await fetch("/api/posts", { + const res = await fetch("https://hub-blog.vercel.app/api/posts", { method: "POST", body: JSON.stringify({ title, diff --git a/src/components/authLinks/AuthLinks.jsx b/src/components/authLinks/AuthLinks.jsx index b1b4ac3..968f9ff 100644 --- a/src/components/authLinks/AuthLinks.jsx +++ b/src/components/authLinks/AuthLinks.jsx @@ -36,8 +36,8 @@ const AuthLinks = () => { {open && (

Homepage - About - Contact + About + Contact {status === "unauthenticated" ? ( Login ) : ( diff --git a/src/components/card/Card.jsx b/src/components/card/Card.jsx index a26290a..4522464 100644 --- a/src/components/card/Card.jsx +++ b/src/components/card/Card.jsx @@ -20,7 +20,7 @@ const Card = ({ key, item }) => { {item.catSlug}
-

{item.title}

+

{item.title}

{/*

{item.desc.substring(0, 60)}

*/}
diff --git a/src/components/card/card.module.css b/src/components/card/card.module.css index 40008c5..5a6d383 100644 --- a/src/components/card/card.module.css +++ b/src/components/card/card.module.css @@ -15,7 +15,7 @@ .image { object-fit: cover; } - + .textContainer { flex: 1; display: flex; @@ -51,6 +51,55 @@ @media screen and (max-width: 1280px) { .imageContainer { + height: 280px; + } + } + + @media screen and (max-width: 1024px) { + .container{ + background-color: var(--softBg); + border-radius: 8px; + margin: 6px; + margin-bottom: 50px; + } + .desc{ + font-size: 15px; + } + .title{ + font-size: 25px; + } + } + + @media screen and (max-width:769px) { + .container{ + gap: 25px; + margin-bottom: 15px; + } + .title{ + font-size: 22px; + } + .desc{ + font-size: 12px; + } + .imageContainer{ + height: 300px; + } + } + + @media screen and (max-width:640px) { + .textContainer{ + margin: 10px; + } + .imageContainer{ display: none; } + + .title{ + font-size: 18px; + justify-content: center; + align-items: center; + } + .desc{ + font-size: 15px; + } } \ No newline at end of file diff --git a/src/components/categoryList/categoryList.module.css b/src/components/categoryList/categoryList.module.css index ade8c79..5246652 100644 --- a/src/components/categoryList/categoryList.module.css +++ b/src/components/categoryList/categoryList.module.css @@ -93,4 +93,9 @@ .category{ width: 100%; } +} +@media screen and (max-width:432px) { + .title{ + font-size: 28px; + } } \ No newline at end of file diff --git a/src/components/comments/Comments.jsx b/src/components/comments/Comments.jsx index 39bb001..0484bdd 100644 --- a/src/components/comments/Comments.jsx +++ b/src/components/comments/Comments.jsx @@ -46,7 +46,7 @@ const {status} = useSession(); (