summaryrefslogtreecommitdiff
path: root/src/components/SideBar.js
diff options
context:
space:
mode:
authorhaishanh <[email protected]>2018-11-05 18:32:16 +0800
committerHaishan <[email protected]>2018-11-06 22:37:21 +0800
commit91ecdaa5dd1a65ff0ae944896945c0fe4bc23574 (patch)
tree9f7f476672fae91eca5df9e0ae021b45df950679 /src/components/SideBar.js
parent1adaedcbc551f6beee4e9e0b9fbd94197ebdffe5 (diff)
update: convert more components to function ones
includes Input, Config, SideBard. also removed react-redux Provider
Diffstat (limited to 'src/components/SideBar.js')
-rw-r--r--src/components/SideBar.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/SideBar.js b/src/components/SideBar.js
index b8cd61f..cee0960 100644
--- a/src/components/SideBar.js
+++ b/src/components/SideBar.js
@@ -12,14 +12,14 @@ import yacd from 's/yacd.svg';
import s from 'c/SideBar.module.scss';
-function SideBarRow({ iconId, labelText, to }) {
+const SideBarRow = React.memo(function SideBarRow({ iconId, labelText, to }) {
return (
<NavLink exact to={to} className={s.row} activeClassName={s.rowActive}>
<Icon id={iconId} width={28} height={28} />
<div className={s.label}>{labelText}</div>
</NavLink>
);
-}
+});
SideBarRow.propTypes = {
to: PropTypes.string.isRequired,
@@ -27,7 +27,7 @@ SideBarRow.propTypes = {
labelText: PropTypes.string
};
-export default function SideBar() {
+function SideBar() {
return (
<div className={s.root}>
<div className={s.logo}>
@@ -43,3 +43,5 @@ export default function SideBar() {
</div>
);
}
+
+export default React.memo(SideBar);