Simplifying a bit the view header
This commit is contained in:
parent
933ccce948
commit
0890698280
2 changed files with 4 additions and 3 deletions
|
@ -135,7 +135,6 @@ class CenterPanel extends React.Component<Props, State> {
|
||||||
addCardFromTemplate={this.addCardFromTemplate}
|
addCardFromTemplate={this.addCardFromTemplate}
|
||||||
addCardTemplate={this.addCardTemplate}
|
addCardTemplate={this.addCardTemplate}
|
||||||
editCardTemplate={this.editCardTemplate}
|
editCardTemplate={this.editCardTemplate}
|
||||||
withGroupBy={activeView.viewType === 'board'}
|
|
||||||
readonly={this.props.readonly}
|
readonly={this.props.readonly}
|
||||||
/>
|
/>
|
||||||
{activeView.viewType === 'board' &&
|
{activeView.viewType === 'board' &&
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {FormattedMessage} from 'react-intl'
|
||||||
import ViewMenu from '../../components/viewMenu'
|
import ViewMenu from '../../components/viewMenu'
|
||||||
import mutator from '../../mutator'
|
import mutator from '../../mutator'
|
||||||
import {BoardTree} from '../../viewModel/boardTree'
|
import {BoardTree} from '../../viewModel/boardTree'
|
||||||
|
import {IViewType} from '../../blocks/boardView'
|
||||||
import Button from '../../widgets/buttons/button'
|
import Button from '../../widgets/buttons/button'
|
||||||
import IconButton from '../../widgets/buttons/iconButton'
|
import IconButton from '../../widgets/buttons/iconButton'
|
||||||
import DropdownIcon from '../../widgets/icons/dropdown'
|
import DropdownIcon from '../../widgets/icons/dropdown'
|
||||||
|
@ -32,16 +33,17 @@ type Props = {
|
||||||
addCardFromTemplate: (cardTemplateId: string) => void
|
addCardFromTemplate: (cardTemplateId: string) => void
|
||||||
addCardTemplate: () => void
|
addCardTemplate: () => void
|
||||||
editCardTemplate: (cardTemplateId: string) => void
|
editCardTemplate: (cardTemplateId: string) => void
|
||||||
withGroupBy?: boolean
|
|
||||||
readonly: boolean
|
readonly: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const ViewHeader = React.memo((props: Props) => {
|
const ViewHeader = React.memo((props: Props) => {
|
||||||
const [showFilter, setShowFilter] = useState(false)
|
const [showFilter, setShowFilter] = useState(false)
|
||||||
|
|
||||||
const {boardTree, showView, withGroupBy} = props
|
const {boardTree, showView} = props
|
||||||
const {board, activeView} = boardTree
|
const {board, activeView} = boardTree
|
||||||
|
|
||||||
|
const withGroupBy = activeView.type === 'board'
|
||||||
|
|
||||||
const [viewTitle, setViewTitle] = useState(activeView.title)
|
const [viewTitle, setViewTitle] = useState(activeView.title)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
Loading…
Reference in a new issue