Skip to content

Commit c82d0a1

Browse files
committed
formatting the whole codebase
1 parent ffc22dc commit c82d0a1

File tree

97 files changed

+384
-385
lines changed

Some content is hidden

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

97 files changed

+384
-385
lines changed

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"semi": true,
33
"singleQuote": true,
44
"tabWidth": 2,
5-
"trailingComma": "all"
5+
"trailingComma": "all",
6+
"plugins": [
7+
"prettier-plugin-tailwindcss"
8+
]
69
}

src/app/(marketing)/(policy)/privacy-policy/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { privacyPolicyContent } from '../../../../components/landing/footer/priv
22

33
const PrivacyPolicyPage = () => {
44
return (
5-
<main className="flex flex-col items-start justify-center -mt-6 mb-12 px-4 md:px-36">
6-
<h1 className="text-3xl md:text-4xl font-semibold text-neutral-800 dark:text-neutral-200 mb-4 md:mb-6 w-full text-center md:max-w-screen-2xl mx-auto">
5+
<main className="-mt-6 mb-12 flex flex-col items-start justify-center px-4 md:px-36">
6+
<h1 className="mx-auto mb-4 w-full text-center text-3xl font-semibold text-neutral-800 dark:text-neutral-200 md:mb-6 md:max-w-screen-2xl md:text-4xl">
77
Privacy Policy
88
</h1>
99
{privacyPolicyContent.map((item) => {
1010
return (
1111
<div
12-
className="my-3 text-neutral-700 dark:text-neutral-300 font-normal text-lg"
12+
className="my-3 text-lg font-normal text-neutral-700 dark:text-neutral-300"
1313
key={item.id}
1414
>
1515
<p className="">{item.description}</p>

src/app/(marketing)/(policy)/refund/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const RefundAndCancellationPage = () => {
22
return (
3-
<main className="flex flex-col items-start -mt-6 mb-12 px-4 md:px-36 h-[60vh] lg:h-[70vh]">
4-
<h1 className="text-3xl md:text-4xl font-semibold text-neutral-800 dark:text-neutral-200 mb-4 md:mb-6 w-full text-center md:max-w-screen-2xl mx-auto">
3+
<main className="-mt-6 mb-12 flex h-[60vh] flex-col items-start px-4 md:px-36 lg:h-[70vh]">
4+
<h1 className="mx-auto mb-4 w-full text-center text-3xl font-semibold text-neutral-800 dark:text-neutral-200 md:mb-6 md:max-w-screen-2xl md:text-4xl">
55
Refund/Cancellation Policy
66
</h1>
77

8-
<p className="my-3 text-neutral-700 dark:text-neutral-300 font-normal text-lg">
8+
<p className="my-3 text-lg font-normal text-neutral-700 dark:text-neutral-300">
99
You are entitled to a refund in the case of the purchased course not
1010
being assigned to you within the expiration date from your date of
1111
purchase or if you have paid twice for the same course. Under any other

src/app/(marketing)/(policy)/tnc/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { tncContent } from '../../../../components/landing/footer/tnc/tnc-conten
22

33
const TermsAndConditionsPage = () => {
44
return (
5-
<main className="flex flex-col items-start justify-center -mt-6 mb-12 px-4 md:px-36">
6-
<h1 className="text-3xl md:text-4xl font-semibold text-neutral-800 dark:text-neutral-200 mb-4 md:mb-6 w-full text-center md:max-w-screen-2xl mx-auto">
5+
<main className="-mt-6 mb-12 flex flex-col items-start justify-center px-4 md:px-36">
6+
<h1 className="mx-auto mb-4 w-full text-center text-3xl font-semibold text-neutral-800 dark:text-neutral-200 md:mb-6 md:max-w-screen-2xl md:text-4xl">
77
Terms & Conditions
88
</h1>
99
{tncContent.map((item) => {
1010
return (
1111
<div
12-
className="my-4 text-neutral-700 dark:text-neutral-300 font-normal text-lg"
12+
className="my-4 text-lg font-normal text-neutral-700 dark:text-neutral-300"
1313
key={item.id}
1414
>
1515
<p>{item.description}</p>

src/app/(marketing)/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
const MarketingLayout = ({ children }: { children: React.ReactNode }) => {
44
return (
5-
<main className="pt-36 pb-20 h-full overflow-y-auto no-scrollbar">
5+
<main className="no-scrollbar h-full overflow-y-auto pb-20 pt-36">
66
{children}
77
</main>
88
);

src/app/admin/comment/ApproveComment.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ const ApproveComment = () => {
3434
};
3535
return (
3636
<form onSubmit={handleApprove} ref={formRef}>
37-
<div className="w-full max-w-sm rounded-lg border border-gray-200 grid grid-rows-5 shadow-sm dark:border-gray-800">
38-
<div className="p-6 grid gap-2 items-center row-span-3">
37+
<div className="grid w-full max-w-sm grid-rows-5 rounded-lg border border-gray-200 shadow-sm dark:border-gray-800">
38+
<div className="row-span-3 grid items-center gap-2 p-6">
3939
<div className="text-3xl font-bold">Approve Intro comment</div>
4040
<div className="text-sm font-medium leading-none text-gray-500 dark:text-gray-400">
4141
Enter the information below to approve the comment
4242
</div>
4343
</div>
4444

45-
<div className="p-6 flex items-center row-span-2">
45+
<div className="row-span-2 flex items-center p-6">
4646
<Label className="sr-only">Comment ID</Label>
4747
<Input
4848
className="w-full"
@@ -55,7 +55,7 @@ const ApproveComment = () => {
5555
/>
5656
<FormErrors id="commentId" errors={fieldErrors} />
5757
</div>
58-
<div className="p-6 flex items-center row-span-2">
58+
<div className="row-span-2 flex items-center p-6">
5959
<Label className="sr-only">Admin password</Label>
6060
<Input
6161
className="w-full"
@@ -68,7 +68,7 @@ const ApproveComment = () => {
6868
/>
6969
<FormErrors id="adminPassword" errors={fieldErrors} />
7070
</div>
71-
<div className="p-6 flex items-center justify-center row-span-2">
71+
<div className="row-span-2 flex items-center justify-center p-6">
7272
<Button className="w-full">Approve</Button>
7373
</div>
7474
</div>

src/app/admin/comment/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ApproveComment from './ApproveComment';
33

44
const CommentAdminPage = () => {
55
return (
6-
<div className="flex justify-center h-[100dvh] items-center">
6+
<div className="flex h-[100dvh] items-center justify-center">
77
<ApproveComment />
88
</div>
99
);

src/app/admin/content/[...courseId]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default async function UpdateCourseContent({
2525

2626
if (contentType === 'video') {
2727
return (
28-
<div className="max-w-screen-xl justify-between mx-auto p-4 text-white">
28+
<div className="mx-auto max-w-screen-xl justify-between p-4 text-white">
2929
{/* <ContentRenderer nextContent={null} content={{ id: courseContent[0]?.id || 0, title: courseContent[0]?.title || "", type: contentType || "video", thumbnail: courseContent[0]?.thumbnail || "", description: courseContent[0]?.description ?? "" }} /> */}
3030
Video
3131
</div>
@@ -34,17 +34,17 @@ export default async function UpdateCourseContent({
3434

3535
if (contentType === 'notion') {
3636
return (
37-
<div className="max-w-screen-xl justify-between mx-auto p-4 dark:text-white text-blacke">
37+
<div className="text-blacke mx-auto max-w-screen-xl justify-between p-4 dark:text-white">
3838
{/* <NotionRenderer id={courseContent[0]?.id} /> */}
3939
Notion doc
4040
</div>
4141
);
4242
}
4343

4444
return (
45-
<div className="max-w-screen-xl justify-between mx-auto p-4 dark:text-white text-black">
45+
<div className="mx-auto max-w-screen-xl justify-between p-4 text-black dark:text-white">
4646
{course?.title}
47-
<div className="font-bold md:text-5xl lg:text-6xl">Content</div>
47+
<div className="font-bold md:text-5xl lg:text-6xl">Content</div>
4848
<AddContent
4949
courseId={parseInt(courseId, 10)}
5050
parentContentId={parseFloat(rest[rest.length - 1])}

src/app/admin/content/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function getCourses() {
1010
export default async function CourseContent() {
1111
const courses = await getCourses();
1212
return (
13-
<div className="max-w-screen-xl justify-between mx-auto p-4 cursor-pointer">
13+
<div className="mx-auto max-w-screen-xl cursor-pointer justify-between p-4">
1414
<SelectCourse courses={courses} />
1515
</div>
1616
);

src/app/admin/discord/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default function DiscordPage() {
99
const [adminSecret, setAdminSecret] = useState('' as any);
1010
const [userData, setUserData] = useState({} as any);
1111
return (
12-
<div className="flex md:flex-row flex-col justify-around px-10 py-5">
13-
<div className="border p-5 rounded-lg flex flex-col justify-self-center">
12+
<div className="flex flex-col justify-around px-10 py-5 md:flex-row">
13+
<div className="flex flex-col justify-self-center rounded-lg border p-5">
1414
<h1 className="text-xl sm:text-2xl md:text-4xl">
1515
Refresh discord permissions
1616
</h1>
@@ -32,7 +32,7 @@ export default function DiscordPage() {
3232
/>
3333
<br />
3434
<Button
35-
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
35+
className="rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700"
3636
onClick={async () => {
3737
const response = await fetch('/api/admin/discord/refresh', {
3838
method: 'POST',
@@ -53,13 +53,13 @@ export default function DiscordPage() {
5353
Allow user to re-initiate discord
5454
</Button>
5555
<br />
56-
<h1 className="capitalize text-center">
56+
<h1 className="text-center capitalize">
5757
please delete old user from discord first
5858
</h1>
5959
</div>
6060

6161
<br />
62-
<div className="flex gap-2 flex-col border rounded-lg p-5">
62+
<div className="flex flex-col gap-2 rounded-lg border p-5">
6363
<h1 className="text-xl sm:text-2xl md:text-4xl">Get information</h1>
6464
<Input
6565
placeholder="email"
@@ -76,7 +76,7 @@ export default function DiscordPage() {
7676
onChange={(e) => setAdminSecret(e.target.value)}
7777
/>
7878
<Button
79-
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
79+
className="rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700"
8080
onClick={async () => {
8181
const response = await fetch('/api/admin/discord/', {
8282
method: 'POST',

src/app/admin/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ export default function Courses() {
3737
};
3838

3939
return (
40-
<Card className="lg:mt-10 w-full max-w-6xl mx-auto overflow-y-auto">
40+
<Card className="mx-auto w-full max-w-6xl overflow-y-auto lg:mt-10">
4141
<CardHeader>
4242
<CardTitle>Create a new course</CardTitle>
4343
<CardDescription>Fill in the course details below</CardDescription>
4444
</CardHeader>
45-
<CardContent className="p-4 pt-0 grid gap-4">
45+
<CardContent className="grid gap-4 p-4 pt-0">
4646
<form
4747
onSubmit={handleSubmit(onSubmit)}
4848
className="grid gap-3.5 md:grid-cols-2"
@@ -99,7 +99,7 @@ export default function Courses() {
9999
required
100100
{...register('discordRoleId', { required: true })}
101101
/>
102-
<div className="flex flex-1 w-full justify-center">
102+
<div className="flex w-full flex-1 justify-center">
103103
<Button type="submit">Create</Button>
104104
</div>
105105
</form>

src/app/admin/user/LogoutUser.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ const LogoutUserComp = () => {
2020
};
2121
return (
2222
<form onSubmit={handlLogout} ref={formRef}>
23-
<div className="w-full max-w-sm rounded-lg border border-gray-200 grid grid-rows-5 shadow-sm dark:border-gray-800">
24-
<div className="p-6 grid gap-2 items-center row-span-3">
23+
<div className="grid w-full max-w-sm grid-rows-5 rounded-lg border border-gray-200 shadow-sm dark:border-gray-800">
24+
<div className="row-span-3 grid items-center gap-2 p-6">
2525
<div className="text-3xl font-bold">Logout the user</div>
2626
<div className="text-sm font-medium leading-none text-gray-500 dark:text-gray-400">
2727
Enter the information below to logout the user
2828
</div>
2929
</div>
3030

31-
<div className="p-6 flex items-center row-span-2">
31+
<div className="row-span-2 flex items-center p-6">
3232
<Label className="sr-only">EMAIL</Label>
3333
<Input
3434
className="w-full"
@@ -40,7 +40,7 @@ const LogoutUserComp = () => {
4040
}}
4141
/>
4242
</div>
43-
<div className="p-6 flex items-center row-span-2">
43+
<div className="row-span-2 flex items-center p-6">
4444
<Label className="sr-only">Admin password</Label>
4545
<Input
4646
className="w-full"
@@ -52,7 +52,7 @@ const LogoutUserComp = () => {
5252
}}
5353
/>
5454
</div>
55-
<div className="p-6 flex items-center justify-center row-span-2">
55+
<div className="row-span-2 flex items-center justify-center p-6">
5656
<Button className="w-full">Logout</Button>
5757
</div>
5858
</div>

src/app/admin/user/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import LogoutUserComp from './LogoutUser';
33

44
const UserAdminPage = () => {
55
return (
6-
<div className="flex justify-center h-[100dvh] items-center">
6+
<div className="flex h-[100dvh] items-center justify-center">
77
<LogoutUserComp />
88
</div>
99
);

src/app/admin/userflags/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export default function DiscordPage() {
1212
const [adminSecret, setAdminSecret] = useState('');
1313
const [contentId, setContentId] = useState('');
1414
return (
15-
<div className="flex flex-col lg:flex-row justify-between p-2 sm:p-10 gap-2">
16-
<form className="flex flex-col gap-5 w-full p-5 border rounded-xl items-center">
15+
<div className="flex flex-col justify-between gap-2 p-2 sm:p-10 lg:flex-row">
16+
<form className="flex w-full flex-col items-center gap-5 rounded-xl border p-5">
1717
<h1 className="text-xl sm:text-2xl md:text-4xl">Toggle DRM</h1>
1818
<Input
1919
placeholder="email"
@@ -33,7 +33,7 @@ export default function DiscordPage() {
3333
/>
3434

3535
<Button
36-
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded w-full"
36+
className="w-full rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700"
3737
onClick={async () => {
3838
await fetch('/api/admin/drm', {
3939
body: JSON.stringify({
@@ -51,7 +51,7 @@ export default function DiscordPage() {
5151
Enable DRM
5252
</Button>
5353
<Button
54-
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded w-full"
54+
className="w-full rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700"
5555
onClick={async () => {
5656
await fetch('/api/admin/drm', {
5757
body: JSON.stringify({
@@ -71,17 +71,17 @@ export default function DiscordPage() {
7171
</form>
7272

7373
<br />
74-
<div className="flex flex-col items-center gap-5 border rounded-lg px-2">
74+
<div className="flex flex-col items-center gap-5 rounded-lg border px-2">
7575
<br />
76-
<h2 className="text-xl sm:text-2xl md:text-4xl text-center">
76+
<h2 className="text-center text-xl sm:text-2xl md:text-4xl">
7777
Add video metadata
7878
</h2>
7979

8080
<Textarea
8181
// style={{ width: 800 }}
8282
rows={10}
8383
placeholder="segments json"
84-
className="text-black dark:text-white w-[80vw] lg:w-[800px]"
84+
className="w-[80vw] text-black dark:text-white lg:w-[800px]"
8585
onChange={(e) => {
8686
setSegmentsJson(e.target.value);
8787
}}
@@ -105,7 +105,7 @@ export default function DiscordPage() {
105105

106106
<h1>JSON is validated in the form.</h1>
107107
<Button
108-
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
108+
className="rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700"
109109
onClick={async () => {
110110
if (!isValidJsonString(segmentsJson)) {
111111
return toast.warning('Not a valid JSON');

src/app/bookmarks/loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CourseSkeleton } from '@/components/CourseCard';
22

33
export default function Loading() {
44
return (
5-
<div className="max-w-screen-xl justify-between mx-auto p-4 cursor-pointer grid grid-cols-1 gap-5 md:grid-cols-3">
5+
<div className="mx-auto grid max-w-screen-xl cursor-pointer grid-cols-1 justify-between gap-5 p-4 md:grid-cols-3">
66
{[1, 2, 3].map((v) => (
77
<CourseSkeleton key={v} />
88
))}

src/app/certificate/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const CertificatePage = async () => {
55
const certificates = await getCertificates();
66

77
return (
8-
<section className="flex flex-wrap justify-center items-center w-full">
8+
<section className="flex w-full flex-wrap items-center justify-center">
99
{certificates?.map(({ cert, course, user }) => (
1010
<CertificateComponent
1111
certificateId={cert.id}

src/app/courses/[courseId]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const Layout = async ({
5151
return (
5252
<div className="flex h-full">
5353
<Sidebar fullCourseContent={fullCourseContent} courseId={courseId[0]} />
54-
<div className="grow p-2 overflow-y-auto no-scrollbar">{children}</div>
54+
<div className="no-scrollbar grow overflow-y-auto p-2">{children}</div>
5555
</div>
5656
);
5757
};

src/app/courses/loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CourseSkeleton } from '@/components/CourseCard';
44

55
export default function Loading() {
66
return (
7-
<div className="max-w-screen-xl justify-between mx-auto p-4 cursor-pointer grid grid-cols-1 gap-5 md:grid-cols-3">
7+
<div className="mx-auto grid max-w-screen-xl cursor-pointer grid-cols-1 justify-between gap-5 p-4 md:grid-cols-3">
88
{[1, 2, 3].map((v) => (
99
<CourseSkeleton key={v} />
1010
))}

src/app/history/loading.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import { Fragment } from 'react';
22

33
export default function Loading() {
44
return (
5-
<div className="px-4 md:px-20 py-5">
6-
<div className="rounded bg-slate-50 dark:bg-slate-900 h-8 w-40"></div>
7-
<div className="flex flex-col gap-4 my-4 sm:my-8 max-w-full">
5+
<div className="px-4 py-5 md:px-20">
6+
<div className="h-8 w-40 rounded bg-slate-50 dark:bg-slate-900"></div>
7+
<div className="my-4 flex max-w-full flex-col gap-4 sm:my-8">
88
{[1, 2].map((_, index) => {
99
return (
1010
<Fragment key={index}>
11-
<div className="rounded bg-slate-50 dark:bg-slate-900 h-6 w-20"></div>
11+
<div className="h-6 w-20 rounded bg-slate-50 dark:bg-slate-900"></div>
1212
<div className="flex items-center gap-6">
1313
{[1, 2, 3, 4].map((_, index) => (
1414
<div>
1515
<div
16-
className="w-[260px] h-36 bg-slate-50 dark:bg-slate-900 rounded-md"
16+
className="h-36 w-[260px] rounded-md bg-slate-50 dark:bg-slate-900"
1717
key={index}
1818
/>
19-
<div className="rounded my-4 bg-slate-50 dark:bg-slate-900 h-4 w-full"></div>
19+
<div className="my-4 h-4 w-full rounded bg-slate-50 dark:bg-slate-900"></div>
2020
</div>
2121
))}
2222
</div>

0 commit comments

Comments
 (0)