-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
88 lines (85 loc) · 3.98 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import React, {Component} from 'react';
import './App.css';
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
import {Picture, HiDpiPicture} from 'pixboost-react';
import {Cups} from './Data';
class App extends Component {
render() {
const pixboostConfig = {
apiKey: 'MTA0ODU5NDA0NQ__',
domain: 'https://pixboost.com',
breakpoints: {
lg: {media: '(min-width: 576px)'},
sm: {}
}
};
return (
<div className="App">
<nav className="navbar navbar-light bg-light">
<a className="navbar-brand" href="/">Midday.Coffee</a>
<form className="form-inline search-form">
<input className="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search"/>
<button className="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</nav>
<div className="banner">
<HiDpiPicture
alt={'coffee machine'}
breakpoints={{
lg: {op: 'fit?size={WIDTH}x{HEIGHT}', height: 1200},
sm: {op: 'fit?size={WIDTH}x{HEIGHT}', height: 600}
}}
config={pixboostConfig}
src="http://www.midday.coffee/assets/banner2.jpg"
minWidth={300}
maxWidth={3000}
sizes={{
lg: '100vw',
sm: '100vw'
}}
/>
<div className="text">
<p className="h1 display-4">Find Your Coffee Cup</p>
<p className="lead">We have them all in one place!</p>
</div>
</div>
<div className={'container'}>
<div className="row text-center">
{
Cups.map( (c, idx) => {
return (
<div className="col-md-4 col-lg-3 col-6" key={c.Name}>
<div className="card">
<div className="img-wrapper">
<Picture className={'card-img-top'} alt={c.Name}
breakpoints={{
lg: {
src: c.Image,
op: 'resize?size=x200'
},
sm: {
src: c.Image,
op: 'resize?size=x150'
}
}}
config={pixboostConfig}
lazy={idx > 1}
/>
</div>
<div className="card-body">
<h5>{c.Name}</h5>
<p className="card-text">{c.Price}</p>
<a href="#/buy" className="btn btn-primary">Add to cart</a>
</div>
</div>
</div>
);
})
}
</div>
</div>
</div>
);
}
}
export default App;