Skip to content

Commit f09df7d

Browse files
committed
feat: loading page
1 parent 218b7ea commit f09df7d

File tree

8 files changed

+46
-6
lines changed

8 files changed

+46
-6
lines changed

app/academia/calendar/components/Grid.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function CalendarGrid({
3535
const todayRef = useRef<HTMLDivElement>(null);
3636
const head = useRef<HTMLDivElement>(null);
3737

38-
const days = calendar[month].days;
38+
const days = calendar?.[month]?.days;
3939

4040
const getFirstDayIndex = () => weekdays.indexOf(days?.[0]?.day);
4141

app/academia/components/Attendance/Prediction/Predictor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default function Predictor({
7171
}, []);
7272

7373
useEffect(() => {
74-
if (categorizedRanges?.[0]) {
74+
if (categorizedRanges && categorizedRanges.length > 0) {
7575
const att = predictAttendance(
7676
original,
7777
data.timetable.schedule,

app/globals.css

+19
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ layer(base);
3333
cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
3434
--animate-text-slide-down: textSlideDown 0.5s ease-in-out forwards;
3535
--animate-text-slide-left: textSlideLeft 0.5s ease-in-out forwards;
36+
--animate-hourglass: hourglass 2s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
3637
--animate-text-slide-right: textSlideRight 0.5s ease-in-out forwards;
3738
--animate-shrink: shrink 1s ease forwards;
3839

@@ -328,3 +329,21 @@ layer(base);
328329
transform: translate(5px, 5px);
329330
}
330331
}
332+
333+
@keyframes hourglass {
334+
0% {
335+
transform: rotate(0deg);
336+
}
337+
25% {
338+
transform: rotate(180deg);
339+
}
340+
50% {
341+
transform: rotate(180deg);
342+
}
343+
75% {
344+
transform: rotate(360deg);
345+
}
346+
100% {
347+
transform: rotate(360deg);
348+
}
349+
}

app/loading.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react'
2+
import { FaHourglassStart } from 'react-icons/fa6'
3+
4+
export default function loading() {
5+
return (
6+
<div className="flex w-screen h-screen animate-fadeIn flex-col items-center justify-center rounded-2xl bg-light-button text-light-accent dark:bg-dark-button dark:text-dark-accent">
7+
<FaHourglassStart
8+
title="loading"
9+
className={`h-96 animate-hourglass text-5xl font-medium text-light-accent dark:text-dark-accent`}
10+
/>
11+
</div>
12+
)
13+
}

bun.lock

+9
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@types/react": "^19.0.8",
3939
"@types/react-dom": "^19.0.3",
4040
"all-contributors-cli": "^6.26.1",
41+
"babel-plugin-react-compiler": "^19.0.0-beta-27714ef-20250124",
4142
"eslint": "^9.19.0",
4243
"eslint-config-next": "15.1.6",
4344
"postcss": "^8.5.1",
@@ -50,8 +51,14 @@
5051
"packages": {
5152
"@alloc/quick-lru": ["@alloc/quick-lru@5.2.0", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="],
5253

54+
"@babel/helper-string-parser": ["@babel/helper-string-parser@7.25.9", "", {}, "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA=="],
55+
56+
"@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.25.9", "", {}, "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ=="],
57+
5358
"@babel/runtime": ["@babel/runtime@7.26.7", "", { "dependencies": { "regenerator-runtime": "^0.14.0" } }, "sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ=="],
5459

60+
"@babel/types": ["@babel/types@7.26.7", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg=="],
61+
5562
"@builder.io/partytown": ["@builder.io/partytown@0.10.3", "", { "bin": { "partytown": "bin/partytown.cjs" } }, "sha512-N2SWA3c5vEad3rgdAFM3zMb6uc7aXqibkgAz4ijvYzycgQXJ4dE5oH6fGFMXSQWj6ayVlLT1/CmpflYUJHfmQg=="],
5663

5764
"@date-fns/tz": ["@date-fns/tz@1.2.0", "", {}, "sha512-LBrd7MiJZ9McsOgxqWX7AaxrDjcFVjWH/tIKJd7pnR7McaslGYOP1QmmiBXdJH/H/yLCT+rcQ7FaPBUxRGUtrg=="],
@@ -368,6 +375,8 @@
368375

369376
"axobject-query": ["axobject-query@4.1.0", "", {}, "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ=="],
370377

378+
"babel-plugin-react-compiler": ["babel-plugin-react-compiler@19.0.0-beta-27714ef-20250124", "", { "dependencies": { "@babel/types": "^7.19.0" } }, "sha512-1AnF/dlvbIJzAjw5jEbDx7csHx772VP9AtrEg2CgUUD6MIu24j5ShxmBZ0tpfdb2pZtLVwcsoGylfZTzUoCr9w=="],
379+
371380
"balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
372381

373382
"base64-js": ["base64-js@0.0.8", "", {}, "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw=="],

hooks/fetchUserData.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ async function fetchData(): Promise<AllResponse> {
2222
const controller = new AbortController();
2323
const timeoutId = setTimeout(() => {
2424
controller.abort();
25-
try {
26-
redirect("/sleeping");
27-
} catch {}
25+
redirect("/sleeping");
2826
}, 10000);
2927

3028
try {

next.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const nextConfig: NextConfig = {
2323
compress: true,
2424
eslint: { ignoreDuringBuilds: true },
2525
experimental: {
26-
// reactCompiler: true,
26+
reactCompiler: true,
2727
// parallelServerCompiles: true,
2828
nextScriptWorkers: true,
2929
// useLightningcss: true,

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@types/react": "^19.0.8",
4545
"@types/react-dom": "^19.0.3",
4646
"all-contributors-cli": "^6.26.1",
47+
"babel-plugin-react-compiler": "^19.0.0-beta-27714ef-20250124",
4748
"eslint": "^9.19.0",
4849
"eslint-config-next": "15.1.6",
4950
"postcss": "^8.5.1",

0 commit comments

Comments
 (0)