Skip to content

Commit

Permalink
Merge branch 'main' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
hkirat authored Mar 10, 2024
2 parents 8de4855 + 2b4c25b commit 68e67cc
Show file tree
Hide file tree
Showing 16 changed files with 120 additions and 383 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ BOT_TOKEN = "123"
GUILD_ID = "123"
LOCAL_CMS_PROVIDER = true
CACHE_EXPIRE_S = 10

ADMINS = "Random,[email protected]"
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: npm install --legacy-peer-deps

- name: Run linting check
run: npm run lint:fix
run: npm run lint:check

- name: Check formatting
run: npm run format:fix
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"format:check": "prettier --check \"**/*.{ts,tsx,json}\"",
"dev:docker": "npm run prisma:migrate && next dev",
"prisma:migrate": "prisma migrate deploy",
"prepare": "husky install"
"prepare": "husky install",
"studio": "prisma studio"
},
"dependencies": {
"@auth/prisma-adapter": "^1.0.6",
Expand Down
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,21 @@
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
}

/*Timestamp overlapping removal */

.vjs-play-progress .vjs-time-tooltip {
display: none !important;
}
.vjs-time-divider {
display: block !important;
}

.video-js .vjs-current-time{
display: block !important;
}

.vjs-duration {
display: block !important;
}
7 changes: 6 additions & 1 deletion src/components/NotionRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export const NotionRenderer = ({ id }: { id: string }) => {
return (
<div>
<div style={{}}>
<NotionRendererLib recordMap={data} fullPage={true} darkMode={true} />
<NotionRendererLib
recordMap={data}
fullPage={true}
darkMode={true}
className="z-10"
/>
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function Sidebar({
value={`item-${content.id}`}
className="text-gray-900 dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer"
>
<AccordionTrigger className="px-2">
<AccordionTrigger className="px-2 text-left">
{content.title}
</AccordionTrigger>
<AccordionContent className="p-0 m-0">
Expand Down
13 changes: 11 additions & 2 deletions src/components/Signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ const Signin = () => {
const router = useRouter();
const email = useRef('');
const password = useRef('');
const handleSubmit = async (e: React.FormEvent<HTMLButtonElement>) => {
e.preventDefault();

const handleSubmit = async (e?: React.FormEvent<HTMLButtonElement>) => {
if (e) {
e.preventDefault();
}

if (!email.current || !password.current) {
setRequiredError({
Expand Down Expand Up @@ -92,6 +95,12 @@ const Signin = () => {
}));
password.current = e.target.value;
}}
onKeyDown={async (e) => {
if (e.key === 'Enter') {
setIsPasswordVisible(false);
handleSubmit();
}
}}
/>
<button
className="inset-y-0 right-0 flex items-center px-4 text-gray-600"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ThemeToggler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function ThemeToggler() {
<span className="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuContent align="end" className=" z-[200]">
<DropdownMenuItem onClick={() => setTheme('light')}>
Light
</DropdownMenuItem>
Expand Down
4 changes: 2 additions & 2 deletions src/components/VideoContentChapters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const VideoContentChapters = ({

return (
<div className="w-full lg:w-1/3 rounded-md shadow-md border text-sm">
<div className="flex items-center justify-between p-2 py-3 bg-[#212020]">
<div className="flex items-center justify-between p-2 py-3 dark:bg-[#212020] bg-[#F5F5F5]">
<span>Chapters</span>
<X onClick={onCancel} className="cursor-pointer" />
</div>
Expand All @@ -51,7 +51,7 @@ const VideoContentChapters = ({
}}
>
<span>{title}</span>
<div className="bg-[#263850] text-[#37A4FF] px-1.5 py-0.5 rounded">
<div className="dark:bg-[#263850] dark:text-[#37A4FF] bg-[#ffffff] text-[#040fff] px-1.5 py-0.5 rounded">
{formatTime(start)}
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/components/VideoPlayer2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ export const VideoPlayer: FunctionComponent<VideoPlayerProps> = ({
}
}, [searchParams, playerRef.current]);
return (
<div data-vjs-player>
<div
data-vjs-player
className="mx-auto md:max-w-[calc(100vw-3rem)] 2xl:max-w-[calc(100vw-17rem)]"
>
<div ref={videoRef} />
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/landing/appbar/nav-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function NavigationMenu() {
href={'https://harkirat.classx.co.in/new-courses'}
target="_blank"
>
<p className="text-black">Join now</p>
<p className="text-zinc-950 dark:text-white">Join now</p>
</Link>
</DrawerClose>
</Button>
Expand Down
46 changes: 26 additions & 20 deletions src/components/landing/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,32 @@ import Logo from '../logo/logo';
const Footer = () => {
return (
<div className="bottom-0 w-full p-4 bg-neutral-900 dark:bg-slate-900 px-6 lg:px-36">
<div className="md:max-w-screen-2xl mt-4 mb-20 mx-auto flex flex-col lg:flex-row items-start justify-between w-full">
<Logo onFooter={true} />

<div className="flex flex-col justify-center my-8 lg:my-0">
<h3 className="font-semibold text-neutral-100 mb-4">Quick Links</h3>
<Link href={'/tnc'} className="hover:text-blue-500 text-neutral-200">
Terms & Conditions
</Link>
<Link
href={'/privacy-policy'}
className="hover:text-blue-500 text-neutral-200"
>
Privacy Policy
</Link>
<Link
href={'/refund'}
className="hover:text-blue-500 text-neutral-200"
>
Refund & Cancellation
</Link>
<div className="md:max-w-screen-2xl mt-4 mx-auto flex flex-row items-start justify-between w-full">
<div className="flex flex-col md:flex-row w-3/5 md:justify-between">
<div className="flex">
<Logo onFooter={true} />
</div>
<div className="flex flex-col justify-center my-8 md:my-0">
<h3 className="font-semibold text-neutral-100 mb-4">Quick Links</h3>
<Link
href={'/tnc'}
className="hover:text-blue-500 text-neutral-200"
>
Terms & Conditions
</Link>
<Link
href={'/privacy-policy'}
className="hover:text-blue-500 text-neutral-200"
>
Privacy Policy
</Link>
<Link
href={'/refund'}
className="hover:text-blue-500 text-neutral-200"
>
Refund & Cancellation
</Link>
</div>
</div>

<div className="flex flex-col justify-center">
Expand Down
1 change: 1 addition & 0 deletions src/db/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export async function getAllVideos(): Promise<
const courses = await db.content.findMany({
where: {
type: 'video',
hidden: false,
},
});
Cache.getInstance().set('getAllVideos', [], courses);
Expand Down
5 changes: 5 additions & 0 deletions src/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ export const authOptions = {
if (session?.user) {
session.user.id = token.uid;
session.user.jwtToken = token.jwtToken;
session.user.role = process.env.ADMINS?.split(',').includes(
session.user.email,
)
? 'admin'
: 'user';
}

return session;
Expand Down
Loading

0 comments on commit 68e67cc

Please sign in to comment.