Permalink
Browse files

Add color field to unit info sample data and reducer

  • Loading branch information...
markerikson committed Jul 19, 2017
1 parent ee3c027 commit 07ead5b417149a397f9d04bf4a46c163b7f010da
View
@@ -2,6 +2,7 @@ const sampleData = {
unit : {
name : "Black Widow Company",
affiliation : "wd",
color : "black"
},
pilots : [
{
@@ -11,6 +11,7 @@ import {updateUnitInfo} from "../unitInfoActions";
import {getValueFromEvent} from "common/utils/clientUtils";
import FormEditWrapper from "common/components/FormEditWrapper";
import ColorPickerButton from "common/components/ColorPickerButton";
const FACTIONS = [
{value : "cc", text : "Capellan Confederation"},
@@ -48,7 +49,7 @@ class UnitInfo extends Component {
render() {
const {unitInfo, updateUnitInfo} = this.props;
const {name, affiliation} = unitInfo;
const {name, affiliation, color} = unitInfo;
return (
<Segment attached="bottom">
@@ -77,6 +78,10 @@ class UnitInfo extends Component {
onChange={this.onAffiliationChanged}
/>
</Form.Field>
<Form.Field name="color">
<label>Color</label>
<ColorPickerButton value={color} />
</Form.Field>
</Form>
</Segment>
);
@@ -6,6 +6,7 @@ import {UNIT_INFO_UPDATE} from "./unitInfoConstants";
const initialState = {
name : "N/A",
affiliation : "",
color : "blue"
};
function dataLoaded(state, payload) {

0 comments on commit 07ead5b

Please sign in to comment.