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

Commit

Permalink
Format source with prettier-standard
Browse files Browse the repository at this point in the history
This should be happening on every commit, but someone has been skipping
the pre-commit hook.
  • Loading branch information
bespokebob authored and cdaringe committed Sep 28, 2018
1 parent 11c888e commit 05e7484
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 22 deletions.
27 changes: 22 additions & 5 deletions src/components/BannerMessage/BannerMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,35 @@ const BannerMessage = props => {
}

function getOneDismissElement () {
const dismissIcon = <i className={`banner-message__close-icon ei icon_close`} onClick={props.onCloseClicked} />
const dismissButton = <Button size='tiny' className='banner-message__close-button' onClick={props.onCloseClicked}>{props.button}</Button>
const dismissIcon = (
<i
className={`banner-message__close-icon ei icon_close`}
onClick={props.onCloseClicked}
/>
)
const dismissButton = (
<Button
size='tiny'
className='banner-message__close-button'
onClick={props.onCloseClicked}
>
{props.button}
</Button>
)
return (!icon && props.button && dismissButton) || dismissIcon
}

const childIsString = (typeof children === 'string')
const childIsString = typeof children === 'string'
const nakedHeader = childIsString && !header && children
const status = getStatus()
const headerContent = header || nakedHeader || ''
const childContent = !childIsString ? children : ''
const headerMarkup = headerContent && <BannerMessageHeader>{headerContent}</BannerMessageHeader>
const alertIcon = <i className={`banner-message__alert ${getAlertIconClass()}`} />
const headerMarkup = headerContent && (
<BannerMessageHeader>{headerContent}</BannerMessageHeader>
)
const alertIcon = (
<i className={`banner-message__alert ${getAlertIconClass()}`} />
)
const DismissElement = getOneDismissElement()

return (
Expand Down
7 changes: 2 additions & 5 deletions src/components/BannerMessage/BannerMessageBody.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import React from 'react'

/**
* Body for Banner Message. Can contain any children (e.g. text, lists, image)
* Body for Banner Message. Can contain any children (e.g. text, lists, image)
*/

const BannerMessageBody = props => {
const { children, ...rest } = props
return (
<p
className='banner-message__body'
{...rest}
>
<p className='banner-message__body' {...rest}>
{children}
</p>
)
Expand Down
7 changes: 2 additions & 5 deletions src/components/BannerMessage/BannerMessageFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ const BannerMessageFooter = props => {
function getAlignmentClass () {
const defaultAlignment = 'banner-message__footer-center'
if (center || (alignment && alignment === 'center')) return defaultAlignment
if (right || (alignment && alignment === 'right')) return 'banner-message__footer-right'
if (right || (alignment && alignment === 'right')) { return 'banner-message__footer-right' }
return defaultAlignment
}

return (
<div
className={`banner-message__footer ${getAlignmentClass()}`}
{...rest}
>
<div className={`banner-message__footer ${getAlignmentClass()}`} {...rest}>
{children}
</div>
)
Expand Down
6 changes: 3 additions & 3 deletions src/components/BannerMessage/BannerMessageHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const BannerMessageHeader = props => {
const { children, ...rest } = props

return (
<div
className='banner-message__header'
{...rest}>{children}</div>
<div className='banner-message__header' {...rest}>
{children}
</div>
)
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/PaginationControl/PaginationControl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ PaginationControl.propTypes = {
*/
disabled: PropTypes.bool,
/**
* Set page number.
*/
* Set page number.
*/
page: PropTypes.number,
/**
* Set total number of pages.
*/
* Set total number of pages.
*/
totalPages: PropTypes.number
}

0 comments on commit 05e7484

Please sign in to comment.