From 08906982803e33a6454ffaf7ff3fa240f678a9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 31 Mar 2021 13:00:04 +0200 Subject: [PATCH] Simplifying a bit the view header --- webapp/src/components/centerPanel.tsx | 1 - webapp/src/components/viewHeader/viewHeader.tsx | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp/src/components/centerPanel.tsx b/webapp/src/components/centerPanel.tsx index c682b0047..ed6e9f806 100644 --- a/webapp/src/components/centerPanel.tsx +++ b/webapp/src/components/centerPanel.tsx @@ -135,7 +135,6 @@ class CenterPanel extends React.Component { addCardFromTemplate={this.addCardFromTemplate} addCardTemplate={this.addCardTemplate} editCardTemplate={this.editCardTemplate} - withGroupBy={activeView.viewType === 'board'} readonly={this.props.readonly} /> {activeView.viewType === 'board' && diff --git a/webapp/src/components/viewHeader/viewHeader.tsx b/webapp/src/components/viewHeader/viewHeader.tsx index 2f50bc8bd..ca18b2ce6 100644 --- a/webapp/src/components/viewHeader/viewHeader.tsx +++ b/webapp/src/components/viewHeader/viewHeader.tsx @@ -6,6 +6,7 @@ import {FormattedMessage} from 'react-intl' import ViewMenu from '../../components/viewMenu' import mutator from '../../mutator' import {BoardTree} from '../../viewModel/boardTree' +import {IViewType} from '../../blocks/boardView' import Button from '../../widgets/buttons/button' import IconButton from '../../widgets/buttons/iconButton' import DropdownIcon from '../../widgets/icons/dropdown' @@ -32,16 +33,17 @@ type Props = { addCardFromTemplate: (cardTemplateId: string) => void addCardTemplate: () => void editCardTemplate: (cardTemplateId: string) => void - withGroupBy?: boolean readonly: boolean } const ViewHeader = React.memo((props: Props) => { const [showFilter, setShowFilter] = useState(false) - const {boardTree, showView, withGroupBy} = props + const {boardTree, showView} = props const {board, activeView} = boardTree + const withGroupBy = activeView.type === 'board' + const [viewTitle, setViewTitle] = useState(activeView.title) useEffect(() => {