diff --git a/Dockerfile.prod b/Dockerfile.prod index 3f3e5efc5..b952d8dd4 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -1,17 +1,17 @@ FROM node:20-alpine AS build WORKDIR /usr/src/app -ARG DATABASE_URL +ARG DATABASE_URL +ENV DATABASE_URL=${DATABASE_URL} COPY . . RUN npm install -g pnpm && \ pnpm install && \ pnpm add sharp && \ - pnpm run build && \ - DATABASE_URL=$DATABASE_URL pnpm dlx prisma generate - + pnpm run build +RUN DATABASE_URL=${DATABASE_URL} pnpm dlx prisma generate FROM node:20-alpine AS run @@ -25,7 +25,7 @@ COPY --from=build --chown=1001:1001 usr/src/app/.next/static ./.next/static COPY --from=build --chown=1001:1001 usr/src/app/public ./public ENV NODE_ENV production -ENV PORT 3000 +ENV PORT 3000 ENV HOSTNAME "0.0.0.0" CMD [ "node", "server.js" ] \ No newline at end of file diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 976e9c458..4931b6ac4 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -33,7 +33,9 @@ export default function RootLayout({ children }: { children: ReactNode }) { )} > - + {children} diff --git a/src/components/ContentCard.tsx b/src/components/ContentCard.tsx index 8c8a76c4b..edc944e40 100644 --- a/src/components/ContentCard.tsx +++ b/src/components/ContentCard.tsx @@ -6,6 +6,7 @@ import VideoThumbnail from './videothumbnail'; import CardComponent from './CardComponent'; import { motion } from 'framer-motion'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip'; +import React from 'react'; export const ContentCard = ({ title, diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index b3841c077..d7b3fbe98 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -5,7 +5,7 @@ import { useSession } from 'next-auth/react'; import { usePathname, useRouter } from 'next/navigation'; import React, { useState, useCallback, useMemo } from 'react'; import Link from 'next/link'; -import { ArrowLeft, Menu, Search, X } from 'lucide-react'; +import { ArrowLeft, Menu, X } from 'lucide-react'; import { Button } from './ui/button'; import { AppbarAuth } from './AppbarAuth'; import ThemeToggler from './ThemeToggler'; diff --git a/src/components/ThemeToggler.tsx b/src/components/ThemeToggler.tsx index 88e613d88..473686f36 100644 --- a/src/components/ThemeToggler.tsx +++ b/src/components/ThemeToggler.tsx @@ -21,9 +21,7 @@ export default function ThemeToggler() { }; const toggleTheme = () => { - if (!document.startViewTransition) switchTheme(); - - document.startViewTransition(switchTheme); + switchTheme(); }; return ( diff --git a/src/components/comment/CommentInputForm.tsx b/src/components/comment/CommentInputForm.tsx index be991647e..753ce7525 100644 --- a/src/components/comment/CommentInputForm.tsx +++ b/src/components/comment/CommentInputForm.tsx @@ -42,11 +42,11 @@ const CommentInputForm = ({ setCommentText(''); }; - const isAllSpaces = (str: string): boolean => /^\s*$/.test(str); + const isAllSpaces = (str: string): boolean => (/^\s*$/).test(str); const isCommentValid = () => { return !isAllSpaces(commentText); - } + }; // Function to adjust the height of the textarea const adjustTextareaHeight = () => { @@ -58,11 +58,11 @@ const CommentInputForm = ({ useEffect(() => { if (!isCommentValid() || isLoading) { - setButtonDisabled(true) + setButtonDisabled(true); } else { - setButtonDisabled(false) + setButtonDisabled(false); } - }, [commentText]) + }, [commentText]); // Effect to handle the initial and dynamic height adjustment useEffect(() => { diff --git a/src/components/comment/CommentVoteForm.tsx b/src/components/comment/CommentVoteForm.tsx index 3ceedfcdd..98db02d55 100644 --- a/src/components/comment/CommentVoteForm.tsx +++ b/src/components/comment/CommentVoteForm.tsx @@ -64,7 +64,7 @@ const CommentVoteForm: React.FC = ({ } toast.promise( - execute({ voteType: newVoteType, commentId, currentPath }), + execute({ voteType: newVoteType, commentId, currentPath, slug: '' }), toastMessage, ); }; diff --git a/storybook/stories/components/CourseCard.stories.ts b/storybook/stories/components/CourseCard.stories.ts deleted file mode 100644 index 80f9a5301..000000000 --- a/storybook/stories/components/CourseCard.stories.ts +++ /dev/null @@ -1,83 +0,0 @@ -export const ButtonColor: Story = { - args: { - course: { - id: 1, - slug: 'course-slug', - appxCourseId: '1', - certIssued: false, - discordOauthUrl: 'https://discord.com/invite/WAaXacK9bh', // Added Discord link - discordRoleId: 'discord-role-id', - title: 'Course Title', - description: 'Course Description', - imageUrl: - 'https://appx-recordings.s3.ap-south-1.amazonaws.com/drm/100x/images/test1.png', - totalVideos: 10, - totalVideosWatched: 5, - openToEveryone: true, - }, - onClick: () => {}, - }, -}; - -export const SmallRoundedCard: Story = { - args: { - course: { - id: 1, - slug: 'course-slug', - appxCourseId: '1', - discordOauthUrl: 'https://discord.com/invite/WAaXacK9bh', // Added Discord link - certIssued: false, - discordRoleId: 'discord-role-id', - title: 'Course Title', - description: 'Course Description', - imageUrl: - 'https://appx-recordings.s3.ap-south-1.amazonaws.com/drm/100x/images/test1.png', - totalVideos: 10, - totalVideosWatched: 5, - openToEveryone: true, - }, - onClick: () => {}, - }, -}; - -export const MediumRoundedCard: Story = { - args: { - course: { - id: 1, - slug: 'course-slug', - appxCourseId: '1', - discordOauthUrl: 'https://discord.com/invite/WAaXacK9bh', // Added Discord link - certIssued: false, - discordRoleId: 'discord-role-id', - title: 'Course Title', - description: 'Course Description', - imageUrl: - 'https://appx-recordings.s3.ap-south-1.amazonaws.com/drm/100x/images/test1.png', - totalVideos: 10, - totalVideosWatched: 5, - openToEveryone: true, - }, - onClick: () => {}, - }, -}; - -export const LargeRoundedCard: Story = { - args: { - course: { - id: 1, - slug: 'course-slug', - appxCourseId: '1', - discordOauthUrl: 'https://discord.com/invite/WAaXacK9bh', // Added Discord link - certIssued: false, - discordRoleId: 'discord-role-id', - title: 'Course Title', - description: 'Course Description', - imageUrl: - 'https://appx-recordings.s3.ap-south-1.amazonaws.com/drm/100x/images/test1.png', - totalVideos: 10, - totalVideosWatched: 5, - openToEveryone: true, - }, - onClick: () => {}, - }, -};