diff --git a/src/index.css b/src/index.css index 9beb328..cd26688 100644 --- a/src/index.css +++ b/src/index.css @@ -122,37 +122,6 @@ main .search-field { opacity: 0.75; } -.filter .dropdown-list { - position: absolute; - background-color: var(--element-background); - width: inherit; - left: 0; - top: calc(100% + 5px); - list-style: none; - display: flex; - flex-direction: column; - gap: 1rem; - border-radius: 8px; - overflow: hidden; - height: 0; - transition: .2s; - padding: 0 1.5rem; -} - -.filter .dropdown-list li { - transition: .2s; - cursor: pointer; -} - -.filter .dropdown-list li:hover { - color: #bbb; -} - -.filter:hover .dropdown-list { - height: max-content; - padding: 1rem 1.5rem; -} - main .countries { margin-top: 4rem; display: grid; diff --git a/src/pages/Main.js b/src/pages/Main.js index 7cd8f4f..a50ad61 100644 --- a/src/pages/Main.js +++ b/src/pages/Main.js @@ -51,21 +51,21 @@ function Main() {
- - + +
-
-

{filterRegion.current ? filterRegion.current : 'Filter by region'}

- -
-
    -
  • fetchByRegion('https://restcountries.com/v3.1/region/Africa', 'Africa')}>Africa
  • -
  • fetchByRegion('https://restcountries.com/v3.1/region/America', 'America')}>America
  • -
  • fetchByRegion('https://restcountries.com/v3.1/region/Asia', 'Asia')}>Asia
  • -
  • fetchByRegion('https://restcountries.com/v3.1/region/Europe', 'Europe')}>Europe
  • -
  • fetchByRegion('https://restcountries.com/v3.1/region/Oceania', 'Oceania')}>Oceania
  • -
+
+

{filterRegion.current ? filterRegion.current : 'Filter by region'}

+ +
+