Ajout d'un mode "compact"
Ce mode compact est activé par défaut Voir #24
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { Fragment } from 'react';
|
||||
import { Page } from '../Page';
|
||||
import { connect, DispatchProp } from 'react-redux';
|
||||
import Board from '@lourenci/react-kanban';
|
||||
@ -22,7 +22,8 @@ export class BoardPage extends React.Component<BoardPageProps> {
|
||||
title: "",
|
||||
body: "",
|
||||
project: ""
|
||||
}
|
||||
},
|
||||
compactMode: true,
|
||||
}
|
||||
|
||||
onNewCardTitleChange: (evt: any) => void;
|
||||
@ -59,15 +60,32 @@ export class BoardPage extends React.Component<BoardPageProps> {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="kanboard-container is-fullheight">
|
||||
<Board disableLaneDrag={true}
|
||||
renderCard={this.renderCard}
|
||||
renderLaneHeader={this.renderLaneHeader}
|
||||
onCardDragEnd={this.onCardDragEnd.bind(this)}>
|
||||
{kanboard}
|
||||
</Board>
|
||||
{ this.renderNewCardModal() }
|
||||
</div>
|
||||
<Fragment>
|
||||
<div className="is-clearfix has-margin-top-normal">
|
||||
<div className="is-pulled-right">
|
||||
<div className="field">
|
||||
<input id="compactMode"
|
||||
checked={this.state.compactMode}
|
||||
onChange={this.onCompactModeChange.bind(this)}
|
||||
type="checkbox"
|
||||
className="switch is-rtl"
|
||||
name="compactMode"
|
||||
/>
|
||||
<label htmlFor="compactMode">Mode compact</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="kanboard-container is-fullheight">
|
||||
<Board disableLaneDrag={true}
|
||||
renderCard={this.renderCard.bind(this)}
|
||||
renderLaneHeader={this.renderLaneHeader}
|
||||
onCardDragEnd={this.onCardDragEnd.bind(this)}>
|
||||
{kanboard}
|
||||
</Board>
|
||||
{ this.renderNewCardModal() }
|
||||
</div>
|
||||
</Fragment>
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@ -139,7 +157,7 @@ export class BoardPage extends React.Component<BoardPageProps> {
|
||||
}
|
||||
|
||||
renderCard(card: any) {
|
||||
return <IssueCard card={card} />;
|
||||
return <IssueCard compact={this.state.compactMode} card={card} />;
|
||||
}
|
||||
|
||||
renderLaneHeader(lane: any) {
|
||||
@ -239,6 +257,11 @@ export class BoardPage extends React.Component<BoardPageProps> {
|
||||
this.props.dispatch(buildKanboard(board));
|
||||
}
|
||||
|
||||
onCompactModeChange(evt: React.ChangeEvent) {
|
||||
const checked = (evt.currentTarget as HTMLInputElement).checked;
|
||||
this.setState(state => ({...state, compactMode: checked }));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const ConnectedBoardPage = connect(function(state: any, props: any) {
|
||||
|
Reference in New Issue
Block a user