Skip to content

Commit 17de120

Browse files
authored
Merge pull request #32 from ModusCreateOrg/binding-with-react-3
Binding - updated label capitalization per feedback
2 parents 68c1ad7 + d18af4c commit 17de120

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

22-react-binding/a-simple-binding/src/Form.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import React, { Component } from 'react';
22

3-
function capitalize(str) {
4-
return str.substr(0, 1).toUpperCase() + str.substr(1);
5-
}
6-
73
class Form extends Component {
84
state = {
95
user: Object.assign({}, this.props.user)
@@ -32,10 +28,10 @@ class Form extends Component {
3228
);
3329
}
3430

35-
renderField = (state, name, label = capitalize(name)) => {
31+
renderField = (state, name, label = name) => {
3632
return (
3733
<div style={{ marginBottom: '12px' }}>
38-
<label>
34+
<label style={{textTransform: 'capitalize'}}>
3935
{label}
4036
<input
4137
type="text"

22-react-binding/b-tell-parent/src/Form.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import React, { Component } from 'react';
22

3-
function capitalize(str) {
4-
return str.substr(0, 1).toUpperCase() + str.substr(1);
5-
}
6-
73
class Form extends Component {
84
state = {
95
user: Object.assign({}, this.props.user)
@@ -32,10 +28,10 @@ class Form extends Component {
3228
);
3329
}
3430

35-
renderField = (state, name, label = capitalize(name)) => {
31+
renderField = (state, name, label = name) => {
3632
return (
3733
<div style={{ marginBottom: '12px' }}>
38-
<label>
34+
<label style={{textTransform: 'capitalize'}}>
3935
{label}
4036
<input
4137
type="text"

0 commit comments

Comments
 (0)