focalboard/webapp/src/components/cardDialog.tsx

48 lines
1.2 KiB
TypeScript
Raw Normal View History

2020-10-20 12:50:53 -07:00
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {Card} from '../blocks/card';
import {BoardTree} from '../boardTree';
import mutator from '../mutator';
import Menu from '../widgets/menu';
import CardDetail from './cardDetail';
import Dialog from './dialog';
2020-10-08 09:21:27 -07:00
type Props = {
2020-10-20 12:50:53 -07:00
boardTree: BoardTree
card: Card
onClose: () => void
2020-10-08 09:21:27 -07:00
}
class CardDialog extends React.Component<Props> {
2020-10-20 12:50:53 -07:00
render() {
const menu = (
<Menu>
2020-10-20 12:50:53 -07:00
<Menu.Text
id='delete'
name='Delete'
onClick={async () => {
await mutator.deleteBlock(this.props.card, 'delete card')
this.props.onClose()
}}
/>
</Menu>
)
return (
2020-10-20 12:50:53 -07:00
<Dialog
onClose={this.props.onClose}
toolsMenu={menu}
>
<CardDetail
boardTree={this.props.boardTree}
card={this.props.card}
/>
</Dialog>
)
2020-10-20 12:50:53 -07:00
}
2020-10-08 09:21:27 -07:00
}
2020-10-20 12:50:53 -07:00
export {CardDialog}