1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-18 09:06:14 +07:00

fix: verdaccio/jsx-no-style

This commit is contained in:
Griffithtp
2019-06-29 23:39:56 +01:00
parent 4746f4070c
commit 55b1402456
5 changed files with 58 additions and 32 deletions

View File

@@ -1,4 +1,5 @@
import React, { KeyboardEvent } from 'react';
import { css } from 'emotion';
import Autosuggest from 'react-autosuggest';
import match from 'autosuggest-highlight/match';
import parse from 'autosuggest-highlight/parse';
@@ -53,12 +54,14 @@ const renderSuggestion = (suggestion, { query, isHighlighted }): JSX.Element =>
<MenuItem component="div" selected={isHighlighted}>
<div>
{parts.map((part, index) => {
return part.highlight ? (
<a href={suggestion.link} key={String(index)} style={{ fontWeight: fontWeight.semiBold }}>
{part.text}
</a>
) : (
<a href={suggestion.link} key={String(index)} style={{ fontWeight: fontWeight.light }}>
const fw = part.highlight ? fontWeight.semiBold : fontWeight.light;
return (
<a
className={css`
font-weight: ${fw};
`}
href={suggestion.link}
key={String(index)}>
{part.text}
</a>
);