-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #408 from rhinogram/a-z
RHIN-10083: Adds A-Z sort component
- Loading branch information
Showing
17 changed files
with
153 additions
and
24 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -495,3 +495,7 @@ | |
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.dropdown-caret--diabled { | ||
color: @global-color-gray-light; | ||
} |
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,31 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Icon from './Icon'; | ||
import Button from './Button'; | ||
|
||
const SortAZ = ({ handleSort, sortDirection, className }) => { | ||
const disabledCaretClass = 'dropdown-caret--diabled '; | ||
|
||
const caretUpClass = sortDirection === 'asc' ? disabledCaretClass : ''; // ascending | ||
const caretDownClass = sortDirection === 'asc' ? '' : disabledCaretClass; // descending | ||
return ( | ||
<Button type="reset" className={`u-text-xsmall u-flex u-p-a-small ${className || ''}`} onClick={handleSort}> | ||
<span className="u-flex u-flex-direction-column u-p-a-xsmall"> | ||
<div className="u-text-tiny u-line-height-tiny ">A</div> | ||
<div className="u-text-tiny u-line-height-tiny ">Z</div> | ||
</span> | ||
<span className="u-flex u-flex-direction-column u-flex-justify-center"> | ||
<Icon icon="caret-up" className={caretUpClass} size="small" /> | ||
<Icon icon="caret-down" className={caretDownClass} size="small" /> | ||
</span> | ||
</Button> | ||
); | ||
}; | ||
|
||
SortAZ.propTypes = { | ||
handleSort: PropTypes.func.isRequired, | ||
sortDirection: PropTypes.string.isRequired, | ||
className: PropTypes.string, | ||
}; | ||
|
||
export default SortAZ; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.