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 className='w-100'>
28
<MDBNavbar expand='lg' light className='bg-white'>
29
<MDBContainer fluid className='justify-content-between'>
30
<div className='d-flex'>
31
<MDBNavbarBrand className='d-flex align-items-center' href='#'>
32
<MDBIcon icon='flask' className='text-primary me-2' />
33
<small className='fw-bold text-dark'>CodeLab</small>
34
</MDBNavbarBrand>
35
36
<form className='input-group w-auto my-auto d-none d-lg-flex'>
37
<input
38
autoComplete='off'
39
type='search'
40
className='form-control rounded'
41
placeholder='Search'
42
style={{ minWidth: '125px' }}
43
/>
44
<span className='input-group-text border-0 d-none d-lg-flex'>
45
<i className='fas fa-search'></i>
46
</span>
47
</form>
48
</div>
49
50
<MDBNavbarNav className='flex-row d-none d-md-flex w-auto'>
51
<MDBNavbarItem className='me-3 me-lg-1' active>
52
<MDBNavbarLink aria-current='page' href='#'>
53
<MDBIcon icon='home' size='lg' />
54
<MDBBadge pill notification color='danger'>
55
1
56
</MDBBadge>
57
</MDBNavbarLink>
58
</MDBNavbarItem>
59
60
<MDBNavbarItem className='me-3 me-lg-1'>
61
<MDBNavbarLink aria-current='page' href='#'>
62
<MDBIcon icon='flag' size='lg' />
63
</MDBNavbarLink>
64
</MDBNavbarItem>
65
66
<MDBNavbarItem className='me-3 me-lg-1'>
67
<MDBNavbarLink aria-current='page' href='#'>
68
<MDBIcon icon='video' size='lg' />
69
</MDBNavbarLink>
70
</MDBNavbarItem>
71
72
<MDBNavbarItem className='me-3 me-lg-1'>
73
<MDBNavbarLink aria-current='page' href='#'>
74
<MDBIcon icon='shopping-bag' size='lg' />
75
</MDBNavbarLink>
76
</MDBNavbarItem>
77
78
<MDBNavbarItem className='me-3 me-lg-1'>
79
<MDBNavbarLink aria-current='page' href='#'>
80
<MDBIcon icon='users' size='lg' />
81
<MDBBadge pill notification color='danger'>
82
2
83
</MDBBadge>
84
</MDBNavbarLink>
85
</MDBNavbarItem>
86
</MDBNavbarNav>
87
88
<MDBNavbarNav className='flex-row w-auto'>
89
<MDBNavbarItem className='me-3 me-lg-1'>
90
<MDBNavbarLink className='d-sm-flex align-items-sm-center' aria-current='page' href='#'>
91
<img
92
src='https://mdbcdn.b-cdn.net/img/new/avatars/1.webp'
93
className='rounded-circle'
94
height='22'
95
alt='Black and White Portrait of a Man'
96
loading='lazy'
97
/>
98
<strong className='d-none d-sm-block ms-1'>John</strong>
99
</MDBNavbarLink>
100
</MDBNavbarItem>
101
102
<MDBNavbarItem className='me-3 me-lg-1'>
103
<MDBNavbarLink aria-current='page' href='#'>
104
<MDBIcon icon='plus-circle' size='lg' />
105
</MDBNavbarLink>
106
</MDBNavbarItem>
107
108
<MDBDropdown className='nav-item me-3 me-lg-1'>
109
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='nav-link hidden-arrow'>
110
<MDBIcon icon='comments' size='lg' />
111
</MDBDropdownToggle>
112
<MDBDropdownMenu>
113
<MDBDropdownItem link>Some news</MDBDropdownItem>
114
<MDBDropdownItem link>Another news</MDBDropdownItem>
115
<MDBDropdownItem link>Something else here</MDBDropdownItem>
116
</MDBDropdownMenu>
117
</MDBDropdown>
118
119
<MDBDropdown className='nav-item me-3 me-lg-1'>
120
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='nav-link hidden-arrow'>
121
<MDBIcon icon='bell' size='lg' />
122
</MDBDropdownToggle>
123
<MDBDropdownMenu>
124
<MDBDropdownItem link>Some news</MDBDropdownItem>
125
<MDBDropdownItem link>Another news</MDBDropdownItem>
126
<MDBDropdownItem link>Something else here</MDBDropdownItem>
127
</MDBDropdownMenu>
128
</MDBDropdown>
129
130
<MDBDropdown className='nav-item me-3 me-lg-1'>
131
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='nav-link hidden-arrow'>
132
<MDBIcon icon='chevron-circle-down' size='lg' />
133
</MDBDropdownToggle>
134
<MDBDropdownMenu>
135
<MDBDropdownItem link>Some news</MDBDropdownItem>
136
<MDBDropdownItem link>Another news</MDBDropdownItem>
137
<MDBDropdownItem link>Something else here</MDBDropdownItem>
138
</MDBDropdownMenu>
139
</MDBDropdown>
140
</MDBNavbarNav>
141
</MDBContainer>
142
</MDBNavbar>
143
</section>
144
</MDBContainer>
145
);
146
}
147
148
export default App;
149
Console errors: 0