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
<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
41
src='https://mdbootstrap.com/img/logo/mdb-transaprent-noshadows.png'
42
height='15'
43
alt=''
44
loading='lazy'
45
/>
46
</MDBNavbarBrand>
47
48
<form className='d-flex input-group mx-lg-auto my-3 my-lg-0' style={{ maxWidth: '500px' }}>
49
<input
50
type='search'
51
className='form-control rounded'
52
placeholder='Search'
53
aria-label='Search'
54
aria-describedby='search-addon'
55
/>
56
<span className='input-group-text border-0' id='search-addon'>
57
<i className='fas fa-search'></i>
58
</span>
59
</form>
60
</MDBCollapse>
61
62
<div className='d-flex align-items-center'>
63
<MDBDropdown>
64
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='text-reset me-3 hidden-arrow'>
65
<MDBIcon far icon='bell' />
66
</MDBDropdownToggle>
67
<MDBDropdownMenu>
68
<MDBDropdownItem link>Some news</MDBDropdownItem>
69
<MDBDropdownItem link>Another news</MDBDropdownItem>
70
<MDBDropdownItem link>Something else here</MDBDropdownItem>
71
</MDBDropdownMenu>
72
</MDBDropdown>
73
74
<MDBDropdown>
75
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='text-reset me-3 hidden-arrow'>
76
<img
77
src='https://mdbcdn.b-cdn.net/img/new/avatars/2.webp'
78
className='rounded-circle'
79
height='25'
80
alt='Black and White Portrait of a Man'
81
loading='lazy'
82
/>
83
</MDBDropdownToggle>
84
<MDBDropdownMenu>
85
<MDBDropdownItem link>My profile</MDBDropdownItem>
86
<MDBDropdownItem link>Settings</MDBDropdownItem>
87
<MDBDropdownItem link>Logout</MDBDropdownItem>
88
</MDBDropdownMenu>
89
</MDBDropdown>
90
91
<MDBBtn>New project</MDBBtn>
92
</div>
93
</MDBContainer>
94
</MDBNavbar>
95
</section>
96
</MDBContainer>
97
);
98
}
99
100
export default App;
101
Console errors: 0