-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
83 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,6 @@ nav{ | |
width: 18rem; | ||
padding: 2em; | ||
margin: 2em; | ||
background-color: #61dbfb; | ||
} | ||
|
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
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
33 changes: 33 additions & 0 deletions
33
Week-14-Props_State_Events_and_Lifecycle_Methods/src/Review.css
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.modal { | ||
position: fixed; | ||
left: 0; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: rgba(0,0,0, 0.5); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.modal-content { | ||
width: 500px; | ||
background-color: #61dbfb; | ||
} | ||
|
||
.modal-header { | ||
padding: 10px; | ||
} | ||
|
||
.modal-title { | ||
margin: 0; | ||
|
||
} | ||
|
||
.modal-body { | ||
padding: 10px; | ||
color: #88dded; | ||
background-color: #1c2c4c; | ||
border-top: 1px solid #b4b7be; | ||
border-bottom: 1px solid #b4b7be; | ||
} |
33 changes: 33 additions & 0 deletions
33
Week-14-Props_State_Events_and_Lifecycle_Methods/src/Reviews.jsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import "./Review.css" | ||
import StarRating from "./StarRating"; | ||
|
||
const Reviews = props => { | ||
if (!props.show){ | ||
return null | ||
} | ||
const rev= props.reviews; | ||
|
||
return ( | ||
<div className="modal"> | ||
<div className="modal-content"> | ||
<div className="modal-header"> | ||
<h3 className="modal-title">Reviews</h3> | ||
</div> | ||
<div className="modal-body"> | ||
{rev.map((review, index) => ( | ||
<div key={index}> | ||
<h5>{review.author}</h5> | ||
<StarRating defaultRating={review.stars}/> | ||
<p>{review.review}</p> | ||
</div> | ||
))} | ||
</div> | ||
<div className="modal-footer"> | ||
<button onClick={props.onClose} className="button">Close</button> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Reviews |
1 change: 1 addition & 0 deletions
1
Week-14-Props_State_Events_and_Lifecycle_Methods/src/StarRating.jsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import PropTypes from 'prop-types'; | ||
import "./star.css" | ||
|
||
|
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