1+ import React , { Component } from "react" ;
2+ import Card from 'react-bootstrap/Card'
3+ import Button from 'react-bootstrap/Button'
4+ import Row from 'react-bootstrap/Row'
5+ import Col from 'react-bootstrap/Col'
6+ import Container from 'react-bootstrap/Container'
7+
8+ class Supplier extends Component {
9+ handleClick ( name ) {
10+ window . location . href = "/payment"
11+ localStorage . setItem ( "supplier" , name )
12+ // For now we store the supplier that users chose in the local cache, with the key as "supplier"
13+ // When the user clicks on a supplier, the name of that supplier will be passed into here.
14+ }
15+
16+ render ( ) {
17+ return (
18+
19+ < Container >
20+ < Row >
21+ < Col className = "SupplierCard" >
22+ < Card style = { { width : '18rem' } } >
23+ < Card . Img variant = "top" src = "https://www.wave3.com/resizer/1HurzaEJTU8tvKDbB4cxUYvVFUM=/1200x600/cloudfront-us-east-1.images.arcpublishing.com/raycom/RSJIE4RZUVFWFGC55BVQAKZ5S4.jpg" />
24+ < Card . Body >
25+ < Card . Title > Walmart</ Card . Title >
26+ < Button variant = "primary"
27+ onClick = { ( ev ) => { this . handleClick ( "Walmart" ) } }
28+ > Go payment</ Button >
29+ { /*<button onClick={(ev) => {this.handle(ev, "Walmart")}}/>*/ }
30+ </ Card . Body >
31+ </ Card >
32+ </ Col >
33+ < Col className = "SupplierCard" >
34+ < Card style = { { width : '18rem' } } >
35+ < Card . Img variant = "top" src = "https://cdn.mos.cms.futurecdn.net/wiXtq4NPpGbNf6PEHTT4hg-1024-80.jpg.webp" />
36+ < Card . Body >
37+ < Card . Title > Amazon</ Card . Title >
38+ < Button variant = "primary"
39+ onClick = { ( ev ) => { this . handleClick ( "Amazon" ) } }
40+ > Go payment</ Button >
41+ </ Card . Body >
42+ </ Card >
43+ </ Col >
44+ < Col className = "SupplierCard" >
45+ < Card style = { { width : '18rem' } } >
46+ < Card . Img variant = "top" src = "https://www.rhtc.com.au/Upload/RouseHillTownCentre/Media/Store-Logo/logo-target.jpg?width=250& height = 161 " />
47+ < Card . Body >
48+ < Card . Title > Target</ Card . Title >
49+ < Button variant = "primary"
50+ onClick = { ( ev ) => { this . handleClick ( "Target" ) } }
51+ > Go payment</ Button >
52+ </ Card . Body >
53+ </ Card >
54+ </ Col >
55+ </ Row >
56+ </ Container >
57+
58+
59+
60+ )
61+ }
62+ }
63+
64+ export default Supplier ;
0 commit comments