Add flag column to worldTravelCountries table and remove flag column
This commit is contained in:
@@ -8,13 +8,23 @@
|
||||
async function nav(loc: string) {
|
||||
goto(`/worldtravel/${loc}`);
|
||||
}
|
||||
function getFlag(country: string) {
|
||||
return `https://flagcdn.com/h24/${country}.png`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<h1>Country List</h1>
|
||||
<h1 class="text-center font-bold text-4xl mb-4">Country List</h1>
|
||||
|
||||
{#each data.response as item}
|
||||
<button class="btn btn-primary" on:click={() => nav(item.country_code)}
|
||||
>{item.name}</button
|
||||
<button
|
||||
class="btn btn-primary mr-4 mb-2"
|
||||
on:click={() => nav(item.country_code)}
|
||||
>{item.name}
|
||||
<img
|
||||
src={getFlag(item.country_code)}
|
||||
class="inline-block -mt-1 mr-1"
|
||||
alt="Flag"
|
||||
/></button
|
||||
>
|
||||
<!-- <p>Name: {item.name}, Continent: {item.continent}</p> -->
|
||||
{/each}
|
||||
|
||||
Reference in New Issue
Block a user