From 43faeaab356b756d3487bcfd3d1dfc8ef34ef88b Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Sun, 18 Oct 2020 19:35:24 -0700 Subject: [PATCH] cleanup merge --- src/client/components/cardDetail.tsx | 19 +++++++++---------- src/client/components/dialog.tsx | 4 +--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/client/components/cardDetail.tsx b/src/client/components/cardDetail.tsx index 203b801e3..17f5cb657 100644 --- a/src/client/components/cardDetail.tsx +++ b/src/client/components/cardDetail.tsx @@ -1,21 +1,20 @@ import React from "react" -import { Block } from "../block" -import { Card } from "../card" import { BlockIcons } from "../blockIcons" +import { Block } from "../blocks/block" +import { Card } from "../blocks/card" +import { TextBlock } from "../blocks/textBlock" import { BoardTree } from "../boardTree" import { CardTree } from "../cardTree" -import Menu from "../widgets/menu" -import Dialog from "./dialog" +import { Menu as OldMenu, MenuOption } from "../menu" import mutator from "../mutator" -import {Menu as OldMenu, MenuOption} from "../menu" -import { IBlock } from "../octoTypes" +import { OctoListener } from "../octoListener" +import { IBlock, IOrderedBlock } from "../octoTypes" import { OctoUtils } from "../octoUtils" import { PropertyMenu } from "../propertyMenu" import { Utils } from "../utils" import Button from "./button" import { Editable } from "./editable" import { MarkdownEditor } from "./markdownEditor" -import { OctoListener } from "../octoListener" type Props = { boardTree: BoardTree @@ -50,7 +49,7 @@ export default class CardDetail extends React.Component { if (this.titleRef.current) { this.titleRef.current.focus() } - }, 0); + }, 0) }) } @@ -321,7 +320,7 @@ export default class CardDetail extends React.Component { await mutator.insertBlock(block, "add comment") } - private showContentBlockMenu(e: React.MouseEvent, block: IBlock) { + private showContentBlockMenu(e: React.MouseEvent, block: IOrderedBlock) { const { cardTree } = this.state const { card } = this.props const index = cardTree.contents.indexOf(block) @@ -363,7 +362,7 @@ export default class CardDetail extends React.Component { break } case "insertAbove-text": { - const newBlock = new Block({ type: "text", parentId: card.id }) + const newBlock = new TextBlock({ parentId: card.id }) // TODO: Handle need to reorder all blocks newBlock.order = OctoUtils.getOrderBefore(block, cardTree.contents) Utils.log(`insert block ${block.id}, order: ${block.order}`) diff --git a/src/client/components/dialog.tsx b/src/client/components/dialog.tsx index ac917cbd5..139836b24 100644 --- a/src/client/components/dialog.tsx +++ b/src/client/components/dialog.tsx @@ -1,7 +1,5 @@ import React from "react" -import Menu from "../widgets/menu" import MenuWrapper from "../widgets/menuWrapper" -import mutator from "../mutator" import Button from "./button" type Props = { @@ -41,7 +39,7 @@ export default class Dialog extends React.Component {
- + {toolsMenu}
}