Skip to content

Commit af82699

Browse files
committed
done with card for react
1 parent 7deb0a2 commit af82699

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/content/create-listing-card.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ framework: react
99
chapter: Building reusable components
1010
---
1111

12-
13-
In this post we will make a tour card that will allow us to display all our listings.
12+
In this post we will make a tour card that will allow us to display all our listings.
1413

1514
Create a `cards` directory and create `ListingCard.js` file:
1615

1716
```javascript
18-
import React from "react";
19-
import { Rate } from "antd";
20-
import BodyOne from "../typography/BodyOne";
21-
import PropTypes from "prop-types";
22-
import "antd/dist/antd.css";
17+
import React from "react"
18+
import { Rate } from "antd"
19+
import BodyOne from "../typography/BodyOne"
20+
import PropTypes from "prop-types"
21+
import "antd/dist/antd.css"
2322

2423
const ListingCard = ({
2524
listingTitle,
@@ -42,22 +41,22 @@ const ListingCard = ({
4241
</div>
4342
</div>
4443
</>
45-
);
44+
)
4645

4746
ListingCard.propTypes = {
4847
listingTitle: PropTypes.string,
4948
listingLocation: PropTypes.string,
5049
price: PropTypes.string,
5150
rating: PropTypes.number,
5251
coverPhoto: PropTypes.string,
53-
};
54-
export default ListingCard;
52+
}
53+
export default ListingCard
5554
```
5655

57-
🎡 We have a `div` that we have given a `border-radius` and `box-shadow` that has width and height set to auto.
56+
🎡 We have a `div` that we have given a `border-radius` and `box-shadow` that has width and height set to auto.
5857

59-
🎡 it takes props called `listingTitle`, `listingLocation`, `price`, `rating` and `coverPhoto`
58+
🎡 It takes props called `listingTitle`, `listingLocation`, `price`, `rating` and `coverPhoto`.
6059

6160
Once you're done, it will look like this:
6261

63-
![tour-card](/uploads/tourcard.png)
62+
![tour-card](/uploads/tourcard.png)

0 commit comments

Comments
 (0)