joyent-portal/consoles/my-joy-images/src/components/create-image/details.js

72 lines
1.9 KiB
JavaScript
Raw Normal View History

2018-02-13 22:03:57 +02:00
import React from 'react';
import { Field } from 'redux-form';
import { Margin } from 'styled-components-spacing';
import Flex, { FlexItem } from 'styled-flex-component';
import { Row, Col } from 'joyent-react-styled-flexboxgrid';
import {
FormGroup,
FormLabel,
Input,
FormMeta,
Button,
RandomizeIcon,
Textarea
} from 'joyent-ui-toolkit';
export default ({ placeholderName, randomizing, onRandomize }) => (
<form>
<Flex wrap>
<FlexItem flex>
<FormGroup name="name" fluid field={Field}>
<FormLabel>Image name</FormLabel>
2018-04-06 17:53:44 +03:00
<Margin top="0.5">
2018-02-13 22:03:57 +02:00
<Input placeholder={placeholderName} onBlur={null} required />
</Margin>
<FormMeta />
</FormGroup>
</FlexItem>
<FlexItem>
2018-04-06 17:53:44 +03:00
<Margin left="1">
2018-02-13 22:03:57 +02:00
<Button
type="button"
onClick={onRandomize}
loading={randomizing}
marginless
secondary
icon
>
<RandomizeIcon />
<span>Randomize</span>
</Button>
</Margin>
</FlexItem>
</Flex>
2018-04-06 17:53:44 +03:00
<Margin top="3">
2018-02-13 22:03:57 +02:00
<FormGroup name="version" fluid field={Field}>
<FormLabel>Version</FormLabel>
2018-04-06 17:53:44 +03:00
<Margin top="0.5">
2018-02-13 22:03:57 +02:00
<Input placeholder="Example: v1.0" onBlur={null} required />
</Margin>
<FormMeta />
</FormGroup>
</Margin>
<Row>
2018-05-23 19:29:04 +03:00
<Col xs="12" sm="8">
2018-04-06 17:53:44 +03:00
<Margin top="3">
2018-02-13 22:03:57 +02:00
<FormGroup name="description" fluid field={Field}>
<FormLabel>Description</FormLabel>
2018-04-06 17:53:44 +03:00
<Margin top="0.5">
2018-02-13 22:03:57 +02:00
<Textarea
placeholder="Example: JarJarBinks, Anakin Skywalker, Obi Wan Kenobi, Qui-Gon Jinn, Han Solo, Wookies"
fluid
/>
</Margin>
<FormMeta />
</FormGroup>
</Margin>
</Col>
</Row>
</form>
);