xxxxxxxxxx
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
<meta charset="utf-8" />
5
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
<meta name="viewport" content="width=device-width, initial-scale=1" />
7
<meta name="theme-color" content="#000000" />
8
<meta
9
name="description"
10
content="Web site created using create-react-app"
11
/>
12
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
<link
14
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
15
rel="stylesheet"
16
/>
17
<link
18
href="https://use.fontawesome.com/releases/v5.15.1/css/all.css"
19
rel="stylesheet"
20
/>
21
22
<!--
23
manifest.json provides metadata used when your web app is installed on a
24
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
25
-->
26
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
27
<!--
28
Notice the use of %PUBLIC_URL% in the tags above.
29
It will be replaced with the URL of the `public` folder during the build.
30
Only files inside the `public` folder can be referenced from the HTML.
31
32
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
33
work correctly both with client-side routing and a non-root public URL.
34
Learn how to configure a non-root public URL by running `npm run build`.
35
-->
36
<title>MDBReact5 Template App</title>
37
</head>
38
<body>
39
<noscript>You need to enable JavaScript to run this app.</noscript>
40
<div id="root"></div>
41
<!--
42
This HTML file is a template.
43
If you open it directly in the browser, you will see an empty page.
44
45
You can add webfonts, meta tags, or analytics to this file.
46
The build step will place the bundled scripts into the <body> tag.
47
48
To begin the development, run `npm start` or `yarn start`.
49
To create a production bundle, use `npm run build` or `yarn build`.
50
-->
51
</body>
52
</html>
53
xxxxxxxxxx
1
@media (min-width: 1400px) {
2
main,
3
header,
4
#main-navbar {
5
padding-left: 240px;
6
}
7
}
8
9
.navbar-nav {
10
width: auto !important;
11
}
xxxxxxxxxx
1
import React, { useState } from 'react';
2
import {
3
MDBContainer,
4
MDBNavbar,
5
MDBCard,
6
MDBCardBody,
7
MDBNavbarBrand,
8
MDBRipple,
9
MDBIcon,
10
MDBNavbarNav,
11
MDBNavbarItem,
12
MDBBtn,
13
MDBDropdown,
14
MDBDropdownToggle,
15
MDBDropdownMenu,
16
MDBDropdownItem,
17
MDBRow,
18
MDBCol,
19
MDBBadge,
20
MDBSideNav,
21
MDBSideNavMenu,
22
MDBSideNavItem,
23
MDBSideNavLink,
24
MDBSideNavCollapse
25
} from 'mdb-react-ui-kit';
26
27
function App() {
28
const [showV1, setShowV1] = useState(true);
29
const [showV1Backdrop, setShowV1Backdrop] = useState(false);
30
const [collapseOpened, setCollapseOpened] = useState('accordionCollapse1');
31
32
const toggleAccordion = (value: string) => {
33
value !== collapseOpened ? setCollapseOpened(value) : setCollapseOpened('');
34
};
35
36
return (
37
<MDBContainer fluid>
38
<MDBRow className='justify-content-center'>
39
<MDBCol md='12'>
40
<header style={{ position: 'relative', overflow: 'hidden', minHeight: '600px', paddingLeft: '120px' }}>
41
<MDBSideNav
42
style={{ width: '120px' }}
43
backdrop={showV1Backdrop}
44
constant={!showV1Backdrop}
45
isOpen={showV1}
46
absolute
47
getOpenState={(e: any) => setShowV1(e)}
48
>
49
<div className='h-100 d-flex flex-column'>
50
<MDBRipple rippleTag='a' href='#'>
51
<img
52
src='https://mdbcdn.b-cdn.net/img/logo/mdb-transaprent-noshadows.webp'
53
alt='MDB Logo'
54
loading='lazy'
55
className='w-100 p-2 p-md-4 mt-2 mt-md-0 mb-3 mb-md-0'
56
/>
57
</MDBRipple>
58
59
<MDBBtn color='none' className='btn btn-link p-2 mb-3'>
60
<MDBIcon icon='chart-area' className='mb-2' />
61
<div className='d-none d-md-block'>Traffic</div>
62
</MDBBtn>
63
64
<MDBBtn color='none' className='btn btn-link p-2 mb-3'>
65
<MDBIcon icon='chart-pie' className='mb-2' />
66
<div className='d-none d-md-block'>Sales</div>
67
</MDBBtn>
68
69
<MDBBtn color='none' className='btn btn-link p-2 mb-3'>
70
<MDBIcon icon='chart-line' className='mb-2' />
71
<div className='d-none d-md-block'>Audience</div>
72
</MDBBtn>
73
74
<MDBBtn color='none' className='btn btn-link p-2 mb-3'>
75
<MDBIcon icon='cogs' className='mb-2' />
76
<div className='d-none d-md-block'>Settings</div>
77
</MDBBtn>
78
79
<MDBBtn color='none' className='btn btn-link p-2 mb-3'>
80
<MDBIcon icon='lock' className='mb-2' />
81
<div className='d-none d-md-block'>Password</div>
82
</MDBBtn>
83
</div>
84
85
<a href='' className='text-center mb-2 mb-md-3 px-3'>
86
<img
87
src='https://mdbootstrap.com/img/new/avatars/2.jpg'
88
className='w-100 rounded-circle'
89
alt=''
90
style={{ maxWidth: '40px' }}
91
/>
92
</a>
93
</MDBSideNav>
94
<MDBContainer className='pt-4 pt-lg-5'>
95
<h1>Dashboard</h1>
96
</MDBContainer>
97
</header>
98
</MDBCol>
99
</MDBRow>
100
</MDBContainer>
101
);
102
}
103
104
export default App;
105
Console errors: 0