Properly format the groups and the teams in them
This commit is contained in:
parent
8aad4d614d
commit
89f2fa79c5
|
|
@ -1,12 +1,18 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
Button,
|
Button,
|
||||||
|
Card,
|
||||||
|
CardBody,
|
||||||
|
CardTitle,
|
||||||
|
CardText,
|
||||||
Input,
|
Input,
|
||||||
InputGroup,
|
InputGroup,
|
||||||
InputGroupAddon
|
InputGroupAddon
|
||||||
} from 'reactstrap';
|
} from 'reactstrap';
|
||||||
|
|
||||||
|
import '../../static/css/editablestringlist.css';
|
||||||
|
|
||||||
export default class EditableStringList extends React.Component {
|
export default class EditableStringList extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
@ -54,7 +60,7 @@ export default class EditableStringList extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div className="bg-light p-3 text-secondary font-italic">
|
<div className="bg-light p-3 text-secondary font-italic">
|
||||||
<StringInput submit={this.add} placeholder={this.props.inputPlaceholder} addButtonText={this.props.addButtonText}/>
|
<StringInput submit={this.add} placeholder={this.props.inputPlaceholder} addButtonText={this.props.addButtonText}/>
|
||||||
<GroupView groups={this.state.groups} onGroupSwitched={this.onGroupSwitch}/>
|
<GroupView groups={this.state.groups} removeTeam={this.remove} onGroupSwitched={this.onGroupSwitch}/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -95,12 +101,14 @@ class GroupView extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{this.props.groups.map((group, groupindex) => (
|
{this.props.groups.map((group, groupindex) => (
|
||||||
<div className="group-container" key={groupindex}>
|
<Card className="group-card" key={groupindex}>
|
||||||
Group {groupindex + 1}
|
<CardBody>
|
||||||
{group.map((team, teamindex) => (
|
<CardTitle>Group {groupindex + 1}</CardTitle>
|
||||||
<div className="team" key={teamindex}>{team}</div>
|
{group.map((team, teamindex) => (
|
||||||
))}
|
<Item text={team} key={team} removeItem={this.props.removeTeam}/>
|
||||||
</div>
|
))}
|
||||||
|
</CardBody>
|
||||||
|
</Card>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -159,7 +167,7 @@ class Item extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Alert className="d-inline-block m-2" color="info" isOpen={this.state.visible} toggle={this.onDismiss}>
|
<Alert className="team-item m-2" color="info" isOpen={this.state.visible} toggle={this.onDismiss}>
|
||||||
{this.props.text}
|
{this.props.text}
|
||||||
</Alert>
|
</Alert>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
.group-card {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-right: 15px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-item {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-card .team-item {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue