Skip to content

Commit

Permalink
refactor Suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Houlihan committed Jun 20, 2019
1 parent 81b8dbd commit 8738978
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/Components/Suggestion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import React from "react";
import styled from "styled-components";

const Wrapper = styled.div`
font-size: 14px;
padding: 1rem 1.5rem 1rem 1.5rem;
cursor: pointer;
width: 100%;
&:hover {
color: white;
background-color: ${props => props.selectColor};
}
`;

const Suggestion = ({
place,
clickHandler,
Expand All @@ -9,20 +21,9 @@ const Suggestion = ({
selectColor,
mouseInSuggestions
}) => {
const Wrapper = styled.div`
font-size: 14px;
padding: 1rem 1.5rem 1rem 1.5rem;
cursor: pointer;
width: 100%;
&:hover {
color: white;
background-color: ${selectColor};
}
`;

return (
<Wrapper
selectColor={selectColor}
style={
cursorIdx === idx && !mouseInSuggestions
? { color: "white", background: selectColor }
Expand Down

0 comments on commit 8738978

Please sign in to comment.