diff --git a/next.config.ts b/next.config.ts index 71eb1b1..6cf9865 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,6 +2,10 @@ import type { NextConfig } from 'next' const nextConfig: NextConfig = { output: 'standalone', + compiler: { + removeConsole: + process.env.NODE_ENV === 'production' ? { exclude: ['error'] } : false, + }, env: { NEXT_PUBLIC_LIFF_ID: process.env.NEXT_PUBLIC_LIFF_ID, NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL, diff --git a/package.json b/package.json index 80f5561..c5dfee4 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@hookform/resolvers": "^4.1.2", "@line/liff": "^2.25.1", "@mynaui/icons-react": "^0.3.3", + "@radix-ui/react-dialog": "^1.1.6", "@radix-ui/react-dropdown-menu": "^2.1.6", "@radix-ui/react-label": "^2.1.2", "@radix-ui/react-select": "^2.1.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 685b2bc..fce21be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: '@mynaui/icons-react': specifier: ^0.3.3 version: 0.3.3(react@19.0.0) + '@radix-ui/react-dialog': + specifier: ^1.1.6 + version: 1.1.6(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@radix-ui/react-dropdown-menu': specifier: ^2.1.6 version: 2.1.6(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -122,7 +125,7 @@ importers: version: 15.1.7(eslint@8.57.1)(typescript@5.8.2) eslint-plugin-import: specifier: ^2.31.0 - version: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + version: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3)(eslint@8.57.1) eslint-plugin-jest: specifier: ^27.9.0 version: 27.9.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)(typescript@5.8.2) @@ -856,6 +859,19 @@ packages: '@types/react': optional: true + '@radix-ui/react-dialog@1.1.6': + resolution: {integrity: sha512-/IVhJV5AceX620DUJ4uYVMymzsipdKBzo3edo+omeskCKGm9FRHM0ebIdbPnlQVJqyuHbuBltQUOG2mOTq2IYw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-direction@1.1.0': resolution: {integrity: sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg==} peerDependencies: @@ -4905,6 +4921,28 @@ snapshots: optionalDependencies: '@types/react': 19.0.10 + '@radix-ui/react-dialog@1.1.6(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.10)(react@19.0.0) + '@radix-ui/react-context': 1.1.1(@types/react@19.0.10)(react@19.0.0) + '@radix-ui/react-dismissable-layer': 1.1.5(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-focus-guards': 1.1.1(@types/react@19.0.10)(react@19.0.0) + '@radix-ui/react-focus-scope': 1.1.2(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-id': 1.1.0(@types/react@19.0.10)(react@19.0.0) + '@radix-ui/react-portal': 1.1.4(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-primitive': 2.0.2(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-slot': 1.1.2(@types/react@19.0.10)(react@19.0.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.10)(react@19.0.0) + aria-hidden: 1.2.4 + react: 19.0.0 + react-dom: 19.0.0(react@19.0.0) + react-remove-scroll: 2.6.3(@types/react@19.0.10)(react@19.0.0) + optionalDependencies: + '@types/react': 19.0.10 + '@types/react-dom': 19.0.4(@types/react@19.0.10) + '@radix-ui/react-direction@1.1.0(@types/react@19.0.10)(react@19.0.0)': dependencies: react: 19.0.0 @@ -5388,10 +5426,10 @@ snapshots: '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)(typescript@5.8.2) '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.8.2) eslint-config-prettier: 9.1.0(eslint@8.57.1) - eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)) - eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.31.0) + eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0)(eslint@8.57.1) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.1) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3)(eslint@8.57.1) eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)(typescript@5.8.2) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.57.1) eslint-plugin-playwright: 1.8.3(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1) @@ -6026,8 +6064,8 @@ snapshots: '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.8.2) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3)(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.57.1) eslint-plugin-react: 7.37.4(eslint@8.57.1) eslint-plugin-react-hooks: 5.2.0(eslint@8.57.1) @@ -6042,9 +6080,9 @@ snapshots: dependencies: eslint: 8.57.1 - eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1)): + eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.31.0): dependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3)(eslint@8.57.1) eslint-import-resolver-node@0.3.9: dependencies: @@ -6054,7 +6092,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1): + eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0)(eslint@8.57.1): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.0 @@ -6065,18 +6103,18 @@ snapshots: stable-hash: 0.0.4 tinyglobby: 0.2.12 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3)(eslint@8.57.1) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.8.2) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0)(eslint@8.57.1) transitivePeerDependencies: - supports-color @@ -6086,7 +6124,7 @@ snapshots: eslint: 8.57.1 ignore: 5.3.2 - eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.8.3)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -6097,7 +6135,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 diff --git a/public/assets/homepage/chula_for_all.svg b/public/assets/homepage/chula_for_all.svg new file mode 100644 index 0000000..be9e4d4 --- /dev/null +++ b/public/assets/homepage/chula_for_all.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/public/assets/homepage/crown.svg b/public/assets/homepage/crown.svg new file mode 100644 index 0000000..6a875c1 --- /dev/null +++ b/public/assets/homepage/crown.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/public/assets/homepage/dice.svg b/public/assets/homepage/dice.svg new file mode 100644 index 0000000..aa9b813 --- /dev/null +++ b/public/assets/homepage/dice.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/public/assets/homepage/instagram.svg b/public/assets/homepage/instagram.svg new file mode 100644 index 0000000..74ad6c4 --- /dev/null +++ b/public/assets/homepage/instagram.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/assets/homepage/person1.svg b/public/assets/homepage/person1.svg new file mode 100644 index 0000000..741fbed --- /dev/null +++ b/public/assets/homepage/person1.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/homepage/person2.svg b/public/assets/homepage/person2.svg new file mode 100644 index 0000000..f9997f2 --- /dev/null +++ b/public/assets/homepage/person2.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/homepage/ribbon.svg b/public/assets/homepage/ribbon.svg new file mode 100644 index 0000000..7d9a2b6 --- /dev/null +++ b/public/assets/homepage/ribbon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/assets/homepage/special_text.svg b/public/assets/homepage/special_text.svg new file mode 100644 index 0000000..4c2bc92 --- /dev/null +++ b/public/assets/homepage/special_text.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/public/assets/homepage/star.svg b/public/assets/homepage/star.svg new file mode 100644 index 0000000..7d70db8 --- /dev/null +++ b/public/assets/homepage/star.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/assets/homepage/star_pink.svg b/public/assets/homepage/star_pink.svg new file mode 100644 index 0000000..f2acfd6 --- /dev/null +++ b/public/assets/homepage/star_pink.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/assets/homepage/star_yellow.svg b/public/assets/homepage/star_yellow.svg new file mode 100644 index 0000000..912add4 --- /dev/null +++ b/public/assets/homepage/star_yellow.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..42eee46 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/app/(app)/page.tsx b/src/app/(app)/page.tsx index f1f5089..080ac6b 100644 --- a/src/app/(app)/page.tsx +++ b/src/app/(app)/page.tsx @@ -8,6 +8,7 @@ import Faq from '@/components/homepage/faq' import Footer from '@/components/homepage/footer' import Imageslider from '@/components/homepage/imageslider' import Navbar from '@/components/homepage/navbar' +import Popup from '@/components/homepage/popup' import Timer from '@/components/homepage/timer' import { Button } from '@/components/ui/button' import { @@ -20,10 +21,18 @@ import { getTimer } from '@/utils/timer' const Home: React.FC = () => { const { isAuthenticated } = useAuth() const isRegistered = isAuthenticated - const [currentTimeLeft, setCurrentTimeLeft] = useState(null) + const openRegisteredDate = new Date('2025-03-14T00:00:00').getTime() + const [timeLeft, setTimeLeft] = useState | null>( + null + ) useEffect(() => { - setCurrentTimeLeft(getTimer().time_left) + setTimeLeft(getTimer()) + const interval = setInterval(() => { + setTimeLeft(getTimer()) + }, 1000) + + return () => clearInterval(interval) }, []) const actionButtonsDetail = isRegistered @@ -32,6 +41,7 @@ const Home: React.FC = () => { return (
+ @@ -46,11 +56,9 @@ const Home: React.FC = () => {

- {currentTimeLeft !== 0 && ( -

+ {timeLeft && timeLeft.nowDate < openRegisteredDate ?

พร้อมลงทะเบียนวันที่ 14 มีนาคมนี้ -

- )} +

: null} )}
diff --git a/src/app/favicon.ico b/src/app/favicon.ico deleted file mode 100644 index 718d6fe..0000000 Binary files a/src/app/favicon.ico and /dev/null differ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f6ca4a1..23e09c6 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -15,6 +15,9 @@ const RootLayout: React.FC> = ({ ubuntu.variable )} > + + + {children} ) diff --git a/src/components/homepage/footer.tsx b/src/components/homepage/footer.tsx index 729194d..36960ab 100644 --- a/src/components/homepage/footer.tsx +++ b/src/components/homepage/footer.tsx @@ -1,6 +1,7 @@ 'use client' import Image from 'next/image' +import Link from 'next/link' import { config } from '@/app/config' @@ -27,6 +28,145 @@ const Footer: React.FC = () => {
*/} {/* Footer Part 2 */} +
+ {/* Left Part */} +
+ {/* Logo */} +
+
+ logo +
+ {/* Header Text */} +
+

+ YOUR JOURNEY TO +

+

+ CHULA STARTS HERE! +

+
+
+ + {/* Right Part */} +
+ {/* Logo */} +
+ {/* Star Left */} + star_left + + {/* Star Right */} + star_right + + {/* Text */} +
+ special_text +
+ + {/* Dice */} +
+ dice +
+
+ + {/* Title */} +
+
+
+

+ ลุ้นรับโอกาสในการคุยกับพี่จุฬาฯตัวจริง +

+
+
+
+

+ โดย #ที่1บัญชี (TCAS66) และ #ที่1แพทย์ฯ(TCAS67) +

+
+
+ + {/* Instagram */} +
+ {/* Ribbon Left */} + ribbon + + {/* Ribbon Right */} + ribbon + {/* Left Text */} +
+

+ Don't Miss! + star_pink +

+

+ Come and find out, +

+
+ {/* Right Button */} + + instagram +

+ @chulaforall +

+ +
+
+
+ + {/* Footer Part 3 */}
logo { + const [open, setOpen] = useState(false) + + useEffect(() => { + setOpen(true) + }, []) + + return ( + + + {/* Header */} + + + + Close + +
+ {/* Logo */} +
+
+ logo +
+ {/* Header Text */} +
+ + YOUR JOURNEY TO + + + CHULA STARTS HERE! + +
+
+ + + {/* Content */} +
+
+ {/* Box1 Logo */} +
+
+ dice +
+

+ Motivational Postcard! +

+ + {/* Ribbon Left */} + ribbon + + {/* Ribbon Right */} + ribbon + + {/* Left Box */} +

+ Cute Stickers +

+ + {/* Right Box */} +

+ Stylish Tote bag +

+
+ + {/* Box 1 Content */} +
+ {/* Star Left */} + instagram + {/* Star Right */} + instagram + {/* Title */} +

+ Special! +

+ {/* Subtitle */} +
+

+ ลุ้นรับโอกาสในการคุยกับพี่จุฬาฯตัวจริง +

+

+ ด้วยคะแนนสอบเข้า TCAS อันดับ 1 ของประเทศ! +

+
+ {/* Persons */} +
+ {/* Person1 */} +
+
+ crown +

+ ที่1 บัญชี +

+
+ person1 +
+

+ P' Zeta +

+

+ #Dek66 +

+
+
+ {/* Person2 */} +
+
+ crown +

+ ที่1 แพทย์ฯ +

+
+ person2 +
+

+ P' Tonkao +

+

+ #Dek67 +

+
+
+
+ {/* More Info */} +

+ *ที่นั่งมีจำนวนจำกัด: 1 กล่องต่อ 1 สิทธิ์ ในการลุ้น! +

+
+
+ + {/* Box2 */} +
+ {/* Star Left */} + instagram + {/* Star Right */} + instagram + +
+

+ Don't Miss! +

+

+ Come and find out here! +

+
+ + instagram +

+ @chulaforall +

+ +
+
+ + {/* Footer */} + +
+

+ *ร้านค้าโดยนิสิต ไม่มีส่วนเกี่ยวข้องกับจุฬาลงกรณ์มหาวิทยาลัย +

+

+ และโครงการ ChulaOpenhouse2025 +

+
+
+ +
+ ) +} + +export default Popup diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx new file mode 100644 index 0000000..9915e3d --- /dev/null +++ b/src/components/ui/dialog.tsx @@ -0,0 +1,122 @@ +'use client' + +import * as React from 'react' +import * as DialogPrimitive from '@radix-ui/react-dialog' +import { X } from 'lucide-react' + +import { cn } from '@/lib/cn' + +const Dialog = DialogPrimitive.Root + +const DialogTrigger = DialogPrimitive.Trigger + +const DialogPortal = DialogPrimitive.Portal + +const DialogClose = DialogPrimitive.Close + +const DialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName + +const DialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + {children} + + + Close + + + +)) +DialogContent.displayName = DialogPrimitive.Content.displayName + +const DialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogHeader.displayName = 'DialogHeader' + +const DialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogFooter.displayName = 'DialogFooter' + +const DialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogTitle.displayName = DialogPrimitive.Title.displayName + +const DialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogDescription.displayName = DialogPrimitive.Description.displayName + +export { + Dialog, + DialogPortal, + DialogOverlay, + DialogTrigger, + DialogClose, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, +} diff --git a/src/utils/timer.ts b/src/utils/timer.ts index 40d069b..10af607 100644 --- a/src/utils/timer.ts +++ b/src/utils/timer.ts @@ -1,18 +1,28 @@ export const getTimer = ( - targetDate = '2025-03-14T00:00:00' + targetDate = '2025-03-29T08:00:00' ): { days: number hours: number minutes: number seconds: number time_left: number + targetDate: number + nowDate: number } => { const target = new Date(targetDate).getTime() const now = new Date().getTime() const diff = target - now if (diff <= 0) { - return { days: 0, hours: 0, minutes: 0, seconds: 0, time_left: 0 } + return { + days: 0, + hours: 0, + minutes: 0, + seconds: 0, + time_left: 0, + targetDate: target, + nowDate: now, + } } return { @@ -21,5 +31,7 @@ export const getTimer = ( minutes: Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)), seconds: Math.floor((diff % (1000 * 60)) / 1000), time_left: diff, + targetDate: target, + nowDate: now, } }