Skip to content

Commit

Permalink
Merge branch 'dev' into sun/fdr-77-register-done
Browse files Browse the repository at this point in the history
  • Loading branch information
TeeGoood authored Jul 28, 2024
2 parents ee8f782 + 026f55c commit 7054b74
Show file tree
Hide file tree
Showing 30 changed files with 519 additions and 86 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ NEXT_PUBLIC_RUP_PEUN_DATE= 2024-07-20
NEXT_PUBLIC_RPKM_DAY_1= 2025-08-03
NEXT_PUBLIC_RPKM_DAY_2= 2025-08-04
NEXT_PUBLIC_FRESHY_NIGHT= 2025-08-04T16:00:00.000Z
BASE_DOMAIN_IMAGES=
APP_ENV=
16 changes: 12 additions & 4 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ jobs:
build-args: |
APP_ENV=development
API_BASE_URL=${{ vars.DEV_API_BASE_URL }}
BAAN_ANNOUCE_DATE=${{ vars.DEV_BAAN_ANNOUCE_DATE }}
CLOSED_BAAN_SELECTION_DATE=${{ vars.DEV_CLOSED_BAAN_SELECTION_DATE }}
FIRST_DATE_DATE=${{ vars.DEV_FIRST_DATE_DATE }}
FRESHY_NIGHT_DATE=${{ vars.DEV_FRESHY_NIGHT_DATE }}
FRESHY_NIGHT_EVENT=${{ vars.DEV_FRESHY_NIGHT_EVENT }}
RPKM_DAY_1=${{ vars.DEV_RPKM_DAY_1 }}
RPKM_DAY_2=${{ vars.DEV_RPKM_DAY_2 }}
RUP_PEUN_DATE=${{ vars.DEV_RUP_PEUN_DATE }}
BASE_DOMAIN_IMAGES=${{ vars.DEV_BASE_DOMAIN_IMAGES }}
BAAN_ANNOUCE_DATE=${{ vars.DEV_BAAN_ANNOUCE_DATE }}
- name: Build and Push Docker Image (PROD)
uses: docker/build-push-action@v3
Expand All @@ -83,10 +87,14 @@ jobs:
build-args: |
APP_ENV=production
API_BASE_URL=${{ vars.PROD_API_BASE_URL }}
BAAN_ANNOUCE_DATE=${{ vars.PROD_BAAN_ANNOUCE_DATE }}
CLOSED_BAAN_SELECTION_DATE=${{ vars.PROD_CLOSED_BAAN_SELECTION_DATE }}
FIRST_DATE_DATE=${{ vars.PROD_FIRST_DATE_DATE }}
FRESHY_NIGHT_DATE=${{ vars.PROD_FRESHY_NIGHT_DATE }}
FRESHY_NIGHT_EVENT=${{ vars.PROD_FRESHY_NIGHT_EVENT }}
RPKM_DAY_1=${{ vars.PROD_RPKM_DAY_1 }}
RPKM_DAY_2=${{ vars.PROD_RPKM_DAY_2 }}
RUP_PEUN_DATE=${{ vars.PROD_RUP_PEUN_DATE }}
BASE_DOMAIN_IMAGES=${{ vars.PROD_BASE_DOMAIN_IMAGES }}
BAAN_ANNOUCE_DATE=${{ vars.PROD_BAAN_ANNOUCE_DATE }}
send_message_dev:
needs: build
uses: ./.github/workflows/send-message.yml
Expand Down
21 changes: 18 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,30 @@ ENV APP_ENV=${APP_ENV}
ARG API_BASE_URL
ENV API_BASE_URL=${API_BASE_URL}

ARG BAAN_ANNOUCE_DATE
ENV BAAN_ANNOUCE_DATE=${BAAN_ANNOUCE_DATE}

ARG CLOSED_BAAN_SELECTION_DATE
ENV CLOSED_BAAN_SELECTION_DATE=${CLOSED_BAAN_SELECTION_DATE}

ARG FIRST_DATE_DATE
ENV FIRST_DATE_DATE=${FIRST_DATE_DATE}

ARG FRESHY_NIGHT_DATE
ENV FRESHY_NIGHT_DATE=${FRESHY_NIGHT_DATE}

ARG FRESHY_NIGHT_EVENT
ENV FRESHY_NIGHT_EVENT=${FRESHY_NIGHT_EVENT}

ARG RPKM_DAY_1
ENV RPKM_DAY_1=${RPKM_DAY_1}

ARG RPKM_DAY_2
ENV RPKM_DAY_2=${RPKM_DAY_2}

ARG RUP_PEUN_DATE
ENV RUP_PEUN_DATE=${RUP_PEUN_DATE}

ARG BAAN_ANNOUCE_DATE
ENV BAAN_ANNOUCE_DATE=${BAAN_ANNOUCE_DATE}

COPY package.json pnpm-lock.yaml ./
RUN pnpm install

Expand Down
7 changes: 7 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ const nextConfig = {
},
env: {
NEXT_PUBLIC_API_BASE_URL: process.env.API_BASE_URL,
NEXT_PUBLIC_BAAN_ANNOUCE_DATE: process.env.BAAN_ANNOUCE_DATE,
NEXT_PUBLIC_CLOSED_BAAN_SELECTION_DATE:
process.env.CLOSED_BAAN_SELECTION_DATE,
NEXT_PUBLIC_FIRST_DATE_DATE: process.env.FIRST_DATE_DATE,
NEXT_PUBLIC_FRESHY_NIGHT_DATE: process.env.FRESHY_NIGHT_DATE,
NEXT_PUBLIC_FRESHY_NIGHT_EVENT: process.env.FRESHY_NIGHT_EVENT,
NEXT_PUBLIC_RPKM_DAY_1: process.env.RPKM_DAY_1,
NEXT_PUBLIC_RPKM_DAY_2: process.env.RPKM_DAY_2,
NEXT_PUBLIC_RUP_PEUN_DATE: process.env.RUP_PEUN_DATE,
},
};
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"@butterfail/tailwindcss-inverted-radius": "^0.1.2",
"@designbycode/tailwindcss-text-stroke": "^1.2.1",
"@hugocxl/react-to-image": "^0.0.9",
"@iconify/react": "^5.0.1",
"@nextui-org/accordion": "^2.0.38",
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions public/LineIcon-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/LineIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/rpkm/freshy-night/border.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/rpkm/freshy-night/mic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/rpkm/freshy-night/newspaper.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/rpkm/freshy-night/newspaper_1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/rpkm/freshy-night/truck_left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/rpkm/freshy-night/truck_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/app/(main)/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export default function Home() {
throw new Error('');
}
} catch (e) {
console.log('fetch check in', e);
console.log('error fetch checkin', e);
}
};

checkedIn();
}, []);
}, [user]);

const checkInConfirm = async () => {
if (!user) {
Expand Down
3 changes: 1 addition & 2 deletions src/app/(main)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Footer from '@/components/(main)/Footer';
import BaanProvider from '@/context/BaanContext';
import React from 'react';

const layout = ({
Expand All @@ -9,7 +8,7 @@ const layout = ({
}>) => {
return (
<main className="bg-1 overflow-auto">
<BaanProvider>{children}</BaanProvider>
{children}
<Footer />
</main>
);
Expand Down
31 changes: 31 additions & 0 deletions src/app/rpkm/freshy-night/coming-soon/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Base from '@/components/rpkm/freshy-night/Base';

export default function ComingSoon() {
return (
<div className="min-h-screen w-full grid place-items-center">
<Base
className="p-[10%] h-[calc(70vw*(801/371))] gap-2"
withBus={false}
>
<section className="text-center font-sopha">
<h1 className="drop-shadow-md text-6xl text-rpkm-pink text-stroke text-stroke-rpkm-blue -my-4">
COMING SOON
</h1>
<h1 className="drop-shadow-md text-5xl text-rpkm-yellow text-stroke text-stroke-rpkm-blue">
FRESHY NIGHT
</h1>
</section>
<main className="bg-rpkm-silver h-full w-full rounded-xl"></main>
<section className="text-center">
<p>สามารถลงทะเบียนเข้างานได้</p>
<p>
ตั้งแต่วันที่ <strong>3 สิงหาคม 2567</strong>
</p>
<p>
เวลา <strong>00:00</strong> เป็นต้นไป
</p>
</section>
</Base>
</div>
);
}
38 changes: 38 additions & 0 deletions src/app/rpkm/freshy-night/register/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use client';
import modalStyles from '@/components/rpkm/Modal/ModalStyle';
import Base from '@/components/rpkm/freshy-night/Base';
import { cn } from '@/lib/utils';
import Link from 'next/link';

export default function Register() {
const { button } = modalStyles['red'];

return (
<div className="min-h-screen w-full grid place-items-center">
<Base
className="p-[10%] h-[calc(70vw*(801/371))] gap-4"
withBus={true}
>
<span className="drop-shadow-md font-sopha text-6xl text-rpkm-yellow text-stroke text-stroke-rpkm-blue -my-3">
FRESHY NIGHT
</span>
<main className="bg-rpkm-silver h-full w-full rounded-xl"></main>
<button
onClick={() => console.log('Fuck you')}
className="p-1 inv-rad inv-rad-2 bg-rpkm-yellow"
>
<Link href="/rpkm/freshy-night/rules">
<div
className={cn(
'py-[0.3rem] inv-rad px-6 inv-rad-2',
button['accept-background']
)}
>
ลงทะเบียนเข้าร่วมงาน
</div>
</Link>
</button>
</Base>
</div>
);
}
92 changes: 92 additions & 0 deletions src/app/rpkm/freshy-night/rules/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
'use client';
import modalStyles from '@/components/rpkm/Modal/ModalStyle';
import Base from '@/components/rpkm/freshy-night/Base';
import Card from '@/components/rpkm/freshy-night/rules/Card';
import MIC from '@public/rpkm/freshy-night/mic.svg';
import Image from 'next/image';
import { cn } from '@/lib/utils';
import { useAuth } from '@/context/AuthContext';
import { createCheckIn } from '@/utils/checkin';
import toast from 'react-hot-toast';
interface RulesData {
imgUrl?: string;
description?: string;
}
const setOfRules: RulesData[] = [
{ description: 'description' },
{ imgUrl: '', description: 'description' },
{ imgUrl: '', description: 'description' },
{ imgUrl: '', description: 'description' },
{ imgUrl: '', description: 'description' },
{ imgUrl: '', description: 'description' },
];
export default function Rules() {
const { button } = modalStyles['red'];
const { user } = useAuth();

const handleClick = async () => {
if (!user) {
toast.error('เกิดข้อผิดพลาดในการดึงข้อมูล');
return;
}
const resp = await createCheckIn(
user.id,
user.email,
'freshy-night-confirm'
);
if (resp) {
toast.success('สำเร็จ');
} else {
toast.error('เกิดข้อผิดพลาด');
}
};

return (
<div className="min-h-screen w-full grid place-items-center">
<Base
className="p-[10%] h-[calc(50vw*(801/371))] gap-6"
withBus={true}
>
<section className="drop-shadow-lg relative font-sopha text-stroke text-stroke-rpkm-blue -mt-12 -ml-8">
<span className="text-9xl text-rpkm-green">กฏ</span>
<span className="text-8xl text-rpkm-yellow">กติกา</span>
<Image
src={MIC}
alt="Microphone"
width={60}
height={60}
className="absolute top-[30%] left-[95%]"
/>
<span className="absolute text-7xl text-rpkm-pink left-[30%] w-5/6 top-[60%]">
ภายในงาน
</span>
</section>

<div className="grid grid-cols-3 grid-rows-2 place-items-center w-full h-full gap-4">
{setOfRules.map((e: RulesData, i: number) => (
<Card
imgUrl={e.imgUrl}
description={e.description}
num={i + 1}
key={i}
/>
))}
</div>

<button
onClick={handleClick}
className="p-1 inv-rad inv-rad-2 bg-rpkm-yellow"
>
<div
className={cn(
'py-[0.3rem] px-6 inv-rad inv-rad-2',
button['accept-background']
)}
>
ยอมรับข้อตกลง
</div>
</button>
</Base>
</div>
);
}
Loading

0 comments on commit 7054b74

Please sign in to comment.