Skip to content

Commit

Permalink
Wrap in button to satisy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Oct 16, 2024
1 parent 2e9a65d commit aa67130
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions client/src/components/SearchBar/SwapLocationsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ export function SwapLocationsButton({
tripQueryVariables: TripQueryVariables;
setTripQueryVariables: (tripQueryVariables: TripQueryVariables) => void;
}) {
const onChange = () => {
const swapFromTo = () => {
setTripQueryVariables({
...tripQueryVariables,
from: tripQueryVariables.to,
to: tripQueryVariables.from,
});
};

return <img className="swap-from-to" alt={HINT} title={HINT} src={swapImg} onClick={onChange} />;
return (
<button className="swap-from-to" onClick={swapFromTo} title={HINT}>
<img alt={HINT} src={swapImg} />
</button>
);
}
7 changes: 6 additions & 1 deletion client/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@
}

.search-bar .swap-from-to {
border: none;
background: none;
margin: 30px 0 auto 0;
}

.search-bar .swap-from-to img {
width: 15px;
margin: 37px 0 auto 0;
}

.itinerary-list-container {
Expand Down

0 comments on commit aa67130

Please sign in to comment.