mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
fix(feature): Create feature form inside a Card to align UI
This commit is contained in:
parent
a1092d9474
commit
ca9ca32e4d
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,10 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Textfield, Switch } from 'react-mdl';
|
||||
import { Textfield, Switch, Card, CardTitle, CardActions } from 'react-mdl';
|
||||
import StrategiesSection from './strategies-section-container';
|
||||
|
||||
import { FormButtons } from './../../common';
|
||||
import { styles as commonStyles } from '../../common';
|
||||
|
||||
const trim = value => {
|
||||
if (value && value.trim) {
|
||||
@ -44,52 +45,57 @@ class AddFeatureComponent extends Component {
|
||||
const configuredStrategies = input.strategies || [];
|
||||
|
||||
return (
|
||||
<form onSubmit={onSubmit(input)}>
|
||||
<section style={{ padding: '16px' }}>
|
||||
<Textfield
|
||||
floatingLabel
|
||||
label="Name"
|
||||
name="name"
|
||||
required
|
||||
value={name}
|
||||
error={nameError}
|
||||
onBlur={v => validateName(v.target.value)}
|
||||
onChange={v => setValue('name', trim(v.target.value))}
|
||||
/>
|
||||
<Textfield
|
||||
floatingLabel
|
||||
style={{ width: '100%' }}
|
||||
rows={1}
|
||||
label="Description"
|
||||
required
|
||||
value={description}
|
||||
onChange={v => setValue('description', v.target.value)}
|
||||
/>
|
||||
<div>
|
||||
<Card shadow={0} className={commonStyles.fullwidth} style={{ overflow: 'visible' }}>
|
||||
<CardTitle style={{ paddingTop: '24px', wordBreak: 'break-all' }}>Create feature toggle</CardTitle>
|
||||
<form onSubmit={onSubmit(input)}>
|
||||
<section style={{ padding: '16px' }}>
|
||||
<Textfield
|
||||
floatingLabel
|
||||
label="Name"
|
||||
name="name"
|
||||
required
|
||||
value={name}
|
||||
error={nameError}
|
||||
onBlur={v => validateName(v.target.value)}
|
||||
onChange={v => setValue('name', trim(v.target.value))}
|
||||
/>
|
||||
<Textfield
|
||||
floatingLabel
|
||||
style={{ width: '100%' }}
|
||||
rows={1}
|
||||
label="Description"
|
||||
required
|
||||
value={description}
|
||||
onChange={v => setValue('description', v.target.value)}
|
||||
/>
|
||||
<div>
|
||||
<br />
|
||||
<Switch
|
||||
checked={enabled}
|
||||
onChange={() => {
|
||||
setValue('enabled', !enabled);
|
||||
}}
|
||||
>
|
||||
Enabled
|
||||
</Switch>
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<StrategiesSection
|
||||
configuredStrategies={configuredStrategies}
|
||||
addStrategy={addStrategy}
|
||||
updateStrategy={updateStrategy}
|
||||
moveStrategy={moveStrategy}
|
||||
removeStrategy={removeStrategy}
|
||||
/>
|
||||
|
||||
<br />
|
||||
<Switch
|
||||
checked={enabled}
|
||||
onChange={() => {
|
||||
setValue('enabled', !enabled);
|
||||
}}
|
||||
>
|
||||
Enabled
|
||||
</Switch>
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<StrategiesSection
|
||||
configuredStrategies={configuredStrategies}
|
||||
addStrategy={addStrategy}
|
||||
updateStrategy={updateStrategy}
|
||||
moveStrategy={moveStrategy}
|
||||
removeStrategy={removeStrategy}
|
||||
/>
|
||||
|
||||
<br />
|
||||
<FormButtons submitText={'Create'} onCancel={onCancel} />
|
||||
</section>
|
||||
</form>
|
||||
</section>
|
||||
<CardActions>
|
||||
<FormButtons submitText={'Create'} onCancel={onCancel} />
|
||||
</CardActions>
|
||||
</form>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user