Skip to content

Commit 537993b

Browse files
committed
fix code-related console warnings
1 parent b6ecf2e commit 537993b

File tree

13 files changed

+38
-59
lines changed

13 files changed

+38
-59
lines changed

src/components/Header/HeaderView.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
AppBar,
44
Toolbar,
55
IconButton,
6-
Button,
76
InputBase,
87
Menu,
98
MenuItem,

src/components/Sidebar/SidebarContainer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default compose(
2323
componentWillMount() {
2424
window.addEventListener('resize', this.props.handleWindowWidthChange);
2525
this.props.handleWindowWidthChange();
26-
console.log(this.props);
2726
},
2827
componentWillUnmount() {
2928
window.removeEventListener('resize', this.props.handleWindowWidthChange);

src/components/Sidebar/SidebarView.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ import React from 'react';
22
import {
33
Drawer,
44
IconButton,
5-
Divider,
65
List,
7-
Typography,
86
withStyles } from "@material-ui/core";
97
import {
10-
ChevronRight as ChevronRightIcon,
11-
ChevronLeft as ChevronLeftIcon,
128
Home as HomeIcon,
139
NotificationsNone as NotificationsIcon,
1410
FormatSize as TypographyIcon,
@@ -25,11 +21,12 @@ import SidebarLink from './components/SidebarLink';
2521
import Dot from './components/Dot';
2622

2723
const structure = [
28-
{ label: 'Dashboard', link: '/app/dashboard', icon: <HomeIcon /> },
29-
{ label: 'Typography', link: '/app/typography', icon: <TypographyIcon /> },
30-
{ label: 'Tables', link: '/app/tables', icon: <TableIcon /> },
31-
{ label: 'Notifications', link: '/app/notifications', icon: <NotificationsIcon />},
24+
{ id: 0, label: 'Dashboard', link: '/app/dashboard', icon: <HomeIcon /> },
25+
{ id: 1, label: 'Typography', link: '/app/typography', icon: <TypographyIcon /> },
26+
{ id: 2, label: 'Tables', link: '/app/tables', icon: <TableIcon /> },
27+
{ id: 3, label: 'Notifications', link: '/app/notifications', icon: <NotificationsIcon />},
3228
{
29+
id: 4,
3330
label: 'UI Elements',
3431
link: '/app/ui',
3532
icon: <UIElementsIcon />,
@@ -39,16 +36,16 @@ const structure = [
3936
{ label: 'Maps', link: '/app/ui/maps' },
4037
],
4138
},
42-
{ type: 'divider' },
43-
{ type: 'title', label: 'HELP' },
44-
{ label: 'Library', link: '', icon: <LibraryIcon /> },
45-
{ label: 'Support', link: '', icon: <SupportIcon /> },
46-
{ label: 'FAQ', link: '', icon: <FAQIcon />},
47-
{ type: 'divider' },
48-
{ type: 'title', label: 'PROJECTS' },
49-
{ label: 'My recent', link: '', icon: <Dot size="large" color="warning" /> },
50-
{ label: 'Starred', link: '', icon: <Dot size="large" color="primary" /> },
51-
{ label: 'Background', link: '', icon: <Dot size="large" color="secondary" /> },
39+
{ id: 5, type: 'divider' },
40+
{ id: 6, type: 'title', label: 'HELP' },
41+
{ id: 7, label: 'Library', link: '', icon: <LibraryIcon /> },
42+
{ id: 8, label: 'Support', link: '', icon: <SupportIcon /> },
43+
{ id: 9, label: 'FAQ', link: '', icon: <FAQIcon />},
44+
{ id: 10, type: 'divider' },
45+
{ id: 11, type: 'title', label: 'PROJECTS' },
46+
{ id: 12, label: 'My recent', link: '', icon: <Dot size="large" color="warning" /> },
47+
{ id: 13, label: 'Starred', link: '', icon: <Dot size="large" color="primary" /> },
48+
{ id: 14, label: 'Background', link: '', icon: <Dot size="large" color="secondary" /> },
5249
];
5350

5451
const SidebarView = ({ classes, theme, toggleSidebar, isSidebarOpened, isPermanent }) => {
@@ -70,14 +67,13 @@ const SidebarView = ({ classes, theme, toggleSidebar, isSidebarOpened, isPermane
7067
<div className={classes.toolbar} />
7168
<div className={classes.mobileBackButton}>
7269
<IconButton
73-
color="textSecondary"
7470
onClick={toggleSidebar}
7571
>
7672
<ArrowBackIcon classes={{ root: classNames(classes.headerIcon, classes.headerIconCollapse) }} />
7773
</IconButton>
7874
</div>
7975
<List className={classes.sidebarList}>
80-
{structure.map(link => <SidebarLink isSidebarOpened={isSidebarOpened} key={link && link.link || link.label} {...link} />)}
76+
{structure.map(link => <SidebarLink key={link.id} isSidebarOpened={isSidebarOpened} {...link} />)}
8177
</List>
8278
</Drawer>
8379
);

src/components/Sidebar/components/SidebarLink.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class SidebarLink extends Component {
6464
return (
6565
<ListItem
6666
button
67-
component={Link}
68-
to={!!link && link}
67+
component={link && Link}
68+
to={link}
6969
className={classes.link}
7070
classes={{
7171
root: classnames(classes.linkRoot, {
@@ -98,7 +98,7 @@ class SidebarLink extends Component {
9898
<React.Fragment>
9999
<ListItem
100100
button
101-
component={Link}
101+
component={link && Link}
102102
onClick={this.toggleCollapse}
103103
className={classes.link}
104104
to={link}

src/components/Widget/WidgetContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { compose, withState, withHandlers } from 'recompose';
1+
import { compose, withState } from 'recompose';
22

33
import WidgetView from './WidgetView';
44

src/components/Wrappers/Wrappers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ const createStyled = (styles, options) => {
6565
return withStyles(styles, options)(Styled);
6666
};
6767

68-
const BadgeExtended = ({ classes, theme, children, ...props }) => {
68+
const BadgeExtended = ({ classes, theme, children, colorBrightness, ...props }) => {
6969
const Styled = createStyled({
7070
badge: {
71-
backgroundColor: getColor(props.color, theme, props.colorBrightness)
71+
backgroundColor: getColor(props.color, theme, colorBrightness)
7272
}
7373
});
7474

@@ -99,10 +99,10 @@ export const Badge = withStyles(
9999
{ withTheme: true }
100100
)(BadgeExtended);
101101

102-
const TypographyExtended = ({ theme, children, weight, size, ...props }) => (
102+
const TypographyExtended = ({ theme, children, weight, size, colorBrightness, ...props }) => (
103103
<TypographyBase
104104
style={{
105-
color: getColor(props.color, theme, props.colorBrightness),
105+
color: getColor(props.color, theme, colorBrightness),
106106
fontWeight: getFontWeight(weight),
107107
fontSize: getFontSize(size, props.variant, theme)
108108
}}

src/pages/dashboard/Dashboard.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
11
import React from "react";
22
import {
33
Grid,
4-
Paper,
54
LinearProgress,
6-
FormControl,
7-
InputLabel,
85
Select,
96
OutlinedInput,
107
MenuItem,
118
withStyles,
12-
withTheme
139
} from "@material-ui/core";
14-
import { ShowChart as ShowChartIcon } from "@material-ui/icons";
1510
import {
1611
ResponsiveContainer,
1712
ComposedChart,
1813
AreaChart,
1914
LineChart,
20-
CartesianGrid,
2115
Line,
2216
Area,
23-
Tooltip,
2417
PieChart,
2518
Pie,
2619
Cell,
2720
YAxis,
2821
XAxis
2922
} from "recharts";
30-
import classnames from "classnames";
3123

3224
import mock from "./mock";
3325
import Widget from "../../components/Widget";
@@ -128,15 +120,15 @@ const Dashboard = ({ classes, theme, ...props }) => {
128120
justify="space-between"
129121
alignItems="center"
130122
>
131-
<Grid item direction="column" alignItems="center">
123+
<Grid item>
132124
<Typography color="textSecondary">Registrations</Typography>
133125
<Typography size="md">860</Typography>
134126
</Grid>
135-
<Grid item direction="column" alignItems="center">
127+
<Grid item>
136128
<Typography color="textSecondary">Sign Out</Typography>
137129
<Typography size="md">32</Typography>
138130
</Grid>
139-
<Grid item direction="column" alignItems="center">
131+
<Grid item>
140132
<Typography color="textSecondary">Rate</Typography>
141133
<Typography size="md">3.25%</Typography>
142134
</Grid>
@@ -170,7 +162,7 @@ const Dashboard = ({ classes, theme, ...props }) => {
170162
<Grid item sm={6}>
171163
<div className={classes.pieChartLegendWrapper}>
172164
{PieChartData.map(({ name, value, color }, index) => (
173-
<div className={classes.legendItemContainer}>
165+
<div key={color} className={classes.legendItemContainer}>
174166
<Dot color={color} />
175167
<Typography>&nbsp;{name}&nbsp;</Typography>
176168
<Typography color="textSecondary">
@@ -343,6 +335,7 @@ const Dashboard = ({ classes, theme, ...props }) => {
343335
onChange={e => props.setMainChartState(e.target.value)}
344336
input={
345337
<OutlinedInput
338+
labelWidth={0}
346339
classes={{ input: classes.mainChartSelect }}
347340
/>
348341
}
@@ -378,7 +371,6 @@ const Dashboard = ({ classes, theme, ...props }) => {
378371
type="natural"
379372
dataKey="desktop"
380373
fill={theme.palette.background.light}
381-
stroke={false}
382374
activeDot={false}
383375
/>
384376
<Line
@@ -405,7 +397,7 @@ const Dashboard = ({ classes, theme, ...props }) => {
405397
</Widget>
406398
</Grid>
407399
{mock.bigStat.map(stat => (
408-
<Grid item md={4} sm={6} xs={12}>
400+
<Grid item md={4} sm={6} xs={12} key={stat.product}>
409401
<BigStat {...stat} />
410402
</Grid>
411403
))}

src/pages/dashboard/components/BigStat/BigStat.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { PureComponent } from "react";
22
import { Grid, Select, MenuItem, Input, withStyles } from "@material-ui/core";
3-
import { grey, green, red } from "@material-ui/core/colors";
43
import { ArrowForward as ArrowForwardIcon } from "@material-ui/icons";
54
import { BarChart, Bar } from "recharts";
65
import classnames from "classnames";
@@ -59,7 +58,7 @@ class BigStat extends PureComponent {
5958
>
6059
<div className={classes.totalValueContainer}>
6160
<div className={classes.totalValue}>
62-
<Typography size="xxl" color="textSecondary-">
61+
<Typography size="xxl" color="textSecondary">
6362
{total[value]}
6463
</Typography>
6564
<Typography color={total.percent.profit ? "success" : "secondary"}>

src/pages/dashboard/components/Table/Table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const TableComponent = ({ data }) => {
2727
</TableRow>
2828
</TableHead>
2929
<TableBody>
30-
{data.map(({ name, email, product, price, date, city, status }) => (
31-
<TableRow>
30+
{data.map(({ id, name, email, product, price, date, city, status }) => (
31+
<TableRow key={id}>
3232
<TableCell className="pl-3 fw-normal">{name}</TableCell>
3333
<TableCell>{email}</TableCell>
3434
<TableCell>{product}</TableCell>

src/pages/icons/IconsView.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from "react";
22
import {
33
Typography,
44
Grid,
5-
AppBar,
65
Tabs,
76
Tab,
87
Paper,

0 commit comments

Comments
 (0)