forked from shahibuzzaman/covid19-tracker-reactJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
36 lines (33 loc) · 887 Bytes
/
App.js
File metadata and controls
36 lines (33 loc) · 887 Bytes
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
import React from 'react';
import DesktopApp from './components/App';
import TabletApp from './components/responsive/tablet/App';
import MobileApp from './components/responsive/mobile/App';
import { useMediaQuery } from 'react-responsive';
const Desktop = ({ children }) => {
const isDesktop = useMediaQuery({ minWidth: 992 });
return isDesktop ? children : null;
};
const Tablet = ({ children }) => {
const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 });
return isTablet ? children : null;
};
const Mobile = ({ children }) => {
const isMobile = useMediaQuery({ maxWidth: 767 });
return isMobile ? children : null;
};
const App = () => {
return (
<div>
<Desktop>
<DesktopApp />
</Desktop>
<Tablet>
<TabletApp />
</Tablet>
<Mobile>
<MobileApp />
</Mobile>
</div>
);
};
export default App;