import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; import * as React from 'react'; import { SelectedERC20AssetAmountInput } from '../containers/selected_erc20_asset_amount_input'; import { ColorOption } from '../style/theme'; import { AsyncProcessState, ERC20Asset, OrderProcessState, OrderState } from '../types'; import { format } from '../util/format'; import { AmountPlaceholder } from './amount_placeholder'; import { Container } from './ui/container'; import { Flex } from './ui/flex'; import { Icon } from './ui/icon'; import { Spinner } from './ui/spinner'; import { Text } from './ui/text'; export interface InstantHeadingProps { selectedAssetUnitAmount?: BigNumber; totalEthBaseUnitAmount?: BigNumber; ethUsdPrice?: BigNumber; quoteRequestState: AsyncProcessState; buyOrderState: OrderState; onSelectAssetClick?: (asset?: ERC20Asset) => void; } const PLACEHOLDER_COLOR = ColorOption.white; const ICON_WIDTH = 34; const ICON_HEIGHT = 34; const ICON_COLOR = ColorOption.white; export class InstantHeading extends React.Component { public render(): React.ReactNode { const iconOrAmounts = this._renderIcon() || this._renderAmountsSection(); return ( {this._renderTopText()} {iconOrAmounts} ); } private _renderAmountsSection(): React.ReactNode { return ( {this._renderPlaceholderOrAmount(this._renderEthAmount)} {this._renderPlaceholderOrAmount(this._renderDollarAmount)} ); } private _renderIcon(): React.ReactNode { const processState = this.props.buyOrderState.processState; if (processState === OrderProcessState.Failure) { return ; } else if (processState === OrderProcessState.Processing) { return ; } else if (processState === OrderProcessState.Success) { return ; } return undefined; } private _renderTopText(): React.ReactNode { const processState = this.props.buyOrderState.processState; if (processState === OrderProcessState.Failure) { return 'Order failed'; } else if (processState === OrderProcessState.Processing) { return 'Processing Order...'; } else if (processState === OrderProcessState.Success) { return 'Tokens received!'; } return 'I want to buy'; } private _renderPlaceholderOrAmount(amountFunction: () => React.ReactNode): React.ReactNode { if (this.props.quoteRequestState === AsyncProcessState.Pending) { return ; } if (_.isUndefined(this.props.selectedAssetUnitAmount)) { return ; } return amountFunction(); } private readonly _renderEthAmount = (): React.ReactNode => { return ( {format.ethBaseUnitAmount( this.props.totalEthBaseUnitAmount, 4, , )} ); }; private readonly _renderDollarAmount = (): React.ReactNode => { return ( {format.ethBaseUnitAmountInUsd( this.props.totalEthBaseUnitAmount, this.props.ethUsdPrice, 2, , )} ); }; } /span>1-1000/+913 * Fix wrong button name in Restore instructionsAndre Klapper2011-06-301-1/+1 * Updated Spanish translationJorge González2011-06-301-36/+20 * Remove an impressively vague and useless section of the manual with two unhel...Andre Klapper2011-06-303-24/+0 * Updated Spanish translationJorge González2011-06-301-3100/+3050 * Remove duplicated info listed already in Quick Reference PDF anyway.Andre Klapper2011-06-301-109/+1 * Remove useless listing of all categories available.Andre Klapper2011-06-301-327/+4 * Help images removed; remove them from Makefile.am tooMilan Crha2011-06-301-2/+0 * Fix backup section a bitAndre Klapper2011-06-301-8/+4 * Fix backup section a bit; remove useless non-explaining backup screenshots.Andre Klapper2011-06-302-0/+0 * Remove confusing and isolated "Contact list" line.Andre Klapper2011-06-301-1/+0 * Change two sentences with the same meaning to use same wording.Andre Klapper2011-06-301-3/+3 * Remove "most important command line options": Nothing for a "Getting Started"...Andre Klapper2011-06-301-96/+0 * POP3 extensions, whatever that is. I link to the RFC now.Andre Klapper2011-06-301-1/+1 * Remove "Nettiquette" section. Fixes bug 567415.Andre Klapper2011-06-301-30/+0 * Fix right-click, right click, double-click, double click spellings. Fixes bug...Andre Klapper2011-06-301-8/+8 * Remove non-existing images/figures linked from User Guide. Fixes bug 608527.Andre Klapper2011-06-301-7/+0 * Remove useless part of sentence. Fixes bug 566240.Andre Klapper2011-06-301-1/+1 * Fix invalid sentence. Fixes bug 588572.Andre Klapper2011-06-301-1/+1 * Fix broken sentence. Fixes bug 587153.Andre Klapper2011-06-301-1/+1 * Fix broken sentence. Fixes bug 587152.Andre Klapper2011-06-301-1/+1 * Fix weird sentence. Fixes bug 588570.Andre Klapper2011-06-301-1/+1 * Fix steps for contact list creation. Fixes bug 634734.Andre Klapper2011-06-301-3/+3 * Update Spellcheck instructions according to bug 522153. Fixes bug 609820.Andre Klapper2011-06-301-2/+2 * [l10n] Updated German doc translation, fixed some XML errorsMario Blättermann2010-11-101-1724/+1608 * Updated Slovenian translationMatej Urbančič2010-11-101-333/+133 * Updated Slovenian translationMatej Urbančič2010-11-101-880/+1724 * [help] Fix XML validity of French translationClaude Paroz2010-10-201-4/+5 * Added sl for Slovenian translationMatej Urbančič2010-10-151-1/+1 * Added Slovenian translationMatej Urbančič2010-10-151-0/+10246 * [l10n] Updated German help translationChristian.Kirbach2010-09-141-23/+23 * Updated French doc translationBruno Brouard2010-08-251-181/+21 * Update Simplified Chinese help translation.朱涛2010-08-212-1/+14361 * Updated Galician translations and added galician docs filesFran Diéguez2010-08-032-1/+12713 * Bug 598833 - Do not ship dropped evo_mail_notifier.pngMatthew Barnes2010-07-252-0/+0 * Updated Spanish translationJorge González2010-05-291-18/+26 * Merge branch 'express2'Matthew Barnes2010-05-271-2/+2 |\ | * Merge branch 'gnome-2-30' into express2Matthew Barnes2010-05-1719-36/+34 | |\ | | * Updated German help translationChristian Kirbach2010-05-111-2/+1 | | * [help] Updated German help translation screenshotsChristian Kirbach2010-05-1119-14/+4 | | * Updated German help translationChristian Kirbach2010-05-031-24/+33 | * | Merge commit 'origin/gnome-2-30' into express2Michael Meeks2010-04-221-64/+334 | |\| | | * Updated German help translationChristian Kirbach2010-04-211-64/+334 | * | Update the help file with the 'Show week numbers' optionFederico Mena Quintero2010-04-181-1/+1 | |/ | * Updated Spanish translationJorge González2010-03-301-26/+23 | * Updated Greek translation for evolution documentationNikos Bakaoukas2010-03-301-131/+23 | * update doc versionChenthill Palanisamy2010-03-301-1/+1 | * Updated Greek translation for evolution documentationNikos Bakaoukas2010-03-291-9422/+3157 | * Updated Greek translationΜάριος Ζηντίλης2010-03-251-2704/+3111 | * Updated French doc translationBruno Brouard2010-03-241-2980/+2846 * | Bug #598833 - Do not ship dropped evo_mail_notifier.pngYves-Alexis Perez2010-05-191-1/+0 * | Updated Spanish translationJorge González2010-05-161-4/+4 * | [help] Updated German help translation screenshotsChristian Kirbach2010-05-1119-15/+4 * | Updated German help translationChristian Kirbach2010-05-031-24/+33 * | Updated German help translationChristian Kirbach2010-04-211-64/+334 * | Added Spanish translationJorge González2010-04-181-16/+7 * | Bug 613867 - Minor typo in Evolution documentationMarios Zindilis2010-04-181-1/+1 * | Generate ChangeLog files for tarball releases.Matthew Barnes2010-04-032-3522/+0 * | Updated Greek translation for evolution documentationNikos Bakaoukas2010-03-301-131/+23 * | Updated Greek translation for evolution documentationNikos Bakaoukas2010-03-291-9422/+3157 * | Updated Greek translationΜάριος Ζηντίλης2010-03-251-2704/+3111 * | Updated French doc translationBruno Brouard2010-03-241-2980/+2846 |/ * Update Czech help translation by Jiri EischmannPetr Kovar2010-02-191-184/+69 * Updated German doc translationMario Blättermann2010-02-141-3/+3 * Updated German doc translationMario Blättermann2010-02-141-4839/+4939 * Updated Czech help translation by Jiri EischmannPetr Kovar2010-02-051-10283/+5608 * Updated Spanish translationJorge González2010-02-011-23694/+13483 * Updated Spanish translationJorge González2010-02-011-13482/+23694 * Fix some misspellings of "calendar".Matthew Barnes2010-01-311-4/+4 * Add ScreenshotAndre Klapper2010-01-301-0/+0 * Add ScreenshotAndre Klapper2010-01-301-0/+0 * Add ScreenshotAndre Klapper2010-01-301-0/+0 * Update ScreenshotAndre Klapper2010-01-301-0/+0 * Add translated screenshotAndre Klapper2010-01-301-0/+0 * Add/Update screenshotsJiri Eischmann2010-01-3020-0/+0 * Updated Spanish translationJorge González2009-12-291-226/+409 * Synchronize help files with gnome-2-28 branch.Matthew Barnes2009-12-04329-48849/+6604 * Add Simplified Chinese translation.Zhang Miao2009-11-172-1/+13084 * Updated Spanish translationJorge González2009-10-171-10/+14 * Bug 598027 - Use vCard instead of VCardMatthew Barnes2009-10-113-4/+4 * Updated Greek translation.Kostas Papadimas2009-09-191-10/+10 * Updated German doc translationMario Blättermann2009-09-191-2619/+3012 * Updated Spanish translationJorge González2009-08-291-797/+227 * Fix discrepancy wrt what's actually in the UIKjartan Maraas2009-08-271-1/+1 * Fixed bug #591916Mario Blättermann2009-08-231-1/+1 * Update czech screenshots.Andre Klapper2009-08-112-0/+0 * Updated German translationMario Blättermann2009-07-271-1714/+1699 * Update German translation of Evolution User manual.Andre Klapper2009-07-151-49/+69 * Fixes bug #587420, replaces mdash by a long dash symbol.Nickolay V. Shmyrev2009-07-121-9/+9 * Add localized screenshotsAndre Klapper2009-06-2816-0/+0 * Add localized screenshotsAndre Klapper2009-06-2815-0/+0 * Add localized screenshotsAndre Klapper2009-06-284-0/+0 * Updated German user manual translation.Andre Klapper2009-06-281-189/+161 * Bug 586378 - Various build cleanupsH.Habighorst2009-06-191-0/+3 * Update the address of the FSFTobias Mueller2009-05-311-2/+2 * Added figures for Greek documentationMarios Zindilis2009-05-2356-0/+0 * Updated Greek translation for documentationMarios Zindilis2009-05-221-1440/+4039 * Use Behdad's brilliant git.mk to generate .gitignore files.Matthew Barnes2009-05-0216-0/+32 * Updated Greek translation by Fotis TsamisSimos Xenitellis2009-04-042-5725/+6027 * Updated British English translation by Jen OckwellPhilip Withnall2009-03-262-15/+22 * Added two screnshots for SpanishJorge Gonzalez Gonzalez2009-03-253-0/+4 * Updated Spanish translationJorge Gonzalez Gonzalez2009-03-192-13/+21 * Bump the version number.Matthew Barnes2009-03-182-2/+6 * Updated British English translation.Philip Withnall2009-03-172-2533/+2543 * sv.po: Updated Swedish translationDaniel Nylander2009-03-172-4030/+5318 * Updated Czech translation by Jiri Eischmann.Andre Klapper2009-03-152-1029/+330 * Updated German translation.Andre Klapper2009-03-122-244/+19 * Updated German translation.Andre Klapper2009-03-122-2849/+3168 * Updated Czech translation by Jiri Eischmann.Andre Klapper2009-03-122-2987/+3856 * Updated Spanish translationJorge Gonzalez Gonzalez2009-03-113-44/+17 * Fixed the warning. Maybe we'll never miss anything once we have the checkBharath Acharya2009-03-112-1/+6 * Updated British English translation.Philip Withnall2009-03-102-2593/+2787 * Updated Spanish translationJorge Gonzalez Gonzalez2009-03-105-2672/+2837 * ** Committed on behalf of PC Radhika <pradhika@novell.com>Bharath Acharya2009-03-096-0/+10 * ** Committed on behalf of PC Radhika <pradhika@novell.com>Andre Klapper2009-03-092-58/+166 * Added Catalan translation of the Evolution welcome e-mail and quickDavid Planella2009-03-085-1/+136 * Updated British English translation.Philip Withnall2009-03-032-5128/+12616 * Added image in Basque language. Images are: account_editor_a.pngInaki Larranaga Murgoitio2009-02-18120-0/+64 * Added Basque translation. Added 'eu' to DOC_LINGUAS.Inaki Larranaga Murgoitio2009-02-162-1/+6 * svn path=/trunk/; revision=37277Iñaki Larrañaga Murgoitio2009-02-161-0/+9303 * ** Removed unused figures (bug #552695)Matthew Barnes2009-02-1148-47/+7 * Updated Czech translation by Jiri Eischmann.Petr Kovar2009-02-022-4807/+9889 * Updated German translation.Andre Klapper2009-01-252-23/+27 * Updated Spanish translationJorge Gonzalez Gonzalez2009-01-202-2697/+2871 * Doc : Updated screenshots. Committing on behalf of PC Radhika <pradhika@novel...Johnny Jacob2009-01-165-0/+10 * Sync two strings. Remove explicit mentioning of some translators.Andre Klapper2009-01-122-16/+6 * Remove more redundancy; split up more strings.Andre Klapper2009-01-122-11/+16 * Remove redundancy; split up strings. Fixes bug #567409.Andre Klapper2009-01-122-33/+51 * Fix typos. Fixes bug #566572.Andre Klapper2009-01-122-6/+10 * Updated German translation.Andre Klapper2009-01-122-159/+106 * B & W version of our new logo to replace the old Ximian logo.Matthew Barnes2009-01-0918-18471/+307 * Updated Spanish translationJorge Gonzalez Gonzalez2009-01-071-85/+44 * Updated Spanish translationJorge Gonzalez Gonzalez2009-01-061-38/+15 * Updated Spanish translationJorge Gonzalez Gonzalez2009-01-061-36/+17 * Updated Spanish translationJorge Gonzalez Gonzalez2009-01-062-39/+31 * Updated Spanish screenshotJorge Gonzalez Gonzalez2009-01-061-0/+0 * Added Spanish screenshotsJorge Gonzalez Gonzalez2009-01-063-0/+0 * Updated Spanish translation and added three screenshotsJorge Gonzalez Gonzalez2009-01-055-35/+16 * Updated Spanish translationJorge Gonzalez Gonzalez2009-01-052-32/+17 * Updated German translation.Andre Klapper2009-01-052-2662/+1964 * Updated Spanish translationJorge Gonzalez Gonzalez2009-01-052-2997/+3403 * Link sentence "You can also enable Magic spacebar" against theAndre Klapper2009-01-042-1/+6 * s/and/or. Fixes bug #566233.Andre Klapper2009-01-042-1/+5 * Fix wrong sentence. Fixes bug #566228.Andre Klapper2009-01-042-1/+5 * Add missing whitespace.Andre Klapper2009-01-042-1/+5 * Add warning that PGP Encrypt will not encrypt subject lines. Fixes bugAndre Klapper2009-01-042-0/+8 * Sync strings. Fixes bug #566236, bug #566238.Andre Klapper2009-01-042-5/+10 * Sync strings. Fixes bug #566234.Andre Klapper2009-01-042-1/+6 * Fix grammatical errors. Fixes bug #558492. Patch by Nanley Chery.Andre Klapper2009-01-042-1/+6 * Fix non-sense split sentences. Fixes bug #544340, bug #544339.Andre Klapper2009-01-042-2/+7 * Fix typos. Bug #544335. Patch by Philip Withnall.Andre Klapper2009-01-042-14/+19 * Added a few translated screenshots.Andre Klapper2009-01-0318-0/+4 * Update German translation.Andre Klapper2009-01-032-2781/+2843 * ** Fixes part of bug #546437Matthew Barnes2009-01-022-172/+140 * Update German translation.Andre Klapper2009-01-022-2290/+2778 * Added Czech translation of quickref.Andre Klapper2009-01-021-8/+8 * Remove Makefile and Makefile.in. Sorry.Andre Klapper2009-01-022-1118/+0 * svn path=/trunk/; revision=36952Andre Klapper2009-01-02106-1/+1347 * Updated Czech translation of manual by Jiri Eischmann.Andre Klapper2009-01-022-297/+309 * Updated Czech translation of manual by Jiri Eischmann.Petr Kovar2008-11-152-93/+97 * Fixed Czech translation by Jiri Eischmann, thanks to Kamil Paral. Updated Cze...Petr Kovář2008-11-102-6744/+2614 * Updated Spanish translationJorge Gonzalez Gonzalez2008-10-272-480/+248 * Updated Czech translation of manual by Jiri Eischmann.Petr Kovar2008-09-292-4879/+9459 * Updated French translation.Claude Paroz2008-09-242-2567/+3121 * One new figure added and one obsolete removed.Claude Paroz2008-09-213-0/+4 * ** Fix for bug #552911Milan Crha2008-09-204-1/+10 * Updated Spanish screenshotsJorge Gonzalez Gonzalez2008-09-195-0/+0 * Updated Spanish screenshotJorge Gonzalez Gonzalez2008-09-191-0/+0 * Updated ScreenshotJorge Gonzalez Gonzalez2008-09-181-0/+0 * Updated Spanish translationJorge Gonzalez Gonzalez2008-09-185-0/+4 * Added new ScreenshotsJorge Gonzalez Gonzalez2008-09-188-0/+1 * Updated Spanish translationJorge Gonzalez Gonzalez2008-09-182-62/+101 * Updated Spanish translationJorge Gonzalez Gonzalez2008-09-172-47/+81 * Updated Spanish translationJorge Gonzalez Gonzalez2008-09-172-2362/+3181 * Patch from PC Radhika <pradhika@novell.com>Bharath Acharya2008-09-167-18/+387 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-222-513/+274 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-222-249/+437 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-212-464/+222 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-192-2148/+2115 * ** Fixes bug #508732Matthew Barnes2008-08-182-6/+5 * Updated Spansih translationJorge Gonzalez Gonzalez2008-08-142-62/+35 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-142-49/+30 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-132-255/+434 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-092-54/+28 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-072-81/+37 * Updated Spanish translationJorge Gonzalez Gonzalez2008-08-062-2732/+2821 * Patch from Paul Bolle <pebolle@tiscali.nl>: Fix for bug #544252 (Use names c...Suman Manjunath2008-08-042-3/+10 * Make Claude happy (bug #544886 comment 4).Andre Klapper2008-08-042-1/+5 * Typo fixes and fix for bug #544886 on behalf of Allan Day.Andre Klapper2008-08-042-6/+11 * Update German translation.Andre Klapper2008-08-042-2751/+2754 * ** Fixes part of bug #545558Matthew Barnes2008-08-012-26/+10 * ** This was preventing dblatex from working correctly. I use dblatex toMatthew Barnes2008-07-307-2/+14 * Updated French translation.Claude Paroz2008-07-292-625/+640 * ** Fixes bug #544958Matthew Barnes2008-07-282-181/+188 * Typos/Syntax improvements. Fixes #544994.Claude Paroz2008-07-282-9/+14 * Updated French translation. New screenshot.Claude Paroz2008-07-273-4395/+4134 * Updated Spanish translationJorge Gonzalez Gonzalez2008-07-252-134/+104 * Updated Spanish translationJorge Gonzalez Gonzalez2008-07-252-375/+336 * Update German translation.Andre Klapper2008-07-232-202/+202 * Update German translation.Andre Klapper2008-07-232-4042/+4604 * Updated Spanish translationJorge Gonzalez Gonzalez2008-07-222-21461/+13330 * s/a company environment/an organizational environmentAndre Klapper2008-07-222-2/+6 * Fix most of bug 543883. Patch by Allan Day.Andre Klapper2008-07-222-8/+13 * Updated Spanish translationJorge Gonzalez Gonzalez2008-07-222-13341/+21469 * Fix build break.Andre Klapper2008-07-222-2/+5 * Updated Spanish translationJorge Gonzalez Gonzalez2008-07-212-3131/+2972 * Synchronized more strings, changed "mails" to "mail".Andre Klapper2008-07-212-10/+14 * Synchronized more strings.Andre Klapper2008-07-212-1/+5 * Synchronized more strings.Andre Klapper2008-07-212-10/+15 * Synchronized more strings, fixed some typos.Andre Klapper2008-07-212-7/+11 * Synchronized more strings.Andre Klapper2008-07-212-12/+15 * Synchronized more strings.Andre Klapper2008-07-212-14/+20 * Synchronized more strings, fixed a typo.Andre Klapper2008-07-212-14/+20 * Synchronized more strings, fixed a typo.Andre Klapper2008-07-212-19/+37 * Updated Spanish translationJorge Gonzalez Gonzalez2008-07-212-120/+67 * Fixed bug #477082.Andre Klapper2008-07-212-10/+11 * Fixed comments 201 to 317 of bug #438479.Andre Klapper2008-07-212-56/+61 * Fixed comments 181 to 200 of bug #438479.Andre Klapper2008-07-202-21/+28 * Updated Spanish translationJorge Gonzalez Gonzalez2008-07-202-2463/+2476 * Fixed comments 161 to 180 of bug #438479.Andre Klapper2008-07-202-22/+28 * Fixed comments 141 to 160 of bug #438479.Andre Klapper2008-07-202-11/+15 * Fixed comments 121 to 140 of bug #438479. Use &z-3rdParty; instead of *.Andre Klapper2008-07-202-22/+29 * Fixed comments 81 to 120 of bug #438479. Synced dialogue vs dialog. FixedAndre Klapper2008-07-202-44/+48 * Fixed comments 61 to 80 of bug #438479.Andre Klapper2008-07-202-62/+51 * Fixed comments 41 to 60 of bug #438479.Andre Klapper2008-07-202-25/+31 * Fixed comments 21 to 40 of bug #438479.Andre Klapper2008-07-20