This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class NumberFieldType extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
numberInput: "" | |
}; | |
} | |
render() { | |
const { numberInput } = this.state; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class UrlFieldType extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
textInput: '' | |
} | |
} | |
render() { | |
const { textInput } = this.state | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class BinaryFieldType extends Component { | |
static defaultProps = { | |
trueValue: 'True', | |
falseValue: 'False' | |
} | |
state = { | |
binaryInput: false, | |
value: this.props.falseValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class DateFieldType extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
date: moment() | |
} | |
} | |
render() { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class DateTimeFieldType extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
date: moment() | |
} | |
} | |
render() { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ColorFieldType extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
colorInput: '#ffffff' | |
} | |
} | |
componentDidMount() { | |
if (this.props.default) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class CurrencyFieldType extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
selectedCurrency: null, | |
amount: '$0.00', | |
inputAmount: '' | |
} | |
} | |
componentDidMount() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class DropDownFieldType extends Component { | |
state = { | |
selectedOption: this.props.options[0], | |
options: this.props.options | |
} | |
render() { | |
const { selectedOption } = this.state | |
return ( | |
<article className={styles.CurrencyFieldType}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CollapsibleCard header="Collapse Me" footer="this is a footer"> | |
<p>This is the body</p> | |
</CollapsibleCard> | |
<CollapsibleCard header="Default Collapsed" collapsed > | |
<h3>A whole component! look at that!</h3> | |
<GithubEmbed /> | |
</CollapsibleCard> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class CollapsibleCard extends Component { | |
static defaultProps = { | |
isCollapsed: false, | |
header: 'Header Required', | |
body: 'body required', | |
footer: '' | |
} | |
state = { | |
isCollapsed: false | |
} |