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' dark className='bg-dark'>
29
<MDBContainer fluid>
30
<MDBNavbarToggler
31
aria-controls='navbarSupportedContent'
32
aria-label='Toggle navigation'
33
onClick={() => setShowNav(!showNav)}
34
>
35
<MDBIcon icon='bars' fas />
36
</MDBNavbarToggler>
37
38
<MDBCollapse navbar show={showNav}>
39
<MDBNavbarBrand className='mt-2 mt-lg-0' href='#'>
40
<img src='https://mdbootstrap.com/img/logo/mdb-white.png' height='15' alt='' loading='lazy' />
41
</MDBNavbarBrand>
42
43
<form className='d-flex input-group mx-lg-auto my-3 my-lg-0' style={{ maxWidth: '500px' }}>
44
<input
45
type='search'
46
className='form-control rounded'
47
placeholder='Search'
48
aria-label='Search'
49
aria-describedby='search-addon'
50
/>
51
<span
52
className='input-group-text border-0'
53
style={{ color: 'rgba(255, 255, 255, 0.55)' }}
54
id='search-addon'
55
>
56
<i className='fas fa-search'></i>
57
</span>
58
</form>
59
</MDBCollapse>
60
61
<div className='d-flex align-items-center'>
62
<MDBDropdown>
63
<MDBDropdownToggle
64
style={{ cursor: 'pointer', color: 'rgba(255, 255, 255, 0.55)' }}
65
tag='a'
66
className='me-3 hidden-arrow'
67
>
68
<MDBIcon far icon='bell' />
69
</MDBDropdownToggle>
70
<MDBDropdownMenu>
71
<MDBDropdownItem link>Some news</MDBDropdownItem>
72
<MDBDropdownItem link>Another news</MDBDropdownItem>
73
<MDBDropdownItem link>Something else here</MDBDropdownItem>
74
</MDBDropdownMenu>
75
</MDBDropdown>
76
77
<MDBDropdown>
78
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='text-reset me-3 hidden-arrow'>
79
<img
80
src='https://mdbootstrap.com/img/new/avatars/3.jpg'
81
className='rounded-circle'
82
height='25'
83
alt='Black and White Portrait of a Man'
84
loading='lazy'
85
/>
86
</MDBDropdownToggle>
87
<MDBDropdownMenu>
88
<MDBDropdownItem link>My profile</MDBDropdownItem>
89
<MDBDropdownItem link>Settings</MDBDropdownItem>
90
<MDBDropdownItem link>Logout</MDBDropdownItem>
91
</MDBDropdownMenu>
92
</MDBDropdown>
93
94
<MDBBtn className='my-1 ms-3' color='info'>
95
New project
96
</MDBBtn>
97
</div>
98
</MDBContainer>
99
</MDBNavbar>
100
</section>
101
</MDBContainer>
102
);
103
}
104
105
export default App;
106
Console errors: 0