Skip to content

Commit 3f9c17c

Browse files
committed
refactor: delete unused attributes
1 parent b76c423 commit 3f9c17c

8 files changed

+44
-11
lines changed

src/Aside.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ class AppAside extends Component {
6262
}
6363

6464
render() {
65-
const { className, children, display, fixed, hidden, offCanvas, isOpen, tag: Tag, ...attributes } = this.props;
65+
const { className, children, tag: Tag, ...attributes } = this.props;
66+
67+
delete attributes.display
68+
delete attributes.fixed
69+
delete attributes.hidden
70+
delete attributes.offCanvas
71+
delete attributes.isOpen
6672

6773
const classes = classNames(className, 'aside-menu');
6874

src/AsideToggler.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,23 @@ class AppAsideToggler extends Component {
4545
}
4646

4747
render() {
48-
const { className, children, mobile, tag: Tag, display, ...attributes } = this.props;
48+
const { className, children, type, tag: Tag, ...attributes } = this.props;
49+
50+
delete attributes.display
51+
delete attributes.mobile
52+
delete attributes.display
4953

5054
const classes = classNames(className, 'navbar-toggler');
5155

5256
return (
53-
<button
54-
type="button"
57+
<Tag
58+
type={type}
5559
className={classes}
5660
{...attributes}
5761
onClick={(event)=>this.asideToggle(event)}
5862
>
5963
{children || <span className="navbar-toggler-icon" />}
60-
</button>
64+
</Tag>
6165
);
6266
}
6367
}

src/Breadcrumb.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ class AppBreadcrumb extends Component {
8282
}
8383

8484
render() {
85-
const { className, children, appRoutes, tag: Tag, ...attributes } = this.props;
85+
const { className, tag: Tag, ...attributes } = this.props;
86+
87+
delete attributes.children
88+
delete attributes.appRoutes
89+
8690
const classes = classNames(className);
8791

8892
return (

src/Footer.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ class AppFooter extends Component {
3030
}
3131

3232
render() {
33-
const { className, children, fixed, tag: Tag, ...attributes } = this.props;
33+
const { className, children, tag: Tag, ...attributes } = this.props;
34+
35+
delete attributes.fixed
3436

3537
const classes = classNames(className, 'app-footer');
3638

src/Header.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ class AppHeader extends Component {
2828
// }
2929

3030
render() {
31-
const { className, children, fixed, tag: Tag, ...attributes } = this.props;
31+
const { className, children, tag: Tag, ...attributes } = this.props;
32+
33+
delete attributes.fixed
3234

3335
const classes = classNames(className, 'app-header', 'navbar');
3436

src/Sidebar.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ class AppSidebar extends Component {
7171
}
7272

7373
render() {
74-
const { className, children, compact, display, fixed, minimized, offCanvas, isOpen, tag: Tag, staticContext, ...attributes } = this.props;
74+
const { className, children, tag: Tag, ...attributes } = this.props;
75+
76+
delete attributes.compact
77+
delete attributes.display
78+
delete attributes.fixed
79+
delete attributes.minimized
80+
delete attributes.offCanvas
81+
delete attributes.isOpen
82+
delete attributes.staticContext
7583

7684
const classes = classNames(className, 'sidebar');
7785

src/SidebarNav.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ class AppSidebarNav extends Component {
165165
}
166166

167167
render() {
168-
const { className, children, isOpen, tag: Tag, navConfig, staticContext, ...attributes } = this.props;
168+
const { className, children, navConfig, ...attributes } = this.props;
169+
170+
delete attributes.isOpen
171+
delete attributes.staticContext
172+
delete attributes.Tag
169173

170174
const navClasses = classNames(className, 'sidebar-nav');
171175

src/SidebarToggler.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ class AppSidebarToggler extends Component {
4343
}
4444

4545
render() {
46-
const { className, children, mobile, tag: Tag, display, ...attributes } = this.props;
46+
const { className, children, tag: Tag, ...attributes } = this.props;
47+
48+
delete attributes.mobile
49+
delete attributes.display
4750

4851
const classes = classNames(className, 'navbar-toggler');
4952

0 commit comments

Comments
 (0)