1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 18:03:48 +00:00

Merge pull request #2650 from haiwen/new-dialog-improve

adjust new dialog style
This commit is contained in:
Daniel Pan
2018-12-17 13:27:29 +08:00
committed by GitHub
2 changed files with 25 additions and 27 deletions

View File

@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label, Col, FormText } from 'reactstrap';
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label } from 'reactstrap';
import { gettext } from '../../utils/constants';
const propTypes = {
@@ -109,28 +109,26 @@ class CreateFile extends React.Component {
<ModalHeader toggle={this.toggle}>{gettext('New File')}</ModalHeader>
<ModalBody>
<Form>
<FormGroup row>
<Label sm={3}>Parent path: </Label>
<Col sm={9} className="parent-path"><FormText>{this.state.parentPath}</FormText></Col>
<FormGroup>
<Label for="fileName">{gettext('Name')}</Label>
<Input
id="fileName"
onKeyPress={this.handleKeyPress}
innerRef={input => {this.newInput = input;}}
value={this.state.childName}
onChange={this.handleChange}
/>
</FormGroup>
<FormGroup row>
<Label for="fileName" sm={3}>{gettext('Name')}: </Label>
<Col sm={9}>
<Input onKeyPress={this.handleKeyPress} innerRef={input => {this.newInput = input;}} id="fileName" placeholder={gettext('newName')} value={this.state.childName} onChange={this.handleChange}/>
</Col>
</FormGroup>
<FormGroup row>
<Label sm={3} check />
<Col sm={9}>
<FormGroup check>
<Label check>
<Input type="checkbox" onChange={this.handleCheck}/>{' '}{gettext('This is a draft.')}
</Col>
</Label>
</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>
<Button color="primary" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
</ModalFooter>
</Modal>
);

View File

@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label, Col, FormText } from 'reactstrap';
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label } from 'reactstrap';
import { gettext } from '../../utils/constants';
const propTypes = {
@@ -58,21 +58,21 @@ class CreateForder extends React.Component {
<ModalHeader toggle={this.toggle}>{gettext('New Folder')}</ModalHeader>
<ModalBody>
<Form>
<FormGroup row>
<Label sm={3}>Parent path: </Label>
<Col sm={9} className="parent-path"><FormText>{this.state.parentPath}</FormText></Col>
</FormGroup>
<FormGroup row>
<Label for="fileName" sm={3}>{gettext('Name')}: </Label>
<Col sm={9}>
<Input onKeyPress={this.handleKeyPress} innerRef={input => {this.newInput = input;}} id="fileName" placeholder={gettext('newName')} value={this.state.childName} onChange={this.handleChange}/>
</Col>
<FormGroup>
<Label for="folderName">{gettext('Name')}</Label>
<Input
id="folderName"
value={this.state.childName}
innerRef={input => {this.newInput = input;}}
onKeyPress={this.handleKeyPress}
onChange={this.handleChange}
/>
</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>
<Button color="primary" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
</ModalFooter>
</Modal>
);