-
-
Save Daltonic/87939c3c2bf967848511d04b9737421d to your computer and use it in GitHub Desktop.
Dapp Cinemas
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
import { useGlobalState } from '../store' | |
import MovieCard from '../components/MovieCard' | |
import Banner from '../components/Banner' | |
const ListMovies = () => { | |
const [movies] = useGlobalState('movies') | |
return ( | |
<div className="flex flex-col w-full p-4"> | |
<Banner /> | |
<div> | |
<div className="flex flex-col"> | |
<h2 className="text-xl font-semibold p-4">Movies</h2> | |
{movies.length > 0 ? ( | |
<div className="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-3 gap-4"> | |
{movies.map((movie, i) => ( | |
<MovieCard key={i} movie={movie} /> | |
))} | |
</div> | |
) : ( | |
<div className="mt-10">No movies yet</div> | |
)} | |
</div> | |
</div> | |
</div> | |
) | |
} | |
export default ListMovies |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment