Skip to content

Commit ad7e876

Browse files
committed
NextJS upgradation and revamped pages
1 parent d35809b commit ad7e876

File tree

195 files changed

+26060
-19148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+26060
-19148
lines changed

.env.local

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
SANITY_PROJECT_ID=hyxkyhqk
2+
SANITY_DATASET=production
3+
OAUTH_CLIENT_KEY=0bd7d13095874f6f9aa3
4+
OAUTH_CLIENT_SECRET=691485cbf393dd0faaed4b7781b2b8366df3cf03
5+
SANITY_STUDIO_REVALIDATE_SECRET= 779242f9958613c1d4bd1d7088dc66ef40ad9d792ba456caa0ab91f77895843d
6+
7+
8+
9+
SPOTIFY_CLIENT_ID=f1422f45d16543648a54216a69b80ea2
10+
SPOTIFY_REFRESH_TOKEN=AQCO-K8GY5KGyc8Ln4z5tPskIdTZw0v5yvbkEhiL3jgRDt2UJIMgr7yoQ740SedG-uvAZ3DlS_mu981QQ3lSMl6vpKDdPzxaectqMQ2unRPpsPa9YQCi0wdnK-ijCHFD_JI
11+
TWITTER_API_KEY=QcWeWwGj1yLgvYyzVa4A78huQ
12+
SPOTIFY_CLIENT_SECRET=0aaf4c8229f644d895c8ddd5bffbd218
13+
NEXT_AUTH_URL= http://localhost:3000
14+
SANITY_API_TOKEN=sk9w6b3XZnrKXCsSxGspHy9WkgEqXDru1N2eGzuKzu1PcYTzGuVmC0hRnbADSMhCrnPRw7AVi5HaMivVW2LBXkGsT6BVgKY2kB8R7vEvLBvUDXWWLQsQDrGG10k42fY1sicC4lw8dWIDajjd8iiG2105CWiZjiHeylP0SfehNPRQeyAZ0FRl
15+
NEXT_PUBLIC_WEATHER_API_KEY=3b5438066022f81fde058d040b9cfdbf
16+

components/BlogPost.tsx

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,32 @@ import useSWR from 'swr';
44
import fetcher from 'lib/fetcher';
55
import { Views } from 'lib/types';
66

7-
export default function BlogPost({
8-
slug,
9-
title,
10-
excerpt
11-
}: {
7+
interface BlogPostProps {
128
slug: string;
139
title: string;
1410
excerpt: string;
15-
}) {
11+
}
12+
13+
export default function BlogPost({ slug, title, excerpt }: BlogPostProps) {
1614
const { data } = useSWR<Views>(`/api/views/${slug}`, fetcher);
1715
const views = data?.total;
1816

1917
return (
20-
<Link href={`/blog/${slug}`}>
21-
<a className="w-full">
22-
<div className="w-full mb-8">
23-
<div className="flex flex-col justify-between md:flex-row">
24-
<h4 className="w-full mb-2 text-lg font-medium text-gray-900 md:text-xl dark:text-gray-100">
25-
{title}
26-
</h4>
27-
<p className="w-32 mb-4 text-left text-gray-500 md:text-right md:mb-0">
28-
{`${views ? new Number(views).toLocaleString() : '–––'} views`}
29-
</p>
30-
</div>
31-
<p className="text-gray-600 dark:text-gray-400">{excerpt}</p>
18+
<Link
19+
href={`/blog/${slug}`}
20+
className="w-full"
21+
>
22+
<div className="w-full mb-8">
23+
<div className="flex flex-col justify-between md:flex-row">
24+
<h4 className="w-full mb-2 text-lg font-medium text-gray-900 md:text-xl dark:text-gray-100">
25+
{title}
26+
</h4>
27+
<p className="w-32 mb-4 text-left text-gray-500 md:text-right md:mb-0">
28+
{`${views ? new Number(views).toLocaleString() : '–––'} views`}
29+
</p>
3230
</div>
33-
</a>
31+
<p className="text-gray-600 dark:text-gray-400">{excerpt}</p>
32+
</div>
3433
</Link>
3534
);
3635
}

components/BlogPostCard.tsx

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,57 @@ import cn from 'classnames';
55
import fetcher from 'lib/fetcher';
66
import { Views } from 'lib/types';
77

8-
export default function BlogPostCard({ title, slug, gradient }) {
8+
interface BlogPostCardProps {
9+
title: string;
10+
slug: string;
11+
gradient: string;
12+
}
13+
14+
export default function BlogPostCard({ title, slug, gradient }: BlogPostCardProps) {
915
const { data } = useSWR<Views>(`/api/views/${slug}`, fetcher);
1016
const views = data?.total;
1117

1218
return (
13-
<Link href={`/blog/${slug}`}>
14-
<a
15-
className={cn(
16-
'transform hover:scale-[1.01] transition-all',
17-
'rounded-xl w-full md:w-1/3 bg-gradient-to-r p-1',
18-
gradient
19-
)}
20-
>
21-
<div className="flex flex-col justify-between h-full bg-white dark:bg-gray-900 rounded-lg p-4">
22-
<div className="flex flex-col md:flex-row justify-between">
23-
<h4 className="text-lg md:text-lg font-medium mb-6 sm:mb-10 w-full text-gray-900 dark:text-gray-100 tracking-tight">
24-
{title}
25-
</h4>
26-
</div>
27-
<div className="flex items-center text-gray-800 dark:text-gray-200 capsize">
28-
<svg
29-
xmlns="http://www.w3.org/2000/svg"
30-
className="h-6 w-6"
31-
fill="none"
32-
viewBox="0 0 24 24"
33-
stroke="currentColor"
34-
>
35-
<path
36-
strokeLinecap="round"
37-
strokeLinejoin="round"
38-
strokeWidth={2}
39-
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
40-
/>
41-
<path
42-
strokeLinecap="round"
43-
strokeLinejoin="round"
44-
strokeWidth={2}
45-
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
46-
/>
47-
</svg>
48-
<span className="ml-2 align-baseline capsize">
49-
{views ? new Number(views).toLocaleString() : '–––'}
50-
</span>
51-
</div>
19+
<Link
20+
href={`/blog/${slug}`}
21+
className={cn(
22+
'transform hover:scale-[1.01] transition-all',
23+
'rounded-xl w-full md:w-1/3 bg-gradient-to-r p-1',
24+
gradient
25+
)}
26+
>
27+
<div className="flex flex-col justify-between h-full bg-white dark:bg-gray-900 rounded-lg p-4">
28+
<div className="flex flex-col md:flex-row justify-between">
29+
<h4 className="text-lg md:text-lg font-medium mb-6 sm:mb-10 w-full text-gray-900 dark:text-gray-100 tracking-tight">
30+
{title}
31+
</h4>
32+
</div>
33+
<div className="flex items-center text-gray-800 dark:text-gray-200 capsize">
34+
<svg
35+
xmlns="http://www.w3.org/2000/svg"
36+
className="h-6 w-6"
37+
fill="none"
38+
viewBox="0 0 24 24"
39+
stroke="currentColor"
40+
>
41+
<path
42+
strokeLinecap="round"
43+
strokeLinejoin="round"
44+
strokeWidth={2}
45+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
46+
/>
47+
<path
48+
strokeLinecap="round"
49+
strokeLinejoin="round"
50+
strokeWidth={2}
51+
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
52+
/>
53+
</svg>
54+
<span className="ml-2 align-baseline capsize">
55+
{views ? new Number(views).toLocaleString() : '–––'}
56+
</span>
5257
</div>
53-
</a>
58+
</div>
5459
</Link>
5560
);
5661
}

components/ConsCard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
export default function ConsCard({ title, cons }) {
1+
interface ConsCardProps {
2+
title: string;
3+
cons: string[];
4+
}
5+
6+
export default function ConsCard({ title, cons }: ConsCardProps) {
27
return (
38
<div className="border border-red-200 dark:border-red-900 bg-red-50 dark:bg-red-900 rounded-xl p-6 my-6 w-full">
49
<span>{`You might not use ${title} if...`}</span>

0 commit comments

Comments
 (0)