Skip to content

Commit 774add5

Browse files
authored
Merge pull request #33 from areebsattar/feature-deck
NW6 | Sabella Fisseha | Feature deck
2 parents 1bb601a + c9c08cf commit 774add5

4 files changed

Lines changed: 31 additions & 13 deletions

File tree

src/components/App/App.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import Bookings from "@/components/Bookings/Bookings.jsx";
22
import "./App.scss";
3+
4+
import Deck from "../Deck/Deck";
5+
36
import Footer from "../Footer/Footer";
47

58
const 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",

src/components/Card/Card.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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
};

src/components/Deck/Deck.jsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
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;

src/data/fakeCards.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
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
]

0 commit comments

Comments
 (0)