2018-01-08 21:08:01 +02:00
|
|
|
import React, { Fragment } from 'react';
|
|
|
|
import { Field } from 'redux-form';
|
|
|
|
import { Margin } from 'styled-components-spacing';
|
2018-01-15 19:23:32 +02:00
|
|
|
import Description from '@components/create-instance/description';
|
2018-01-08 21:08:01 +02:00
|
|
|
|
|
|
|
import {
|
|
|
|
H3,
|
|
|
|
FormGroup,
|
|
|
|
FormLabel,
|
|
|
|
Input,
|
|
|
|
FormMeta,
|
|
|
|
Button
|
|
|
|
} from 'joyent-ui-toolkit';
|
|
|
|
|
|
|
|
export default ({ handleSubmit, pristine, expanded, name, onCancel }) => (
|
|
|
|
<form onSubmit={handleSubmit}>
|
|
|
|
{expanded ? (
|
|
|
|
<Fragment>
|
2018-01-15 19:23:32 +02:00
|
|
|
<Description>
|
|
|
|
Your instance name will be used to identify this specific instance.
|
|
|
|
</Description>
|
2018-01-08 21:08:01 +02:00
|
|
|
<FormGroup name="name" fluid field={Field}>
|
2018-01-15 19:34:15 +02:00
|
|
|
<FormLabel>Instance Name</FormLabel>
|
2018-01-18 13:16:56 +02:00
|
|
|
<Input onBlur={null} />
|
2018-01-08 21:08:01 +02:00
|
|
|
<FormMeta />
|
|
|
|
</FormGroup>
|
2018-01-15 19:34:15 +02:00
|
|
|
<Margin top={2} bottom={4}>
|
|
|
|
<Button type="submit" disabled={pristine}>
|
|
|
|
Next
|
|
|
|
</Button>
|
|
|
|
</Margin>
|
2018-01-08 21:08:01 +02:00
|
|
|
</Fragment>
|
|
|
|
) : (
|
|
|
|
<Fragment>
|
2018-01-11 22:26:42 +02:00
|
|
|
{name ? (
|
|
|
|
<Fragment>
|
|
|
|
<Margin bottom={2} top={3}>
|
2018-01-16 13:54:22 +02:00
|
|
|
<H3 bold>{name}</H3>
|
2018-01-11 22:26:42 +02:00
|
|
|
</Margin>
|
|
|
|
<Button type="button" secondary onClick={onCancel}>
|
|
|
|
Edit
|
|
|
|
</Button>
|
|
|
|
</Fragment>
|
|
|
|
) : null}
|
2018-01-08 21:08:01 +02:00
|
|
|
</Fragment>
|
|
|
|
)}
|
|
|
|
</form>
|
|
|
|
);
|