Put sort and groupBy menu icons on right

This commit is contained in:
Chen-I Lim 2020-11-03 16:45:07 -08:00
parent 2232d531ee
commit e0bcb5ee60
2 changed files with 5 additions and 3 deletions

View file

@ -201,7 +201,7 @@ class ViewHeader extends React.Component<Props, State> {
key={option.id}
id={option.id}
name={option.name}
icon={boardTree.activeView.groupById === option.id ? <CheckIcon/> : undefined}
rightIcon={boardTree.activeView.groupById === option.id ? <CheckIcon/> : undefined}
onClick={(id) => {
if (boardTree.activeView.groupById === id) {
return
@ -269,7 +269,7 @@ class ViewHeader extends React.Component<Props, State> {
key={option.id}
id={option.id}
name={option.name}
icon={(activeView.sortOptions[0]?.propertyId === option.id) ? activeView.sortOptions[0].reversed ? <SortUpIcon/> : <SortDownIcon/> : undefined}
rightIcon={(activeView.sortOptions[0]?.propertyId === option.id) ? activeView.sortOptions[0].reversed ? <SortUpIcon/> : <SortDownIcon/> : undefined}
onClick={(propertyId: string) => {
let newSortOptions: ISortOption[] = []
if (activeView.sortOptions[0] && activeView.sortOptions[0].propertyId === propertyId) {

View file

@ -6,6 +6,7 @@ import {MenuOptionProps} from './menuItem'
type TextOptionProps = MenuOptionProps & {
icon?: React.ReactNode,
rightIcon?: React.ReactNode,
}
export default class TextOption extends React.PureComponent<TextOptionProps> {
@ -14,7 +15,7 @@ export default class TextOption extends React.PureComponent<TextOptionProps> {
}
public render(): JSX.Element {
const {name, icon} = this.props
const {name, icon, rightIcon} = this.props
return (
<div
className='MenuOption TextOption menu-option'
@ -22,6 +23,7 @@ export default class TextOption extends React.PureComponent<TextOptionProps> {
>
{icon}
<div className='menu-name'>{name}</div>
{rightIcon}
</div>
)
}