1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 23:29:49 +00:00

adjust new dialog style

This commit is contained in:
shanshuirenjia
2018-12-17 11:54:25 +08:00
parent f003f94e48
commit de3a9fe001
2 changed files with 27 additions and 27 deletions

View File

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

View File

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