aboutsummaryrefslogtreecommitdiff
path: root/app/travel-advisory/page.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2023-07-17 15:08:57 -0400
committerAndrew Lee <alee14498@protonmail.com>2023-07-17 15:08:57 -0400
commitddbe4fa61425f6a871a23238ce15a0929e201e6e (patch)
treec1d5c2a0674bcbf2cf79180445d8d26518b7009d /app/travel-advisory/page.js
parent8fbaca0d8ec9dc1323facb7f4c0029e32cfe5223 (diff)
downloadalure-website-ddbe4fa61425f6a871a23238ce15a0929e201e6e.tar.gz
alure-website-ddbe4fa61425f6a871a23238ce15a0929e201e6e.tar.bz2
alure-website-ddbe4fa61425f6a871a23238ce15a0929e201e6e.zip
Modularizing certain elements; Working information section
Diffstat (limited to 'app/travel-advisory/page.js')
-rw-r--r--app/travel-advisory/page.js70
1 files changed, 5 insertions, 65 deletions
diff --git a/app/travel-advisory/page.js b/app/travel-advisory/page.js
index f1442aa..b4d845f 100644
--- a/app/travel-advisory/page.js
+++ b/app/travel-advisory/page.js
@@ -1,66 +1,15 @@
-import countriesData from './countries.json' assert { type: 'json' };
+import ListCountries from "@/components/travel-advisory/ListCountries";
+import Header from "@/components/Header";
export const metadata = {
title: 'Travel Advisory',
description: 'Information whether its safe to travel to other countries',
}
-export async function getCountries(){
- const countries = countriesData.countries;
-
- return countries.map((country) => {
- let dangerLevel;
- switch (country.status) {
- case 0:
- dangerLevel = "Take normal security precautions"
- break;
- case 1:
- dangerLevel = "Exercise a high degree of caution"
- break;
- case 2:
- dangerLevel = "Avoid non-essential travel"
- break;
- case 3:
- dangerLevel = "Avoid all travel"
- break;
- }
-
- return (
- <div key="countries"
- className="bg-center bg-no-repeat bg-[url('/regions/silicon-valley.webp')] bg-gray-600 bg-blend-multiply">
- <div className="sm:px-40 px-10 py-10 space-y-3">
- <h1 className="font-medium text-5xl">{country.name}</h1>
- <h2 className="text-lg">{dangerLevel}</h2>
- <div className="flex flex-row space-x-3">
- <button className="bg-blue-600 px-4 py-2">Information</button>
- <button className="hidden bg-blue-600 px-4 py-2 settlements">View settlements</button>
- <div className="hidden settlements-active:visible">
- <h2 className="font-medium text-3xl">City 1</h2>
- <h2 className="text-base">Take normal security precautions</h2>
- <h2 className="font-medium text-3xl">City 2</h2>
- <h2 className="text-base">Take normal security precautions</h2>
- <h2 className="font-medium text-3xl">City 3</h2>
- <h2 className="text-base">Take normal security precautions</h2>
- <h2 className="font-medium text-3xl">City 4</h2>
- <h2 className="text-base">Take normal security precautions</h2>
- </div>
- </div>
- </div>
- </div>
- )
- })
-}
-
export default async function TravelAdvisory(){
- const countries = await getCountries();
return (
<main className="flex flex-col">
- <div className="bg-center bg-no-repeat bg-[url('/jumbotron.webp')] bg-gray-700 bg-blend-multiply">
- <div className="sm:px-40 px-10 max-w-screen-xl text-left py-24 lg:py-10 space-y-3">
- <h1 className="font-medium text-4xl">{metadata.title}</h1>
- <h2 className="font-light text-lg">{metadata.description}</h2>
- </div>
- </div>
+ <Header title={metadata.title} description={metadata.description} />
<div>
<h1 className="p-5 sm:px-40 px-10 text-3xl" id="legend">Legend</h1>
<ul>
@@ -83,17 +32,8 @@ export default async function TravelAdvisory(){
</li>
</ul>
</div>
- <div className="sm:px-40 px-10 py-3 bg-blue-800"><h2 className="font-medium text-lg">This page may be inaccurate at times, refer to the <a href="https://discord.com/channels/277922530973581312/1019705091336446052" className="text-gray-400 hover:text-gray-300">Minecraft General Announcements</a> channel for the latest updates</h2></div>
- { /*<div className="bg-center bg-no-repeat bg-[url('/regions/silicon-valley.webp')] bg-gray-600 bg-blend-multiply">
- <div className="sm:px-40 px-10 py-10 space-y-3">
- <h1 className="font-medium text-5xl">Country name</h1>
- <h2 className="text-lg">Take normal security precautions</h2>
- <div className="flex flex-row space-x-3">
- <button className="bg-blue-600 px-4 py-2">Information</button>
- </div>
- </div>
- </div> */ }
- {countries}
+ <div className="sm:px-40 px-10 py-3 bg-blue-800"><h2 className="font-medium text-lg"><b className="font-bold">WARNING!</b> This page may be inaccurate at times, refer to the <a href="https://discord.com/channels/277922530973581312/1019705091336446052" className="transition ease-in-out transition-200 text-blue-300 hover:text-blue-200 active:text-blue-500">Minecraft General Announcements</a> channel for the latest updates</h2></div>
+ <ListCountries />
</main>
)
}