Skip to content

Commit

Permalink
💥 update nextjs15, react19, tailwindv4
Browse files Browse the repository at this point in the history
  • Loading branch information
nrmnqdds committed Feb 19, 2025
1 parent d42baf6 commit b09c8c8
Show file tree
Hide file tree
Showing 27 changed files with 1,225 additions and 1,798 deletions.
9 changes: 3 additions & 6 deletions app/(home)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ThemeSwitcher } from "@/components/ThemeSwitcher";
import FinancialDialog from "@/components/financial-dialog";
import ImaluumProvider from "@/context/ImaluumProvider";
import { getDate } from "@/lib/common/time";
import LOGO from "@/public/logo-landing-page.png";
import {
Dialog,
DialogPanel,
Expand All @@ -15,14 +14,13 @@ import {
import {
Bars3Icon,
CalendarIcon,
Cog6ToothIcon,
FlagIcon,
HomeIcon,
XMarkIcon,
} from "@heroicons/react/24/outline";
import Image from "next/image";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { usePathname } from "next/navigation";
import { Fragment, useEffect, useState } from "react";

const navigation = [
Expand All @@ -45,7 +43,6 @@ export default function HomeLayout({
children: React.ReactNode;
}) {
const pathname = usePathname();
const router = useRouter();

const [sidebarOpen, setSidebarOpen] = useState<boolean>(false);
const [currentTime, setCurrentTime] = useState<string>("00:00:00 AM");
Expand Down Expand Up @@ -132,7 +129,7 @@ export default function HomeLayout({
width={64}
height={64}
className="object-contain"
src={LOGO}
src="/logo-landing-page.png"
alt="Your Company"
/>
</div>
Expand Down Expand Up @@ -196,7 +193,7 @@ export default function HomeLayout({
width={64}
height={64}
className="object-contain"
src={LOGO}
src="/logo-landing-page.png"
alt="Your Company"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/(home)/result/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Page = () => {
{!result ? (
<div className="h-[500px] w-full flex flex-col items-center justify-center">
<LottiePlayer
animationData={require("../../../public/lottie/study.lottie")}
animationData={require("../../../assets/lottie/study.lottie")}
/>
<h1 className="text-lg md:text-5xl text-center font-bold text-white">
You have not taken any exams yet
Expand Down
4 changes: 2 additions & 2 deletions app/api/login/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export async function POST(request: NextRequest) {
const json = await res.json();

// Clear the cookie
cookies().delete("MOD_AUTH_CAS");
(await cookies()).delete("MOD_AUTH_CAS");

cookies().set("MOD_AUTH_CAS", json.data.token, {
(await cookies()).set("MOD_AUTH_CAS", json.data.token, {
path: "/",
});

Expand Down
2 changes: 1 addition & 1 deletion app/api/logout/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NextResponse } from "next/server";

export async function DELETE() {
// Clear the cookie
cookies().delete("MOD_AUTH_CAS");
(await cookies()).delete("MOD_AUTH_CAS");

return NextResponse.json({ success: true }, { status: 200 });
}
2 changes: 1 addition & 1 deletion app/api/profile/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function GET(request: NextRequest) {
try {
const response = await fetch(IMALUUM_HOME_PAGE, {
headers: {
Cookie: cookies().toString(),
Cookie: (await cookies()).toString(),
},
});

Expand Down
2 changes: 1 addition & 1 deletion app/api/result/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { parse } from "node-html-parser";
import { getResultFromSession } from "@/lib/server/result";

export async function GET() {
const _cookies = cookies().toString();
const _cookies = (await cookies()).toString();

try {
const response = await fetch(IMALUUM_RESULT_PAGE, {
Expand Down
2 changes: 1 addition & 1 deletion app/api/schedule/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NextResponse } from "next/server";
import { parse } from "node-html-parser";

export async function GET() {
const _cookies = cookies().toString();
const _cookies = (await cookies()).toString();

try {
const response = await fetch(IMALUUM_SCHEDULE_PAGE, {
Expand Down
159 changes: 117 additions & 42 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -1,58 +1,133 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

@plugin "tailwindcss-animate";
@plugin "tailwind-scrollbar-hide";

@custom-variant dark (&:is(.dark *));

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 142.1 76.2% 36.3%;
--primary-foreground: 355.7 100% 97.3%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--ring: 142.1 76.2% 36.3%;
--radius: 0.5rem;
--background: hsl(0 0% 100%);
--foreground: hsl(240 10% 3.9%);
--card: hsl(0 0% 100%);
--card-foreground: hsl(240 10% 3.9%);
--popover: hsl(0 0% 100%);
--popover-foreground: hsl(240 10% 3.9%);
--primary: hsl(142.1 76.2% 36.3%);
--primary-foreground: hsl(355.7 100% 97.3%);
--secondary: hsl(240 4.8% 95.9%);
--secondary-foreground: hsl(240 5.9% 10%);
--muted: hsl(240 4.8% 95.9%);
--muted-foreground: hsl(240 3.8% 46.1%);
--accent: hsl(240 4.8% 95.9%);
--accent-foreground: hsl(240 5.9% 10%);
--destructive: hsl(0 84.2% 60.2%);
--destructive-foreground: hsl(0 0% 98%);
--border: hsl(240 5.9% 90%);
--input: hsl(240 5.9% 90%);
--ring: hsl(142.1 76.2% 36.3%);
--radius: 0.6rem;
}

.dark {
--background: 20 14.3% 4.1%;
--foreground: 0 0% 95%;
--card: 24 9.8% 10%;
--card-foreground: 0 0% 95%;
--popover: 0 0% 9%;
--popover-foreground: 0 0% 95%;
--primary: 142.1 70.6% 45.3%;
--primary-foreground: 144.9 80.4% 10%;
--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 15%;
--muted-foreground: 240 5% 64.9%;
--accent: 12 6.5% 15.1%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 85.7% 97.3%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 142.4 71.8% 29.2%;
--background: hsl(20 14.3% 4.1%);
--foreground: hsl(0 0% 95%);
--card: hsl(24 9.8% 10%);
--card-foreground: hsl(0 0% 95%);
--popover: hsl(0 0% 9%);
--popover-foreground: hsl(0 0% 95%);
--primary: hsl(142.1 70.6% 45.3%);
--primary-foreground: hsl(144.9 80.4% 10%);
--secondary: hsl(240 3.7% 15.9%);
--secondary-foreground: hsl(0 0% 98%);
--muted: hsl(0 0% 15%);
--muted-foreground: hsl(240 5% 64.9%);
--accent: hsl(12 6.5% 15.1%);
--accent-foreground: hsl(0 0% 98%);
--destructive: hsl(0 62.8% 30.6%);
--destructive-foreground: hsl(0 85.7% 97.3%);
--border: hsl(240 3.7% 15.9%);
--input: hsl(240 3.7% 15.9%);
--ring: hsl(142.4 71.8% 29.2%);
}
}

@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar: var(--sidebar-background);
--animate-accordion-down: accordion-down 0.2s ease-out;
--animate-accordion-up: accordion-up 0.2s ease-out;

@keyframes accordion-down {
from {
height: 0;
}

to {
height: var(--radix-accordion-content-height);
}
}

@keyframes accordion-up {
from {
height: var(--radix-accordion-content-height);
}

to {
height: 0;
}
}

@keyframes infinite-scroll {
from {
transform: translateX(0);
}

to {
transform: translateX(-100%);
}
}
}

@layer base {
* {
@apply border-border;
}

body {
@apply bg-background text-foreground;
}
Expand Down
4 changes: 2 additions & 2 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";

import React from "react";
import LottiePlayer from "@/components/LottiePlayer";
import React from "react";

const NotFound = () => {
return (
<main className="bg-zinc-900 w-full h-screen flex flex-col items-center justify-center p-24">
<LottiePlayer
animationData={require("../public/lottie/Animation - 1703013994707.lottie")}
animationData={require("../assets/lottie/Animation - 1703013994707.lottie")}
/>
</main>
);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 14 additions & 7 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true,
"ignore": [".next", "node_modules"]
"ignore": [
".next",
"node_modules"
]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"noArrayIndexKey": "off",
"noEmptyInterface": "off"
"noExplicitAny": "off"
},
"a11y": {
"useKeyWithClickEvents": "off",
"noSvgWithoutTitle": "off"
}
},
"ignore": [".next", "node_modules"]
"ignore": [
".next",
"node_modules"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"formatWithErrors": true,
"ignore": [".next", "node_modules"]
"ignore": [
".next",
"node_modules"
]
},
"javascript": {
"formatter": {
Expand Down
5 changes: 2 additions & 3 deletions components/LottiePlayer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"use client";

import { DotLottiePlayer } from "@dotlottie/react-player";
import "@dotlottie/react-player/dist/index.css";
import { DotLottieReact } from "@lottiefiles/dotlottie-react";

export default function LottiePlayer({
animationData,
...props
}: { animationData: any }) {
return <DotLottiePlayer src={animationData} {...props} autoplay loop />;
return <DotLottieReact src={animationData} {...props} autoplay loop />;
}
Loading

0 comments on commit b09c8c8

Please sign in to comment.