Commit 0735e4b3 authored by Shaphen's avatar Shaphen

[AFP-47 Shaphen Pangburn]: Resize modal and inherit product details to display on modal

parent 88703f7d
import React, { Component } from 'react'
export default class ProductDetails extends Component {
constructor(props) {
super(props)
this.state = {}
}
render() {
return (
<div className="product-details-container">
Whoa its a modal!
</div>
)
}
}
import React, { Component } from 'react' import React, { Component } from 'react'
import Modal from 'react-modal'; import Modal from 'react-modal';
import ProductDetails from './product-details';
import '../../resources/stylesheets/product-market.css'; import '../../resources/stylesheets/product-market.css';
export default class ProductItem extends Component { export default class ProductItem extends Component {
...@@ -30,7 +31,7 @@ export default class ProductItem extends Component { ...@@ -30,7 +31,7 @@ export default class ProductItem extends Component {
src={ this.props.item.productImageUrl ? this.props.item.productImageUrl : "-no photo-" } src={ this.props.item.productImageUrl ? this.props.item.productImageUrl : "-no photo-" }
onClick={ this.toggleDetailsModal } onClick={ this.toggleDetailsModal }
/> />
<p id="more-details-text">More Details</p> <p onClick={ this.toggleDetailsModal } id="more-details-text">More Details</p>
</div> </div>
<p id="prod-name">{ this.props.item.productName }</p> <p id="prod-name">{ this.props.item.productName }</p>
<div id="prod-price"> <div id="prod-price">
...@@ -60,16 +61,16 @@ export default class ProductItem extends Component { ...@@ -60,16 +61,16 @@ export default class ProductItem extends Component {
onRequestClose={ this.toggleDetailsModal } onRequestClose={ this.toggleDetailsModal }
style={{ style={{
content: { content: {
position: "absolute", top: '50%',
top: '55px', left: '50%',
left: '85px',
right: '0', right: '0',
bottom: '0', bottom: '0',
border: '1px solid black', marginLeft: "-465px",
padding: '7px', marginTop: "-372px",
width: '210px', width: '890px',
height: '134px', height: '775px',
background: 'white' background: 'white',
borderRadius: "10px"
}, },
overlay: { overlay: {
position: 'fixed', position: 'fixed',
...@@ -78,7 +79,7 @@ export default class ProductItem extends Component { ...@@ -78,7 +79,7 @@ export default class ProductItem extends Component {
} }
}} }}
> >
Whoa its a modal! <ProductDetails product={ this.props.item } />
</Modal> </Modal>
</div> </div>
) )
......
...@@ -159,6 +159,10 @@ ...@@ -159,6 +159,10 @@
display: flex; display: flex;
} }
#product-details-modal {
box-shadow: 10px 10px 20px;
}
input::-webkit-outer-spin-button, input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { input::-webkit-inner-spin-button {
-webkit-appearance: none; -webkit-appearance: none;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment