Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 318e472

Browse files
authored
fix(components): prettify code (#348)
1 parent 6e1aa36 commit 318e472

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

src/components/BannerMessage/BannerMessage.jsx

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,20 @@ import classnames from 'classnames'
1212
*/
1313

1414
const BannerMessage = props => {
15-
const { className, button, closed, header, icon, children, info, warning, error, success, onCloseClicked, ...rest } = props
15+
const {
16+
className,
17+
button,
18+
closed,
19+
header,
20+
icon,
21+
children,
22+
info,
23+
warning,
24+
error,
25+
success,
26+
onCloseClicked,
27+
...rest
28+
} = props
1629
const forceInfo = !info && !warning && !error && !success
1730

1831
function getOneDismissElement () {
@@ -42,28 +55,27 @@ const BannerMessage = props => {
4255
<BannerMessageHeader>{headerContent}</BannerMessageHeader>
4356
)
4457
const alertIcon = (
45-
<i className={classnames('banner-message__alert', {
46-
'icon_check_alt2': success,
47-
'ei icon_info_alt': info || forceInfo,
48-
'ei icon_error-triangle_alt': warning,
49-
'ei icon_error-circle_alt': error
50-
})} />
58+
<i
59+
className={classnames('banner-message__alert', {
60+
icon_check_alt2: success,
61+
'ei icon_info_alt': info || forceInfo,
62+
'ei icon_error-triangle_alt': warning,
63+
'ei icon_error-circle_alt': error
64+
})}
65+
/>
5166
)
5267
const DismissElement = getOneDismissElement()
5368

5469
return (
5570
<div className={classnames('banner-message__wrapper', className)}>
5671
<div
57-
className={classnames(
58-
'banner-message',
59-
{
60-
info: info || forceInfo,
61-
success,
62-
error,
63-
warning,
64-
closed
65-
}
66-
)}
72+
className={classnames('banner-message', {
73+
info: info || forceInfo,
74+
success,
75+
error,
76+
warning,
77+
closed
78+
})}
6779
{...rest}
6880
>
6981
{alertIcon}

src/components/unstable/Layout/Layout.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,8 @@ Layout.propTypes = {
3333
}
3434
Layout.Header = generic({ name: 'LayoutHeader', className: 'layout__header' })
3535
Layout.Nav = generic({ name: 'LayoutNav', className: 'layout__nav' })
36-
Layout.Notification = generic({ name: 'LayoutNotification', className: 'layout__notification' })
36+
Layout.Notification = generic({
37+
name: 'LayoutNotification',
38+
className: 'layout__notification'
39+
})
3740
Layout.Body = generic({ name: 'LayoutBody', className: 'layout__body' })

0 commit comments

Comments
 (0)