Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nehhhhha6 committed Jan 2, 2025
1 parent 98f0efd commit b37393b
Show file tree
Hide file tree
Showing 9 changed files with 587 additions and 295 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ CLERK_SECRET_KEY=sk_test_1cmLGX7ElOAjcVMK1YpsgmmnoYNsgrBInOnfG3oEFm
DATABASE_URL=postgresql://neondb_owner:[email protected]/neondb?
sslmode=require

UPLOADTHING_TOKEN='eyJhcGlLZXkiOiJza19saXZlXzQ5OGNkOWQ4YjlkNTgyZWFjMzc2MjE0Y2E5OGJjMjNmZWI3Y2MzZDk1ODYxNTNmYTRhMzk4ZDFhZWVlMDkyOTQiLCJhcHBJZCI6Im05bGM5MTFiZG4iLCJyZWdpb25zIjpbInNlYTEiXX0='
14 changes: 14 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
},
serverExternalPackages: ["@clerk/nextjs"],
};

module.exports = nextConfig;
739 changes: 506 additions & 233 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@clerk/nextjs": "^6.9.6",
"@clerk/nextjs": "^5.0.0-beta.46",
"@prisma/client": "^6.1.0",
"@radix-ui/react-alert-dialog": "^1.1.4",
"@radix-ui/react-avatar": "^1.1.2",
Expand Down
2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ClerkProvider } from "@clerk/nextjs";
import { ThemeProvider } from "@/components/ThemeProvider";
import Navbar from "@/components/Navbar";
import Sidebar from "@/components/Sidebar";
import { Toaster } from "react-hot-toast";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
Expand Down Expand Up @@ -54,6 +55,7 @@ export default function RootLayout({
</div>
</main>
</div>
<Toaster />
</ThemeProvider>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion src/app/profile/[username]/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function NotFound() {
User not found
</h1>
<p className="text-muted-foreground">
The user you're looking for doesn't exist.
The user you are looking for does not exist
</p>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/app/profile/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export async function generateMetadata({
const user = await getProfileByUsername(params.username);
if (!user)
return {
title: "User Not Found",
description: "This user profile could not be found.",
title: "User not found",
description: "This user does not exist",
};

return {
Expand Down
8 changes: 4 additions & 4 deletions src/components/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
toggleLike,
} from "@/actions/post.action";
import { SignInButton, useUser } from "@clerk/nextjs";
import { useState, useEffect } from "react";
import { useState, useEffect, useCallback } from "react";
import toast from "react-hot-toast";
import { Card, CardContent } from "./ui/card";
import Link from "next/link";
Expand Down Expand Up @@ -75,7 +75,7 @@ function PostCard({ post, dbUserId }: { post: Post; dbUserId: string | null }) {
}
};

const handleDeletePost = async () => {
const handleDeletePost = useCallback(async () => {
if (isDeleting) return;
try {
setIsDeleting(true);
Expand All @@ -89,13 +89,13 @@ function PostCard({ post, dbUserId }: { post: Post; dbUserId: string | null }) {
} finally {
setIsDeleting(false);
}
};
}, [isDeleting, post.id]);

useEffect(() => {
const handler = () => handleDeletePost();
window.addEventListener("deletePost", handler);
return () => window.removeEventListener("deletePost", handler);
}, []);
}, [handleDeletePost]);

return (
<Card className="overflow-hidden">
Expand Down
110 changes: 56 additions & 54 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,65 @@
import type { Config } from "tailwindcss";
import { withUt } from "uploadthing/tw";
import animate from "tailwindcss-animate";

const config: Config = {
darkMode: ["class"],
content: [
const config: Config = withUt({
darkMode: ["class"],
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
colors: {
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))'
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))'
},
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))'
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))'
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))'
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))'
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))'
},
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
chart: {
'1': 'hsl(var(--chart-1))',
'2': 'hsl(var(--chart-2))',
'3': 'hsl(var(--chart-3))',
'4': 'hsl(var(--chart-4))',
'5': 'hsl(var(--chart-5))'
}
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)'
}
}
extend: {
colors: {
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
chart: {
"1": "hsl(var(--chart-1))",
"2": "hsl(var(--chart-2))",
"3": "hsl(var(--chart-3))",
"4": "hsl(var(--chart-4))",
"5": "hsl(var(--chart-5))",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
},
},
plugins: [require("tailwindcss-animate")],
};
plugins: [animate],
});
export default config;

0 comments on commit b37393b

Please sign in to comment.