File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import Bookings from "@/components/Bookings/Bookings.jsx" ;
22import "./App.scss" ;
3+
4+ import Deck from "../Deck/Deck" ;
5+
36import Footer from "../Footer/Footer" ;
47
58const App = ( ) => (
@@ -8,6 +11,9 @@ const App = () => (
811 < h1 className = "app__heading" > CYF Hotel</ h1 >
912 </ header >
1013 < Bookings />
14+
15+ < Deck />
16+
1117 < Footer
1218 details = { [
1319 "123 Fake Street, London, E1 4UD" ,
Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ const Card = (props) => {
77 < div className = "card" >
88 < h2 > { title } </ h2 >
99 < img src = { image } alt = { title } />
10- < a href = { url } > Visit { title } </ a >
10+
11+ < a href = { url } > { title } </ a >
12+
13+
1114 </ div >
1215 ) ;
1316} ;
Original file line number Diff line number Diff line change 1- // import Card from "@/components/Card/Card";
2- // import "./Deck.scss";
3- // import cardsData from "@/data/fakeCards.json";
1+ import Card from "@/components/Card/Card" ;
2+ import "./Deck.scss" ;
3+ import cardsData from "@/data/fakeCards.json" ;
44
5- // const Deck = () => {
6- // you will need to map over the cardsData array and render a Card component for each card object
7- // how will you pass props to the Card component?
5+ const Deck = ( props ) => {
6+ return (
7+ < div className = "deck" >
8+ { cardsData . map ( ( city , index ) => (
9+ < Card
10+ key = { index }
11+ title = { city . title }
12+ url = { city . url }
13+ image = { city . image }
14+ />
15+ ) ) }
16+ </ div >
17+ ) ;
18+ } ;
819
9- // };
10-
11- // export default Deck;
20+ export default Deck ;
Original file line number Diff line number Diff line change 22 {
33 "title" : " Glasgow" ,
44 "url" : " https://peoplemakeglasgow.com" ,
5- "image" : " placeholderImage.svg "
5+ "image" : " https://2f1a7f9478.visitscotland.net/binaries/content/gallery/visitscotland/cms-images/2023/04/06/queens-park "
66 },
77 {
88 "title" : " Manchester" ,
99 "url" : " https://visitmanchester.com" ,
10- "image" : " placeholderImage.svg "
10+ "image" : " https://media.wired.co.uk/photos/6357b98e09e6f1942a2a8a9a/16:9/w_1920,c_limit/HSBC%20MANCHESTER.jpeg "
1111 },
1212 {
1313 "title" : " London" ,
1414 "url" : " https://visitlondon.com" ,
15- "image" : " placeholderImage.svg "
15+ "image" : " https://media.istockphoto.com/id/1347665170/photo/london-at-sunset.jpg?s=1024x1024&w=is&k=20&c=ogVKCS26t23fSvgCO77CC_6mhtxMDk2cmBOUQ9VamYo= "
1616 }
1717]
You can’t perform that action at this time.
0 commit comments