-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea792b2
commit 72d17a9
Showing
18 changed files
with
365 additions
and
344 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { getVenues } from '../store/modules/VenueSlice'; | ||
import { useEffect, React } from 'react'; | ||
|
||
|
||
|
||
const CountryList = (props) => { | ||
|
||
const dispatch = useDispatch(); | ||
const { venues } = useSelector((state) => state.venues); | ||
|
||
useEffect(() => { | ||
dispatch(getVenues()); | ||
}, [dispatch]); | ||
|
||
const allCountries = []; | ||
const filteresCountries = []; | ||
|
||
venues.map((place) => ( | ||
place.location.country !== '' && place.location.country !== 'Unknown' && | ||
allCountries.push(place.location.country) | ||
)); | ||
|
||
allCountries.map((place) => ( | ||
!filteresCountries.includes(place) && | ||
filteresCountries.push(place) | ||
)); | ||
|
||
const searchCountry = filteresCountries.filter((el) => { | ||
if (props.input === "") { | ||
return el; | ||
} else { | ||
return el.toLowerCase().includes(props.input); | ||
} | ||
}); | ||
|
||
|
||
// Få til at ved klikk på landet så velger den det | ||
|
||
return ( | ||
<> | ||
<ul className='bg-white absolute flex flex-col gap-4'> | ||
{searchCountry.map((country) => ( | ||
<li key={country}>{country}</li> | ||
))} | ||
</ul> | ||
|
||
</> ); | ||
} | ||
|
||
export default CountryList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
72d17a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
holidaze – ./
holidaze-solveigrebnord.vercel.app
holidaze-git-main-solveigrebnord.vercel.app
holidaze-lime.vercel.app