How to use react-simple-img - 1 common examples

To help you get started, we’ve selected a few react-simple-img 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 antonycourtney / tabli / src / ts / components / tabItemUtil.tsx View on Github external
import * as React from 'react';
import * as styles from './cssStyles';
import { cx, css } from 'emotion';
import { TabItem } from '../tabWindow';
import * as utils from '../utils';
import { HEADER_BUTTON_SIZE } from './constants';
import { Theme } from './themeContext';
import * as svg from './svg';
import { inExtension } from '../utils';
import { initSimpleImg, SimpleImg } from 'react-simple-img';

const nodeEnv = process.env.NODE_ENV;

if (nodeEnv === 'development') {
    // only log errors in dev mode:
    initSimpleImg(undefined, undefined, true);
}

const emptyFavIconStyle = cx(styles.headerButton, styles.emptyFavIcon);
const favIconOpenStyle = styles.favIcon;
const favIconClosedStyle = cx(styles.favIcon, styles.favIconClosed);

const httpFavIconUrl = (url: string | null): string => {
    let fiSrc = '';
    if (url) {
        const urlinfo = utils.parseURL(url);
        if (urlinfo.host) {
            fiSrc = 'https://www.google.com/s2/favicons?domain=' + urlinfo.host;
        }
    }
    return fiSrc;
};

react-simple-img

react simple img

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Popular react-simple-img functions