-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.js
60 lines (56 loc) · 1.65 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
import React from "react";
import Info from "./Info";
import Citations from "./Citations";
import Nav from "./Nav";
import Resources from "./Resources";
import useResponsiveBreakpoints from "./utils/useResponsiveBreakpoints";
import "./App.css";
function App() {
const targetRef = React.useRef(null);
const size = useResponsiveBreakpoints(targetRef, [
{ small: 200 },
{ medium: 400 },
{ large: 600 }
]);
return (
<React.Fragment>
<Nav />
<div className="row">
<div className="lg-5 col">
<div className="paper">
<Info />
</div>
<Resources />
<Citations />
</div>
<div className="lg-7 col">
<div className="paper">
<div className="row">
<div className="col-fill col" style={{ overflow: "hidden" }}>
Try horizontally resizing the box below and see the media query
name change between small, medium and large
<div style={{ overflow: "hidden", width: "100%" }}>
<div
ref={targetRef}
className="border"
style={{
backgroundColor: "aliceblue",
padding: "1rem",
resize: "horizontal",
overflow: "hidden",
maxWidth: "100%",
minWidth: "4rem"
}}
>
{size}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</React.Fragment>
);
}
export default App;