1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00

Move Button into widgets

This commit is contained in:
Jesús Espino 2020-10-27 22:04:38 +01:00
parent 775db6c36d
commit de18121a98
8 changed files with 5 additions and 76 deletions

View File

@ -16,10 +16,10 @@ import Menu from '../widgets/menu'
import MenuWrapper from '../widgets/menuWrapper'
import OptionsIcon from '../widgets/icons/options'
import AddIcon from '../widgets/icons/add'
import Button from '../widgets/buttons/button'
import BoardCard from './boardCard'
import {BoardColumn} from './boardColumn'
import Button from './button'
import {CardDialog} from './cardDialog'
import {Editable} from './editable'
import RootPortal from './rootPortal'

View File

@ -14,8 +14,8 @@ import {Utils} from '../utils'
import MenuWrapper from '../widgets/menuWrapper'
import Menu from '../widgets/menu'
import Editable from '../widgets/editable'
import Button from '../widgets/buttons/button'
import Button from './button'
import {MarkdownEditor} from './markdownEditor'
import ContentBlock from './contentBlock'
import CommentsList from './commentsList'

View File

@ -3,8 +3,7 @@
import React from 'react'
import MenuWrapper from '../widgets/menuWrapper'
import Button from './button'
import Button from '../widgets/buttons/button'
import './dialog.scss'

View File

@ -9,8 +9,7 @@ import mutator from '../mutator'
import Menu from '../widgets/menu'
import MenuWrapper from '../widgets/menuWrapper'
import Editable from '../widgets/editable'
import Button from './button'
import Button from '../widgets/buttons/button'
import './viewTitle.scss'

View File

@ -1,69 +0,0 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react'
import {Archiver} from '../archiver'
import {MutableBoard} from '../blocks/board'
import Button from '../components/button'
import octoClient from '../octoClient'
import {IBlock} from '../blocks/block'
import {Utils} from '../utils'
type Props = {}
type State = {
boards: IBlock[]
}
export default class HomePage extends React.Component<Props, State> {
constructor(props: Props) {
super(props)
this.state = {
boards: [],
}
}
componentDidMount() {
this.loadBoards()
}
loadBoards = async () => {
const boards = await octoClient.getBlocksWithType('board')
this.setState({boards})
}
importClicked = async () => {
Archiver.importFullArchive(() => {
this.loadBoards()
})
}
exportClicked = async () => {
Archiver.exportFullArchive()
}
addClicked = async () => {
const board = new MutableBoard()
await octoClient.insertBlock(board)
}
render(): React.ReactNode {
return (
<div>
<Button onClick={this.addClicked}>+ Add Board</Button>
<br/>
<Button onClick={this.addClicked}>Import Archive</Button>
<br/>
<Button onClick={this.addClicked}>Export Archive</Button>
{this.state.boards.map((board) => (
<p>
<a href={`/board/${board.id}`}>
<span>{board.title}</span>
<span>{Utils.displayDate(new Date(board.updateAt))}</span>
</a>
</p>
))}
</div>
)
}
}

View File

@ -4,7 +4,7 @@ import React from 'react'
import {Utils} from '../utils'
import Button from '../components/button'
import Button from '../widgets/buttons/button'
import './loginPage.scss'