How to use the react-native-vector-icons/FontAwesome.getImageSource function in react-native-vector-icons

To help you get started, we’ve selected a few react-native-vector-icons 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 mattermost / mattermost-mobile / share_extension / ios / extension_channels.js View on Github external
try {
            const {entities, teamId} = this.props;
            const views = {
                extension: {
                    selectedTeamId: teamId,
                },
            };
            const state = {entities, views};
            const publicChannels = getExtensionSortedPublicChannels(state);
            const privateChannels = getExtensionSortedPrivateChannels(state);
            const directChannels = getExtensionSortedDirectChannels(state);

            const icons = await Promise.all([
                Icon.getImageSource('globe', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('lock', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('user', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('users', 16, this.props.theme.centerChannelColor),
            ]);

            this.publicChannelIcon = icons[0];
            this.privateChannelIcon = icons[1];
            this.dmChannelIcon = icons[2];
            this.gmChannelIcon = icons[3];

            this.setState({
                publicChannels,
                privateChannels,
                directChannels,
            }, () => {
                this.buildSections();
            });
        } catch (error) {
github mrarronz / react-native-blog-examples / Chapter9-Iconfont / IconfontExample / src / screen / OtherUsage / ToolbarAndroidScreen.js View on Github external
componentWillMount() {
    Icon.getImageSource('android', 36, '#92c029').then((source) => {
      this.setState({
        appLogo: source
      })
    });
  }
github akilb / rukatuk-mobile / app / screens / event-map / EventMapScreen.js View on Github external
componentDidMount() {
    trackScreenView('Event Map - ' + this.props.event.name);

    Icon
      .getImageSource('map-o', 20, 'white')
      .then((mapIcon) => {
        this.props.navigator.setButtons({
          rightButtons: [
            {
              id: 'directions',
              icon: mapIcon
            }
          ]
        });
      });
  }
github mattermost / mattermost-mobile / share_extension / ios / extension_channels.js View on Github external
loadChannels = async () => {
        try {
            const {entities, teamId} = this.props;
            const views = {
                extension: {
                    selectedTeamId: teamId,
                },
            };
            const state = {entities, views};
            const publicChannels = getExtensionSortedPublicChannels(state);
            const privateChannels = getExtensionSortedPrivateChannels(state);
            const directChannels = getExtensionSortedDirectChannels(state);

            const icons = await Promise.all([
                Icon.getImageSource('globe', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('lock', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('user', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('users', 16, this.props.theme.centerChannelColor),
            ]);

            this.publicChannelIcon = icons[0];
            this.privateChannelIcon = icons[1];
            this.dmChannelIcon = icons[2];
            this.gmChannelIcon = icons[3];

            this.setState({
                publicChannels,
                privateChannels,
                directChannels,
            }, () => {
                this.buildSections();
github akilb / rukatuk-mobile / app / screens / event-detail / EventDetailScreen.js View on Github external
componentDidMount() {
    trackScreenView('Event Detail - ' + this.props.event.name);

    let shareIcon = Platform.OS === 'ios' ? 'share-square-o' : 'share-alt';
    Icon
      .getImageSource(shareIcon, 20, 'white')
      .then((mapIcon) => {
        this.props.navigator.setButtons({
          rightButtons: [
            {
              id: 'share',
              icon: mapIcon
            }
          ]
        });
      });
  }
github mrarronz / react-native-blog-examples / Chapter9-Iconfont / IconfontExample / src / screen / OtherUsage / OtherScreen.js View on Github external
constructor(props) {
    super(props);
    this.state = {
      userIcon: null,
      showError: false,
      errorText: null
    };
    Icon.getImageSource('user', 50, '#999').then((source) => {
      this.setState({
        userIcon: source
      })
    })
  }
github AlbertBrand / react-native-android-tablayout / example / app / IconsOnTopTabLayout.js View on Github external
componentDidMount() {
    Icon.getImageSource('user', 24, 'red').then(source => {
      this.setState({ iconUri: source.uri })
    });
  }
github mattermost / mattermost-mobile / share_extension / ios / extension_channels.js View on Github external
loadChannels = async () => {
        try {
            const {entities, teamId} = this.props;
            const views = {
                extension: {
                    selectedTeamId: teamId,
                },
            };
            const state = {entities, views};
            const publicChannels = getExtensionSortedPublicChannels(state);
            const privateChannels = getExtensionSortedPrivateChannels(state);
            const directChannels = getExtensionSortedDirectChannels(state);

            const icons = await Promise.all([
                Icon.getImageSource('globe', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('lock', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('user', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('users', 16, this.props.theme.centerChannelColor),
            ]);

            this.publicChannelIcon = icons[0];
            this.privateChannelIcon = icons[1];
            this.dmChannelIcon = icons[2];
            this.gmChannelIcon = icons[3];

            this.setState({
                publicChannels,
                privateChannels,
                directChannels,
            }, () => {
                this.buildSections();
            });
github mattermost / mattermost-mobile / share_extension / ios / extension_channels.js View on Github external
const {entities, teamId} = this.props;
            const views = {
                extension: {
                    selectedTeamId: teamId,
                },
            };
            const state = {entities, views};
            const publicChannels = getExtensionSortedPublicChannels(state);
            const privateChannels = getExtensionSortedPrivateChannels(state);
            const directChannels = getExtensionSortedDirectChannels(state);

            const icons = await Promise.all([
                Icon.getImageSource('globe', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('lock', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('user', 16, this.props.theme.centerChannelColor),
                Icon.getImageSource('users', 16, this.props.theme.centerChannelColor),
            ]);

            this.publicChannelIcon = icons[0];
            this.privateChannelIcon = icons[1];
            this.dmChannelIcon = icons[2];
            this.gmChannelIcon = icons[3];

            this.setState({
                publicChannels,
                privateChannels,
                directChannels,
            }, () => {
                this.buildSections();
            });
        } catch (error) {
            this.setState({error});