-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FilterToggle: add toggle component to be used in mB and a4 and to fix #…
…4547, hide filters and found string when no ideas
- Loading branch information
1 parent
b52aca6
commit 728083b
Showing
8 changed files
with
152 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from 'react' | ||
|
||
export const FilterToggle = (props) => { | ||
const { | ||
showFilters, | ||
onClickToggleFilter, | ||
btnString, | ||
showFiltersString, | ||
hideFiltersString | ||
} = props | ||
|
||
return ( | ||
<> | ||
{!showFilters | ||
? <button | ||
className="btn btn--icon btn--light" | ||
type="button" | ||
aria-describedby="span-id" | ||
onClick={onClickToggleFilter} | ||
> | ||
<i | ||
className="fas fa-sliders-h" | ||
aria-hidden="true" | ||
/> | ||
<span id="span-id" className="visually-hidden">{showFiltersString}</span> | ||
{btnString} | ||
</button> // eslint-disable-line react/jsx-closing-tag-location | ||
: <button | ||
className="btn btn--icon btn--light" | ||
type="button" | ||
aria-describedby="span-id" | ||
onClick={onClickToggleFilter} | ||
> | ||
<i | ||
className="fas fa-times" | ||
aria-hidden="true" | ||
/> | ||
<span id="span-id" className="visually-hidden">{hideFiltersString}</span> | ||
{btnString} | ||
{/* eslint-disable-next-line react/jsx-closing-tag-location */} | ||
</button>} | ||
</> | ||
|
||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,6 +186,12 @@ | |
} | ||
} | ||
|
||
.btn--icon-end { | ||
i { | ||
padding-left: 0.5rem; | ||
} | ||
} | ||
|
||
.btn--align-left { | ||
padding-left: 0; | ||
} | ||
|