Reusable UI Components for Agoric Dapps, built with React and MaterialUI.
A React MaterialUI TextField
Input which allows the user
to enter a Nat
. Handles decimalPlaces
appropriately. This is a
controlled component.
Example:
import { NatAmountInput } from '@agoric/ui-components';
<NatAmountInput
label={label} // the label
value={amount && amount.value} // The value to display. Must be a Nat
decimalPlaces={purse.displayInfo && purse.displayInfo.decimalPlaces}
placesToShow={2}
disabled={disabled} // disable the input
error={amountError} // any error to display
onChange={onAmountChange} // a callback called on user input changing the value
onError={() => {}} // a callback called on errors
/>
yarn build
yarn test