@stokr/components-library
Version:
STOKR - Components Library
135 lines (133 loc) • 3.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.InvestCalculatorOverview = void 0;
var _react = _interopRequireDefault(require("react"));
var _InvestCalculator = require("./InvestCalculator");
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
var _global = _interopRequireDefault(require("../../styles/global"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
//// U N F I N I S H E D ////
var _default = exports.default = {
title: 'Components Library/InvestCalculator',
component: _InvestCalculator.InvestCalculator,
argTypes: {
minTokensCount: {
type: 'number',
required: true,
defaultValue: 0
},
available: {
type: 'number',
required: true
},
tokenName: {
type: 'string',
required: true
},
id: {
type: 'string',
required: true
},
name: {
type: 'string',
defaultValue: '',
required: true
},
onChange: {
type: 'function',
action: 'onChange',
defaultValue: () => {}
},
onBlur: {
type: 'function',
action: 'onBlur',
defaultValue: () => {}
},
onFocus: {
type: 'function',
action: 'onFocus',
defaultValue: () => {}
},
onErrors: {
type: 'function',
action: 'onErrors',
defaultValue: () => {}
},
exchangeRate: {
type: 'shape',
defaultValue: {},
required: true
},
maxFunds: {
type: 'shape',
defaultValue: {},
required: true
},
//not props
changeCurrencyValue: {
type: 'function',
action: 'changeCurrencyValue',
defaultValue: () => {}
},
changeTokens: {
type: 'function',
action: 'changeTokens',
defaultValue: () => {}
},
tokens: {
type: 'number'
},
tokensInput: {
type: 'number'
},
currencyValueInput: {
type: 'number'
},
currencyValue: {
type: 'number'
},
state: {
type: 'shape',
defaultValue: {
tokens: 0,
currencyValue: 0,
selectedCurrencyValue: 0,
userSelectedCurrency: 'ether'
}
}
}
};
const Template = args => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_InvestCalculator.InvestCalculator, args)));
const InvestCalculatorOverview = exports.InvestCalculatorOverview = Template.bind({});
InvestCalculatorOverview.args = {
minTokensCount: 3,
available: 345,
tokenName: 'STOKR TEST',
id: 'I-D',
name: 'John Doe',
exchangeRate: {
[_InvestCalculator.InvestCalculatorCurrencies.ETH]: 222,
[_InvestCalculator.InvestCalculatorCurrencies.EUR]: 111
},
maxFunds: {
[_InvestCalculator.InvestCalculatorCurrencies.CRYPTO]: 333,
[_InvestCalculator.InvestCalculatorCurrencies.EUR]: 222
},
tokens: 444,
tokensInput: 666,
currencyValueInput: 400
};
//doublecheck:
//UNFINISHED
// square brackets waitng for evaluation (string) - so imported
// [InvestCalculatorCurrencies.CRYPTO]
//
// NOT PROPs propped in..
// state prop made up... not changing anything
//changeTokens
//tokensInput
//tokens
//
// ?(onChange - target - currencyName -)/ state - selectedCurrency