Skip to content

Commit

Permalink
resolve all the problems related to build (code100x#1463)
Browse files Browse the repository at this point in the history
* fix build

* rm annoying spinner

* small addons
  • Loading branch information
devsargam authored Oct 8, 2024
1 parent a58690c commit 6a49a64
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 99 deletions.
10 changes: 5 additions & 5 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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" ]
4 changes: 3 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default function RootLayout({ children }: { children: ReactNode }) {
)}
>
<GoogleAnalytics />
<NextTopLoader />
<NextTopLoader
showSpinner={false}
/>
<Providers>
<Navbar />
{children}
Expand Down
1 change: 1 addition & 0 deletions src/components/ContentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 1 addition & 3 deletions src/components/ThemeToggler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export default function ThemeToggler() {
};

const toggleTheme = () => {
if (!document.startViewTransition) switchTheme();

document.startViewTransition(switchTheme);
switchTheme();
};

return (
Expand Down
10 changes: 5 additions & 5 deletions src/components/comment/CommentInputForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -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(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/comment/CommentVoteForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const CommentVoteForm: React.FC<CommentVoteFormProps> = ({
}

toast.promise(
execute({ voteType: newVoteType, commentId, currentPath }),
execute({ voteType: newVoteType, commentId, currentPath, slug: '' }),
toastMessage,
);
};
Expand Down
83 changes: 0 additions & 83 deletions storybook/stories/components/CourseCard.stories.ts

This file was deleted.

0 comments on commit 6a49a64

Please sign in to comment.