1
1
import { useState } from "react" ;
2
2
import GameCard from "./components/GameCard" ;
3
3
import "./App.css" ;
4
- import { Navbar , Nav , NavDropdown , Row , Col , Container } from "react-bootstrap" ;
4
+ import { Navbar , Nav , NavDropdown , Row , Col , Container , CardGroup } from "react-bootstrap" ;
5
5
6
6
const defaultPokedex = [
7
7
{
@@ -70,7 +70,7 @@ const defaultPokedex = [
70
70
function App ( ) {
71
71
const [ score , setScore ] = useState ( 0 ) ;
72
72
const [ highScore , setHighScore ] = useState ( 0 ) ;
73
- const [ pokedex , setPokedex ] = useState ( defaultPokedex ) ;
73
+ const [ pokedex , ] = useState ( defaultPokedex ) ;
74
74
const [ selectedTokens , setSelected ] = useState ( [ ] ) ;
75
75
const [ pokemonToDisplay , setPokemonToDisply ] = useState ( defaultPokedex ) ;
76
76
@@ -126,8 +126,9 @@ function App() {
126
126
127
127
return (
128
128
< >
129
- < Navbar expand = "lg" className = "bg-body-tertiary" pb = { 4 } >
130
- < Container >
129
+ < Container fluid >
130
+ < Navbar expand = "lg" className = "bg-body-tertiary" pb = { 4 } fixed = "top" >
131
+
131
132
< Navbar . Brand href = "#home" > Pokemon Memorization</ Navbar . Brand >
132
133
< Navbar . Toggle aria-controls = "basic-navbar-nav" />
133
134
< Navbar . Collapse id = "basic-navbar-nav" >
@@ -146,12 +147,21 @@ function App() {
146
147
</ Row >
147
148
</ Col >
148
149
</ Navbar . Collapse >
149
- </ Container >
150
150
151
- </ Navbar >
152
- < Container >
153
- < Row className = "justify-content-md-center pt-5" >
154
- { pokemonToDisplay . map ( ( pokemon , index ) => (
151
+
152
+ </ Navbar >
153
+ </ Container >
154
+ < Container fluid >
155
+ { /* TODO add two rows. */ }
156
+ < Row >
157
+ { pokemonToDisplay . slice ( 0 , ( pokemonToDisplay . length / 2 ) - 1 ) . map ( ( pokemon , index ) => (
158
+ < GameCard
159
+ key = { index }
160
+ pokemon = { pokemon }
161
+ handleClick = { handleClick }
162
+ />
163
+ ) ) }
164
+ { pokemonToDisplay . slice ( ( pokemonToDisplay . length / 2 ) , pokemonToDisplay . length - 1 ) . map ( ( pokemon , index ) => (
155
165
< GameCard
156
166
key = { index }
157
167
pokemon = { pokemon }
0 commit comments