2 * Copyright 2015-present Greg Hurrell. All rights reserved.
3 * Licensed under the terms of the MIT license.
10 import DynamicField from './DynamicField.react';
11 import React from 'react';
12 import type Value from './Field.react';
13 import Field from './Field.react';
14 import Label from './Label.react';
15 import convert from './convert';
19 export default class App extends React.Component {
27 _onValueChange = (value: Value) => {
28 this.setState({value});
32 const {value} = this.state;
33 const bits = value ? convert(
40 <div className="hextrapolate">
45 {bits / 8 } byte{bits / 8 === 1 ? '' : 's'},
49 <Label text="Hexadecimal">
52 onValueChange={this._onValueChange}
56 <Label text="Decimal">
58 onValueChange={this._onValueChange}
65 onValueChange={this._onValueChange}
72 onValueChange={this._onValueChange}
79 onValueChange={this._onValueChange}
84 onValueChange={this._onValueChange}
86 <footer className="hextrapolate-footer">
87 <a href="mailto:greg@hurrell.net">Contact</a>
89 <a href="https://github.com/wincent/hextrapolate">Source</a>