From 794f2ecab7d1f3c09889f30257e7f4053a573afe Mon Sep 17 00:00:00 2001 From: AndrewTrieu Date: Fri, 24 Mar 2023 11:18:47 +0200 Subject: [PATCH] Upload 2.19 --- part2/countries/src/App.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/part2/countries/src/App.js b/part2/countries/src/App.js index 42d9cbe..3c7b100 100644 --- a/part2/countries/src/App.js +++ b/part2/countries/src/App.js @@ -9,7 +9,7 @@ const App = () => { const CountryData = ({ country }) => { return (
-

{country.name.common}

+

{country.name.official}

Capital: {country.capital}
Area: {country.area} km²

Languages:

@@ -24,14 +24,19 @@ const App = () => { }; const Countries = ({ showedCountries }) => { + const [country, setCountry] = useState(""); if (showedCountries.length === 1) { return ; } else if (showedCountries.length <= 10) { return (
{showedCountries.map((country) => ( -
{country.name.common}
+
+ {country.name.common}{" "} + +
))} + {country && }
); } else if (showedCountries.length > 10) {