How to use the @ledgerhq/live-common/lib/react.getCryptoCurrencyIcon function in @ledgerhq/live-common

To help you get started, weā€™ve selected a few @ledgerhq/live-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LedgerHQ / ledger-live-desktop / src / components / EnsureDeviceApp.js View on Github external
render() {
    const { account, currency, device, ...props } = this.props
    const cur = account ? account.currency : currency
    const Icon = cur ? getCryptoCurrencyIcon(cur) : null
    return (
      
                {'Connect your'}
                {'Ledger device'}
                {'to your computer and enter your'}
                {'PIN code'}
                {'  on your device'}
              
            ),
github LedgerHQ / ledger-live-desktop / src / components / EnsureDeviceAppInteraction.js View on Github external
render() {
    const { account, currency, ...props } = this.props
    const cur = account ? account.currency : currency
    const Icon = cur ? getCryptoCurrencyIcon(cur) : null
    return (
      
                {'Connect and unlock your '}
                {'Ledger device'}
              
            ),
            icon: usbIcon,
            run: this.connectInteractionHandler,
          },
          {
            id: 'address',
github LedgerHQ / ledger-live-desktop / src / components / CryptoCurrencyIcon.js View on Github external
render() {
    const { currency, size, inactive, theme } = this.props
    const color = inactive ? theme.colors.palette.text.shade60 : getCurrencyColor(currency)
    if (currency.type === 'FiatCurrency') {
      return null
    }
    if (currency.type === 'TokenCurrency') {
      return (
        
          
            {currency.ticker[0]}
          
        
      )
    }
    const IconCurrency = getCryptoCurrencyIcon(currency)
    return IconCurrency ?  : null
  }
}
github LedgerHQ / ledger-live-common / tools / src / demos / countervalues / components / CurrencySelect.js View on Github external
{currencies.map((c, i) => {
          const maybeCrypto = inferCrypto(c);
          if (maybeCrypto) {
            const Icon = getCryptoCurrencyIcon(maybeCrypto);
            return (
              <menuitem value="{i}">
                {Icon ? (
                  <span style="{{">
                    
                  </span>
                ) : null}
                {c.name} ({c.ticker})
              </menuitem>
            );
          } else {
            return (
              <menuitem value="{i}">
                {c.name} ({c.ticker})
              </menuitem>
            );
github LedgerHQ / ledger-live-common / tools / src / demos / Currencies / index.js View on Github external
render() {
    const { crypto } = this.props;
    const Icon = getCryptoCurrencyIcon(crypto);
    const validationErrors = [
      Icon ? null : "icon is missing",
      crypto.family === "bitcoin" &amp;&amp; !crypto.bitcoinLikeInfo
        ? "bitcoin family coins must provide bitcoinLikeInfo"
        : null,
      crypto.family === "ethereum" &amp;&amp; !crypto.ethereumLikeInfo
        ? "ethereum family coins must provide ethereumLikeInfo"
        : null,
      crypto.units.length === 0
        ? "at least one unit must be provided in units"
        : null
    ].filter(o =&gt; o);
    return (
      
        {validationErrors.length ? (
          KO
github LedgerHQ / ledger-live-desktop / src / stories / currencies.stories.js View on Github external
{currencies.map(cur =&gt; {
          const Icon = getCryptoCurrencyIcon(cur)
          return (
            
              {cur.id}
              {cur.name}
              
                {cur.color ? (
                  
                    <div style="{{">
                    <div>{cur.color}</div>
                  </div>
github LedgerHQ / ledger-live-common / tools / src / demos / apps / index.js View on Github external
const CoinPreview = ({ coin }: { coin: CryptoCurrency }) =&gt; {
  const text = coin.managerAppName;
  const Icon = getCryptoCurrencyIcon(coin);
  return (
    
      
        {Icon ?  : {coin.ticker}}
      
      {text}
    
  );
};
github LedgerHQ / ledger-live-desktop / src / components / MainSideBar / AccountListItem.js View on Github external
render() {
    const { account, push, isActive } = this.props
    const accountURL = `/account/${account.id}`
    const item = {
      label: account.name,
      desc: () =&gt; (
        
      ),
      iconActiveColor: account.currency.color,
      icon: getCryptoCurrencyIcon(account.currency),
      onClick: () =&gt; push(accountURL),
      isActive,
    }
    return 
  }
}
github LedgerHQ / ledger-live-desktop / src / components / base / CurrencyBadge.js View on Github external
export function CurrencyCircleIcon({
  currency,
  size,
  showSpinner,
  showCheckmark,
  ...props
}: {
  currency: CryptoCurrency | TokenCurrency,
  size: number,
  showSpinner?: boolean,
  showCheckmark?: boolean,
}) {
  if (currency.type === 'TokenCurrency') {
    return 
  }
  const Icon = getCryptoCurrencyIcon(currency)
  return (
    
      {Icon &amp;&amp; }
      {showCheckmark &amp;&amp; (
        <div>
          
        </div>
      )}
      {showSpinner &amp;&amp; }
    
  )
github LedgerHQ / ledger-live-common / tools / src / demos / explorers / index.js View on Github external
render() {
    const { currency } = this.props;
    const Icon = getCryptoCurrencyIcon(currency);
    const info = getCurrencyExplorer(currency);

    return (
      
        
          {Icon ?  : {currency.ticker}}
        
        
          {info.version} {info.id}
        
        
          {this.state.times.map(({ time, error }, i) =&gt; (
            
          ))}