Adding overflow to console

This commit is contained in:
Anthony Laibe 2018-08-31 10:37:30 +01:00 committed by Pascal Precht
parent c453a85dde
commit 2d847b9e7c
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1,4 @@
.console--results {
height: 200px;
overflow-y: scroll;
}

View File

@ -2,6 +2,8 @@ import PropTypes from "prop-types";
import React, {Component} from 'react';
import {Grid, Card, Form} from 'tabler-react';
require('./Console.css');
const CommandResult = ({result}) => (
<p className="text__new-line">{result}</p>
);
@ -28,23 +30,25 @@ class Console extends Component {
render() {
return (
<Grid.Row cards>
<Grid.Row cards className="console">
<Grid.Col>
<Card>
<Card.Header>
<Card.Title>Embark console</Card.Title>
</Card.Header>
<Card.Body>
<Card.Body className="console--results">
<div>
{this.props.commands.map((command, index) => <CommandResult key={index} result={command.result} />)}
</div>
</Card.Body>
<Card.Footer>
<Form onSubmit={(event) => this.handleSubmit(event)}>
<Form.Input value={this.state.value}
onChange={(event) => this.handleChange(event)}
name="command"
placeholder="Type a command (e.g help)" />
</Form>
</Card.Body>
</Card.Footer>
</Card>
</Grid.Col>
</Grid.Row>