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
body {
2
margin: 0;
3
font-family: Roboto, Helvetica, Arial, sans-serif;
4
-webkit-font-smoothing: antialiased;
5
-moz-osx-font-smoothing: grayscale;
6
}
7
8
code {
9
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
10
monospace;
11
}
12
xxxxxxxxxx
1
import React, { useState } from 'react';
2
import {
3
MDBContainer,
4
MDBCol,
5
MDBNavbar,
6
MDBNavbarBrand,
7
MDBNavbarToggler,
8
MDBIcon,
9
MDBNavbarNav,
10
MDBNavbarItem,
11
MDBNavbarLink,
12
MDBBtn,
13
MDBCollapse,
14
MDBDropdown,
15
MDBDropdownToggle,
16
MDBDropdownMenu,
17
MDBDropdownItem,
18
MDBBadge,
19
MDBRow,
20
} from 'mdb-react-ui-kit';
21
22
function App() {
23
const [showNav, setShowNav] = useState(false);
24
25
return (
26
<MDBContainer fluid>
27
<section>
28
<MDBNavbar expand='lg' light>
29
<MDBContainer fluid>
30
<MDBNavbarBrand className='ms-1 ms-lg-3 d-flex align-items-center' href='#'>
31
<MDBIcon icon='flask' className='text-primary me-2' />
32
<small className='fw-bold'>CodeLab</small>
33
</MDBNavbarBrand>
34
35
<MDBNavbarToggler
36
aria-controls='navbarSupportedContent'
37
aria-label='Toggle navigation'
38
onClick={() => setShowNav(!showNav)}
39
>
40
<MDBIcon icon='bars' fas />
41
</MDBNavbarToggler>
42
43
<MDBCollapse navbar show={showNav}>
44
<MDBNavbarNav className='mr-auto mb-2 mb-lg-0'>
45
<MDBNavbarItem>
46
<MDBNavbarLink active aria-current='page' href='#'>
47
Dashboard
48
</MDBNavbarLink>
49
</MDBNavbarItem>
50
<MDBNavbarItem>
51
<MDBNavbarLink href='#'>Pricing</MDBNavbarLink>
52
</MDBNavbarItem>
53
54
<MDBNavbarItem>
55
<MDBNavbarLink disabled href='#'>
56
Contact
57
</MDBNavbarLink>
58
</MDBNavbarItem>
59
</MDBNavbarNav>
60
</MDBCollapse>
61
62
<div className='d-flex align-items-center me-2 me-lg-3'>
63
<form className='d-flex input-group w-auto me-3'>
64
<span className='input-group-text border-0' id='search-addon'>
65
<MDBIcon icon='search' />
66
</span>
67
<input
68
type='search'
69
className='form-control rounded'
70
placeholder='Search'
71
aria-label='Search'
72
aria-describedby='search-addon'
73
/>
74
</form>
75
76
<MDBDropdown>
77
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='text-reset me-3 hidden-arrow'>
78
<MDBIcon icon='bell' />
79
<MDBBadge pill notification color='danger'>
80
1
81
</MDBBadge>
82
</MDBDropdownToggle>
83
<MDBDropdownMenu>
84
<MDBDropdownItem link>Some news</MDBDropdownItem>
85
<MDBDropdownItem link>Another news</MDBDropdownItem>
86
<MDBDropdownItem link>Something else here</MDBDropdownItem>
87
</MDBDropdownMenu>
88
</MDBDropdown>
89
90
<MDBDropdown>
91
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='text-reset me-3 hidden-arrow'>
92
<img
93
src='https://mdbcdn.b-cdn.net/img/new/avatars/2.webp'
94
className='rounded-circle'
95
height='25'
96
alt='Black and White Portrait of a Man'
97
loading='lazy'
98
/>
99
</MDBDropdownToggle>
100
<MDBDropdownMenu>
101
<MDBDropdownItem link>My profile</MDBDropdownItem>
102
<MDBDropdownItem link>Settings</MDBDropdownItem>
103
<MDBDropdownItem link>Logout</MDBDropdownItem>
104
</MDBDropdownMenu>
105
</MDBDropdown>
106
</div>
107
</MDBContainer>
108
</MDBNavbar>
109
</section>
110
</MDBContainer>
111
);
112
}
113
114
export default App;
115
Console errors: 0