Put sort and groupBy menu icons on right
This commit is contained in:
parent
2232d531ee
commit
e0bcb5ee60
2 changed files with 5 additions and 3 deletions
|
@ -201,7 +201,7 @@ class ViewHeader extends React.Component<Props, State> {
|
||||||
key={option.id}
|
key={option.id}
|
||||||
id={option.id}
|
id={option.id}
|
||||||
name={option.name}
|
name={option.name}
|
||||||
icon={boardTree.activeView.groupById === option.id ? <CheckIcon/> : undefined}
|
rightIcon={boardTree.activeView.groupById === option.id ? <CheckIcon/> : undefined}
|
||||||
onClick={(id) => {
|
onClick={(id) => {
|
||||||
if (boardTree.activeView.groupById === id) {
|
if (boardTree.activeView.groupById === id) {
|
||||||
return
|
return
|
||||||
|
@ -269,7 +269,7 @@ class ViewHeader extends React.Component<Props, State> {
|
||||||
key={option.id}
|
key={option.id}
|
||||||
id={option.id}
|
id={option.id}
|
||||||
name={option.name}
|
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) => {
|
onClick={(propertyId: string) => {
|
||||||
let newSortOptions: ISortOption[] = []
|
let newSortOptions: ISortOption[] = []
|
||||||
if (activeView.sortOptions[0] && activeView.sortOptions[0].propertyId === propertyId) {
|
if (activeView.sortOptions[0] && activeView.sortOptions[0].propertyId === propertyId) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {MenuOptionProps} from './menuItem'
|
||||||
|
|
||||||
type TextOptionProps = MenuOptionProps & {
|
type TextOptionProps = MenuOptionProps & {
|
||||||
icon?: React.ReactNode,
|
icon?: React.ReactNode,
|
||||||
|
rightIcon?: React.ReactNode,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class TextOption extends React.PureComponent<TextOptionProps> {
|
export default class TextOption extends React.PureComponent<TextOptionProps> {
|
||||||
|
@ -14,7 +15,7 @@ export default class TextOption extends React.PureComponent<TextOptionProps> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
const {name, icon} = this.props
|
const {name, icon, rightIcon} = this.props
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className='MenuOption TextOption menu-option'
|
className='MenuOption TextOption menu-option'
|
||||||
|
@ -22,6 +23,7 @@ export default class TextOption extends React.PureComponent<TextOptionProps> {
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
<div className='menu-name'>{name}</div>
|
<div className='menu-name'>{name}</div>
|
||||||
|
{rightIcon}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue