Add AuthContext to FormReview and adjust image detail
This commit is contained in:
parent
b7e62e580a
commit
642aad60af
|
@ -1,10 +1,16 @@
|
||||||
import Form from "react-bootstrap/Form"
|
import Form from "react-bootstrap/Form"
|
||||||
import Button from "react-bootstrap/Button"
|
import Button from "react-bootstrap/Button"
|
||||||
|
|
||||||
|
import { AuthContext } from "../contexts/AuthContext"
|
||||||
|
import { useContext } from "react"
|
||||||
|
|
||||||
|
|
||||||
export function ReviewForm(props) {
|
export function ReviewForm(props) {
|
||||||
|
const auth = useContext(AuthContext)
|
||||||
|
if (auth) {
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form>
|
||||||
<h3>Rewiew this movie</h3>
|
<h3>Review this movie</h3>
|
||||||
<Form.Group>
|
<Form.Group>
|
||||||
<Form.Label>Star</Form.Label>
|
<Form.Label>Star</Form.Label>
|
||||||
<Form.Select>
|
<Form.Select>
|
||||||
|
@ -26,4 +32,8 @@ export function ReviewForm(props) {
|
||||||
<Button type="submit" variant="primary">Submit</Button>
|
<Button type="submit" variant="primary">Submit</Button>
|
||||||
</Form>
|
</Form>
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -27,10 +27,10 @@ export function Detail(props) {
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col md={6}>
|
<Col md={4}>
|
||||||
<ItemImage source={movieData.cover_image} />
|
<ItemImage source={movieData.cover_image} />
|
||||||
</Col>
|
</Col>
|
||||||
<Col md={6}>
|
<Col md={8}>
|
||||||
<h2>More Information</h2>
|
<h2>More Information</h2>
|
||||||
<h3>Synopsis</h3>
|
<h3>Synopsis</h3>
|
||||||
<p>{movieData.synopsis}</p>
|
<p>{movieData.synopsis}</p>
|
||||||
|
@ -57,4 +57,4 @@ export function Detail(props) {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue