Skip to content

Commit 984d2a0

Browse files
committed
Added B12 icon to SidebarHeader componentn
1 parent de9f9c7 commit 984d2a0

File tree

4 files changed

+44
-12
lines changed

4 files changed

+44
-12
lines changed

components/layout/sidebar/header/SidebarBackButton.es6.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class SidebarBackButton extends React.Component {
2525
<div
2626
className="ds-sidebar__header-back-button-container"
2727
onClick={this.handleClick}
28-
onTouchStart={this.handleClick}
2928
ref={this.backButtonRef}
3029
tabIndex="-1"
3130
>

components/layout/sidebar/header/SidebarHeader.es6.js

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import QuickActions from './QuickActions.es6.js'
66
import SidebarBackButton from './SidebarBackButton.es6.js'
77
import SidebarHeaderActionButton from './SidebarHeaderActionButton.es6.js'
88
import Button from '../../../form/button/Button.es6.js'
9-
import { Home } from '../../../Icons.es6.js'
9+
import { Home, B12Logo } from '../../../Icons.es6.js'
1010

1111
class SidebarHeader extends React.Component {
1212
state = {
@@ -74,17 +74,17 @@ class SidebarHeader extends React.Component {
7474
quickDialog,
7575
showLogo,
7676
steps,
77-
title
77+
title,
78+
b12Button,
79+
onB12Click
7880
} = this.props
7981
const { actionsAvailable, actionsVisible } = this.state
8082

8183
return (
8284
<Fragment>
83-
<div className="ds-sidebar__header">
85+
<div className={classnames('ds-sidebar__header', { 'ds-sidebar__header--b12-home-icon': b12Button })}>
8486
<div className="ds-sidebar__header-back">
85-
{showLogo && (
86-
<svg className="ds-sidebar__header-logo" id="b12-logo" viewBox="0 0 179.8 79.2" xmlns="http://www.w3.org/2000/svg"><title>B12</title><path d="M53.9,46a12.87,12.87,0,0,0-4.6-2.9c-2.5-.8-3.2-.9-10.1-.9H28.3V69.5h10c9.2,0,10.5-.2,13.8-2.2s5.4-6.4,5.4-11.3c0-4.2-1.3-7.7-3.6-10M51.6,11.4A9.44,9.44,0,0,0,47.1,9c-2.3-.6-3.5-.6-10-.6H28.2V33.2h11c4.4,0,8-.6,10.2-1.6,3.5-1.5,5.8-5.8,5.8-10.7a12.37,12.37,0,0,0-3.6-9.5M71.8,68.5a16,16,0,0,1-6.1,6.3,19.75,19.75,0,0,1-9,2.8c-1.6.1-4.5.1-8.6.1H0V69.3H6.4a9.59,9.59,0,0,0,4-.5,3.35,3.35,0,0,0,1.5-1.6,5.59,5.59,0,0,0,.7-2.6c0-.6.1-1.6.1-3.3v-45c0-1.5-.1-2.7-.1-3.3a5.36,5.36,0,0,0-.7-2.6c-.7-1.6-2.1-2.1-5.5-2.1H0V0H36.6c3.9,0,6.9.1,9,.1C54,.3,60,2,65.1,5.6A17,17,0,0,1,72.3,20a16.15,16.15,0,0,1-5.4,12.6c-2.8,2.6-4.8,3.6-10.1,5.1,5.4,1.4,6.9,2,10,4,4.9,3,7.8,9,7.8,15.8a23,23,0,0,1-2.8,11" fill="#6548c7"></path><path d="M78.5,77.7V69.3h7a12,12,0,0,0,3.9-.4,3.71,3.71,0,0,0,1.4-1.6,5.53,5.53,0,0,0,.7-2.5c0-.6.1-1.6.1-3V29.2H78.5V21.7c10.7-.1,14.1-2.2,16.8-10.4h10V58.5l.1,3.3a19.58,19.58,0,0,0,.1,3,5.73,5.73,0,0,0,.6,2.5c.8,1.6,2,2,5.4,2H118v8.4Z" fill="#6548c7"></path><path d="M179.2,64.3c-1.4,9.8-7.4,14.9-17.1,14.9-5.5,0-9.9-1.4-20.3-6.5-3-1.4-4.7-2-6.2-2-3.2,0-5.1,1.9-5.1,5.3v1.6h-7.7c-.1-1.1-.1-2-.1-2.6a33.4,33.4,0,0,1,2.1-11.4c2.5-6.5,6.8-10.6,16.3-15.2q6.45-3.15,9-4.5a24.88,24.88,0,0,0,6.4-4.6,13.54,13.54,0,0,0,3.9-9.2c0-7.7-5.6-12.5-14.6-12.5-7.8,0-12.2,2.8-14,8.9a9,9,0,0,1,4.2-1.1c4.3,0,7.4,3.3,7.4,7.9,0,5.3-3.5,8.8-8.8,8.8-6.5,0-10.8-4.8-10.8-12a19.15,19.15,0,0,1,6.9-14.5c4.9-4.2,10.8-6.1,19.4-6.1,15.9,0,26.7,8.8,26.7,21.9,0,10.9-6.2,17-21,20.9C142,56,140.6,56.5,136,60.4c-2.3,1.9-3.2,3.2-4.2,6.6,3.4-2.8,5.8-3.7,10.5-3.7a27.28,27.28,0,0,1,4.1.3l9.7,1.6a46.32,46.32,0,0,0,6.2.6c7.5,0,10.7-3.3,10.8-11.7H180a100.9,100.9,0,0,1-.8,10.2" fill="#6548c7"></path></svg>
87-
)}
87+
{showLogo && <B12Logo color="#6548c7" width={46} height={20} viewBox="0 0 200 80" className="ds-sidebar__header-logo" />}
8888

8989
{!showLogo && backButton && onBack && (
9090
<SidebarBackButton
@@ -110,6 +110,20 @@ class SidebarHeader extends React.Component {
110110
</React.Fragment>
111111
)}
112112

113+
{b12Button && (
114+
<React.Fragment>
115+
<div className="ds-sidebar__header-divider" />
116+
{!isScrollingDown && (
117+
<Button
118+
small
119+
className="ds-sidebar__header-home"
120+
icon={<B12Logo width={30} height={20} color="#84839c" viewBox="0 0 200 80" />}
121+
onClick={onB12Click}
122+
/>
123+
)}
124+
</React.Fragment>
125+
)}
126+
113127
{isScrollingDown && <div>{title}</div>}
114128
</div>
115129

@@ -179,7 +193,9 @@ SidebarHeader.defaultProps = {
179193
quickActions: [],
180194
showLogo: false,
181195
quickDialog: null,
182-
tabbedNavigation: null
196+
tabbedNavigation: null,
197+
b12Button: false,
198+
onB12Click: () => {}
183199
}
184200

185201
SidebarHeader.propTypes = {
@@ -204,7 +220,9 @@ SidebarHeader.propTypes = {
204220
onQuickActionSelected: PropTypes.func,
205221
showLogo: PropTypes.bool,
206222
quickDialog: PropTypes.element,
207-
tabbedNavigation: PropTypes.element
223+
tabbedNavigation: PropTypes.element,
224+
b12Button: PropTypes.bool,
225+
onB12Click: PropTypes.func
208226
}
209227

210228
export default SidebarHeader

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@b12/metronome",
3-
"version": "1.1.20",
3+
"version": "1.1.21",
44
"description": "",
55
"main": "index.es6.js",
66
"scripts": {

style/layout/side-pane.scss

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
font-family: $ds-font-family-base;
4949
}
5050

51-
h2 + h4 {
51+
h2+h4 {
5252
font-weight: normal;
5353
color: $ds-display-light-color;
5454
margin-bottom: spacing(xsm);
@@ -80,6 +80,17 @@
8080
box-shadow: none;
8181
}
8282

83+
&--b12-home-icon {
84+
.ds-sidebar__header-divider {
85+
margin: 0 8px;
86+
}
87+
88+
.ds-sidebar__header-home {
89+
margin-left: 0;
90+
padding: 0 !important;
91+
}
92+
}
93+
8394
&-title {
8495
font-family: $ds-font-family-base;
8596
font-size: 20px;
@@ -124,6 +135,10 @@
124135
svg path {
125136
fill: $ds-brand-light-color;
126137
}
138+
139+
#b12-logo path {
140+
fill: #5048c7;
141+
}
127142
}
128143
}
129144

@@ -157,7 +172,7 @@
157172
}
158173

159174
&-text {
160-
color: $ds-display-light-color;
175+
color: #585769;
161176
font-size: $header-small-font-size;
162177
font-weight: normal;
163178
padding-left: spacing('xxxxsm');

0 commit comments

Comments
 (0)