Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmbradford committed Jun 19, 2019
1 parent 8e102af commit b6f64d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ComplaintDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ComplaintDetail extends React.Component {
return (
<button className="a-btn a-btn__link"
onClick={this.props.onClickedBack}>
{ iconMap.getIcon('left', 'cf-icon-left') }
{ iconMap.getIcon( 'left', 'cf-icon-left' ) }
Back to search results
</button>
)
Expand All @@ -87,7 +87,7 @@ export class ComplaintDetail extends React.Component {
return (
<button className="a-btn a-btn__link"
onClick={() => { window.location = root }}>
{ iconMap.getIcon('left', 'cf-icon-left') }
{ iconMap.getIcon( 'left', 'cf-icon-left' ) }
Go to search home page
</button>
)
Expand All @@ -104,7 +104,8 @@ export class ComplaintDetail extends React.Component {
<span className="cf-icon__before">
{ iconMap.getIcon(
'clock-round',
'cf-icon-clock-round' + ( value.toLowerCase() === 'no' ? ' not-timely' : '' )
'cf-icon-clock-round' +
( value.toLowerCase() === 'no' ? ' not-timely' : '' )
) }
</span>
<span className="body-copy">{ value }</span>
Expand Down
6 changes: 6 additions & 0 deletions src/iconMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const iconMap = {
'warning-round': <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1200" className="cf-icon-svg"><path d="M500 105.2c-276.1 0-500 223.9-500 500s223.9 500 500 500 500-223.9 500-500-223.9-500-500-500zm-49.7 234.6c0-27.6 22.4-50 50-50s50 22.4 50 50v328.6c0 27.6-22.4 50-50 50s-50-22.4-50-50V339.8zm50 582.5c-39.6 0-71.7-32.1-71.7-71.7s32.1-71.7 71.7-71.7S572 811 572 850.6s-32.1 71.7-71.7 71.7z"></path></svg>
}

/**
* Retrieve an SVG icon given it's name.
* @param {string} name - A cf-icon SVG canonical icon name.
* @param {string} customClass - A custom CSS class name to add to an icon.
* @returns {Object} An SVG icon markup.
*/
function getIcon( name, customClass ) {
let Icon = iconMap[name];
if ( typeof Icon === 'undefined' ) {
Expand Down

0 comments on commit b6f64d9

Please sign in to comment.