Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sun/fdr 37 emegency contact #14

Merged
merged 13 commits into from
Jun 29, 2024
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lint:fix": "next lint --fix"
},
"dependencies": {
"@iconify/react": "^5.0.1",
"clsx": "^2.1.1",
"next": "14.2.4",
"react": "^18",
Expand Down
11 changes: 6 additions & 5 deletions pnpm-lock.yaml

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

72 changes: 72 additions & 0 deletions src/app/emergency-contact/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import Border from '@/components/Border';
import Image from 'next/image';
import { Icon } from '@iconify/react';
import object from '@/assets/emergency-contact/Objects.svg';
import EmergencyIcon from '@/assets/emergency-contact/emergency-icon.svg';
import EmergencyCallBlock from '@/components/emergency-contact/EmergencyCallBlock';

export default function Emergency() {
return (
<main className="w-full h-screen flex justify-center items-center flex-col">
<Border variant="transparent">
<div className="mt-7 flex flex-col items-center gap-y-3">
<h1 className="w-4/5 text-center font-light text-4xl font-season italic ">
Emergency Contact
</h1>
<Image
src={object}
alt="object"
></Image>
</div>
<div className="mt-2 flex flex-col gap-y-4 items-center">
<p className="font-athiti font-medium">เหตุฉุกเฉิน</p>
<div className="size-[221px] bg-project-gray/50 rounded-full flex flex-col items-center justify-center">
<div className="size-[185px] bg-project-gray rounded-full flex flex-col items-center justify-center">
<a href="tel:022180000">
<div className="size-[163px] bg-project-fuchsia rounded-full flex flex-col items-center justify-center">
<Image
src={EmergencyIcon}
alt="emergency icon"
className=""
></Image>
<p className="text-white text-xs">ศูนย์ รปภ. จุฬาฯ</p>
<p className="text-white text-xs">02-218-0000</p>
</div>
</a>
</div>
</div>
</div>
<div className="mt-4 flex flex-col gap-y-3 w-11/12">
<EmergencyCallBlock
text="เหตุภายนอกมหาวิทยาลัย"
phoneNumber="191"
/>
<EmergencyCallBlock
text="อุบัติเหตุร้ายแรง"
phoneNumber="1669"
/>
</div>
<div className="w-full flex flex-col gap-y-4 mt-7 items-center">
<Image
src={object}
alt="object"
></Image>
<button className="w-3/4 p-2 rounded-lg border-[1px] border-project-fuchsia">
<a href="/home">
<div className="flex flex-row gap-x-2 text-project-fuchsia justify-center items-center">
<Icon
icon="ion:chevron-back"
width={24}
height={24}
/>
<p className="font-athiti text-xl font-medium">
กลับสู่หน้าหลัก
</p>
</div>
</a>
</button>
</div>
</Border>
</main>
);
}
24 changes: 24 additions & 0 deletions src/assets/emergency-contact/Objects.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/emergency-contact/emergency-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/components/emergency-contact/EmergencyCallBlock.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react';
import { Icon } from '@iconify/react';

interface EmergencyCallProps {
text: string;
phoneNumber: string;
}

const EmergencyCallBlock: React.FC<EmergencyCallProps> = ({
text,
phoneNumber,
}) => {
return (
<div className="shadow-[0_2px_4px_0px_rgba(0,0,0,0.25)] rounded-xl flex items-center flex-row justify-between px-3 py-1">
<div className="flex flex-col gap-y-1">
<p className="font-athiti text-base font-medium text-black">{text}</p>
<p className="font-athiti text-base font-medium text-black opacity-50">
{phoneNumber}
</p>
</div>
<div className="flex justify-center items-center">
<a href={`tel:${phoneNumber}`}>
<button className="shadow-[0_0_4px_0px_rgba(0,0,0,0.25)] flex rounded-full flex-cols size-11 bg-project-fuchsia justify-center items-center">
<Icon
icon="fluent:call-connecting-20-filled"
className="text-white"
width={24}
height={24}
/>
</button>
</a>
</div>
</div>
);
};

export default EmergencyCallBlock;
1 change: 1 addition & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const config: Config = {
'dark-gray': '#979797',
'light-gray': '#313131',
'light-blue': '#D8E3FE',
gray: '#DDDDDD',
},
},
fontFamily: {
Expand Down
Loading