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
MDBRow,
5
MDBCard,
6
MDBCol,
7
MDBDatepicker,
8
MDBSelectDeprecated,
9
MDBCardBody,
10
MDBBtn,
11
MDBIcon,
12
MDBChart,
13
MDBCardHeader,
14
MDBCardFooter,
15
MDBTabs,
16
MDBTabsPane,
17
MDBTabsContent,
18
MDBTabsItem,
19
MDBTabsLink
20
} from 'mdb-react-ui-kit';
21
22
function App() {
23
const [verticalActive, setVerticalActive] = useState('tab1');
24
25
const handleVerticalClick = (value: string) => {
26
if (value === verticalActive) {
27
return;
28
}
29
30
setVerticalActive(value);
31
};
32
33
return (
34
<MDBContainer fluid>
35
<MDBRow className='justify-content-center'>
36
<MDBCol md='8'>
37
<section>
38
<MDBCard>
39
<MDBCardBody>
40
<MDBRow>
41
<MDBCol size='3'>
42
<MDBTabs pills className='flex-column text-center'>
43
<MDBTabsItem>
44
<MDBTabsLink onClick={() => handleVerticalClick('tab1')} active={verticalActive === 'tab1'}>
45
Sales
46
</MDBTabsLink>
47
</MDBTabsItem>
48
<MDBTabsItem>
49
<MDBTabsLink onClick={() => handleVerticalClick('tab2')} active={verticalActive === 'tab2'}>
50
Orders
51
</MDBTabsLink>
52
</MDBTabsItem>
53
<MDBTabsItem>
54
<MDBTabsLink onClick={() => handleVerticalClick('tab3')} active={verticalActive === 'tab3'}>
55
Value
56
</MDBTabsLink>
57
</MDBTabsItem>
58
</MDBTabs>
59
</MDBCol>
60
61
<MDBCol size='9' className='text-center'>
62
<MDBTabsContent>
63
<MDBTabsPane show={verticalActive === 'tab1'}>
64
<p className='text-uppercase small mb-2'>
65
<strong>Total sales</strong>
66
</p>
67
<h5 className='mb-0'>
68
<strong>$ 4567</strong>
69
<small className='text-success ms-2'>
70
<MDBIcon fas icon='arrow-up' size='sm' className='pe-1' />
71
13,48%
72
</small>
73
</h5>
74
75
<hr />
76
77
<MDBChart
78
type='doughnut'
79
data={{
80
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
81
datasets: [
82
{
83
label: 'Traffic',
84
data: [2112, 2343, 2545, 3423, 2365, 1985, 987],
85
backgroundColor: [
86
'rgba(63, 81, 181, 0.5)',
87
'rgba(77, 182, 172, 0.5)',
88
'rgba(66, 133, 244, 0.5)',
89
'rgba(156, 39, 176, 0.5)',
90
'rgba(233, 30, 99, 0.5)',
91
'rgba(66, 73, 244, 0.4)',
92
'rgba(66, 133, 244, 0.2)',
93
],
94
},
95
],
96
}}
97
/>
98
</MDBTabsPane>
99
<MDBTabsPane show={verticalActive === 'tab2'}>
100
<p className='text-uppercase small mb-2'>
101
<strong>Orders</strong>
102
</p>
103
<h5 className='mb-0'>
104
<strong>534 </strong>
105
<small className='text-success ms-2'>
106
<MDBIcon fas icon='arrow-up' size='sm' className='pe-1' />
107
23,58%
108
</small>
109
</h5>
110
111
<hr />
112
113
<MDBChart
114
type='radar'
115
data={{
116
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
117
datasets: [
118
{
119
label: 'Traffic',
120
data: [2112, 2343, 2545, 3423, 2365, 1985, 987],
121
backgroundColor: [
122
'rgba(63, 81, 181, 0.5)',
123
'rgba(77, 182, 172, 0.5)',
124
'rgba(66, 133, 244, 0.5)',
125
'rgba(156, 39, 176, 0.5)',
126
'rgba(233, 30, 99, 0.5)',
127
'rgba(66, 73, 244, 0.4)',
128
'rgba(66, 133, 244, 0.2)',
129
],
130
},
131
],
132
}}
133
/>
134
</MDBTabsPane>
135
<MDBTabsPane show={verticalActive === 'tab3'}>
136
<p className='text-uppercase small mb-2'>
137
<strong>Average order value</strong>
138
</p>
139
<h5 className='mb-0'>
140
<strong>$ 123</strong>
141
<small className='text-danger ms-2'>
142
<MDBIcon fas icon='arrow-down' size='sm' className='pe-1' />
143
23,58%
144
</small>
145
</h5>
146
147
<hr />
148
149
<MDBChart
150
type='polarArea'
151
data={{
152
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
153
datasets: [
154
{
155
label: 'Traffic',
156
data: [2112, 2343, 2545, 3423, 2365, 1985, 987],
157
backgroundColor: [
158
'rgba(63, 81, 181, 0.5)',
159
'rgba(77, 182, 172, 0.5)',
160
'rgba(66, 133, 244, 0.5)',
161
'rgba(156, 39, 176, 0.5)',
162
'rgba(233, 30, 99, 0.5)',
163
'rgba(66, 73, 244, 0.4)',
164
'rgba(66, 133, 244, 0.2)',
165
],
166
},
167
],
168
}}
169
/>
170
</MDBTabsPane>
171
</MDBTabsContent>
172
</MDBCol>
173
</MDBRow>
174
</MDBCardBody>
175
</MDBCard>
176
</section>
177
</MDBCol>
178
</MDBRow>
179
</MDBContainer>
180
);
181
}
182
183
export default App;
184
Console errors: 0