more lint fixes

This commit is contained in:
Sol
2020-08-04 19:34:47 +01:00
committed by Sol Abrahams
parent 1f4f307f0d
commit da51dabe82
2 changed files with 6 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
import React from 'react'
const SearchRow = ({ description, category, location, date, query }) => {
function getHighlightedText(text, highlight) {
function getHighlightedText (text, highlight) {
// Split text on highlight term, include term itself into parts, ignore case
const parts = text.split(new RegExp(`(${highlight})`, 'gi'));
const parts = text.split(new RegExp(`(${highlight})`, 'gi'))
return <span>{ parts.map(part => part.toLowerCase() === highlight.toLowerCase() ? <span style={{ backgroundColor: 'yellow', color: 'black' }}>{part}</span> : part) }</span>
}