Skip to content

Commit

Permalink
Add getImageSourceSync method (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador committed Feb 24, 2020
1 parent d0d6fbd commit 7e77b89
Show file tree
Hide file tree
Showing 31 changed files with 393 additions and 132 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -16,3 +16,5 @@ bower_components
# Xcode

xcuserdata

.DS_Store
2 changes: 1 addition & 1 deletion AntDesign.js
Expand Up @@ -15,5 +15,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;

1 change: 1 addition & 0 deletions Entypo.js
Expand Up @@ -15,4 +15,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;
1 change: 1 addition & 0 deletions EvilIcons.js
Expand Up @@ -15,4 +15,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
4 changes: 3 additions & 1 deletion Examples/IconExplorer/package.json
Expand Up @@ -6,15 +6,17 @@
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"postinstall": "pwd && ./scripts/postinstall.sh",
"test": "jest"
},
"dependencies": {
"@react-native-community/toolbar-android": "^0.1.0-rc.1",
"ramda": "^0.26.1",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-gesture-handler": "^1.5.1",
"react-native-screens": "^2.0.0-alpha.12",
"react-native-vector-icons": "*",
"react-native-vector-icons": "file:../../",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.3"
},
Expand Down
4 changes: 4 additions & 0 deletions Examples/IconExplorer/scripts/postinstall.sh
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

rm -rf node_modules/react-native-vector-icons/Examples
rm -rf node_modules/react-native-vector-icons/node_modules
23 changes: 16 additions & 7 deletions Examples/IconExplorer/src/IconSetList.js
Expand Up @@ -2,16 +2,14 @@ import React, { PureComponent } from 'react';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
import {
Alert,
Keyboard,
Platform,
Image,
SectionList,
StyleSheet,
Text,
TouchableHighlight,
View,
} from './react-native';

import IconList from './IconList';
import ICON_SETS from './icon-sets';

const BUTTONS = [
Expand Down Expand Up @@ -83,6 +81,18 @@ const INLINE = [
},
];

const SYNCHROUNOUS = [
{
name: 'synchronous',
children: (
<Image
source={FontAwesome.getImageSourceSync('check', 40, 'green')}
style={{ height: 40, width: 40 }}
/>
),
},
];

const styles = StyleSheet.create({
sectionHeader: {
paddingVertical: 5,
Expand Down Expand Up @@ -136,9 +146,7 @@ const renderButton = ({ item }) => (
</View>
);

const renderInline = ({ item }) => (
<View style={styles.row}>{item.children}</View>
);
const renderRow = ({ item }) => <View style={styles.row}>{item.children}</View>;

const renderStyling = ({ item }) => (
<View style={styles.row}>
Expand All @@ -153,7 +161,8 @@ export default class IconSetsList extends PureComponent {
sections: [
{ title: 'ICON SETS', data: ICON_SETS },
{ title: 'BUTTONS', data: BUTTONS, renderItem: renderButton },
{ title: 'INLINE', data: INLINE, renderItem: renderInline },
{ title: 'INLINE', data: INLINE, renderItem: renderRow },
{ title: 'SYNCHROUNOUS', data: SYNCHROUNOUS, renderItem: renderRow },
{ title: 'STYLING', data: STYLING, renderItem: renderStyling },
],
};
Expand Down
118 changes: 110 additions & 8 deletions Examples/IconExplorer/yarn.lock
Expand Up @@ -931,6 +931,11 @@
wcwidth "^1.0.1"
ws "^1.1.0"

"@react-native-community/toolbar-android@^0.1.0-rc.1":
version "0.1.0-rc.1"
resolved "https://registry.yarnpkg.com/@react-native-community/toolbar-android/-/toolbar-android-0.1.0-rc.1.tgz#5cd8451295628d6a5f87b2e6c162a94c0124de8d"
integrity sha512-j/CjkM5aT9N3tOF9yPxXoS9J3g/99FxnHkWTz9B+oXhp8RbJZPdpIIvNaYGUlKTBoNf66lmQrPvgnjbTvfEdLg==

"@react-navigation/core@^3.5.1":
version "3.5.1"
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-3.5.1.tgz#7a2339fca3496979305fb3a8ab88c2ca8d8c214d"
Expand Down Expand Up @@ -983,6 +988,11 @@
dependencies:
"@babel/types" "^7.3.0"

"@types/color-name@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==

"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
Expand Down Expand Up @@ -1140,13 +1150,26 @@ ansi-regex@^4.0.0, ansi-regex@^4.1.0:
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==

ansi-regex@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==

ansi-styles@^3.2.0, ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
dependencies:
color-convert "^1.9.0"

ansi-styles@^4.0.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359"
integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==
dependencies:
"@types/color-name" "^1.1.1"
color-convert "^2.0.1"

ansi-wrap@0.1.0, ansi-wrap@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf"
Expand Down Expand Up @@ -1638,6 +1661,15 @@ cliui@^5.0.0:
strip-ansi "^5.2.0"
wrap-ansi "^5.1.0"

cliui@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1"
integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^6.2.0"

clone@^1.0.2:
version "1.0.4"
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
Expand Down Expand Up @@ -1668,11 +1700,23 @@ color-convert@^1.9.0:
dependencies:
color-name "1.1.3"

color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"

color-name@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=

color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==

color-support@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
Expand Down Expand Up @@ -2016,6 +2060,11 @@ emoji-regex@^7.0.1:
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==

emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==

encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
Expand Down Expand Up @@ -2876,6 +2925,11 @@ is-fullwidth-code-point@^2.0.0:
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=

is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==

is-generator-fn@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118"
Expand Down Expand Up @@ -3632,7 +3686,7 @@ lodash.throttle@^4.1.1:
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=

lodash@^4.0.0, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5, lodash@^4.3.0:
lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5, lodash@^4.3.0:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
Expand Down Expand Up @@ -4850,14 +4904,12 @@ react-native-screens@^2.0.0-alpha.12:
dependencies:
debounce "^1.2.0"

react-native-vector-icons@*:
"react-native-vector-icons@file:../..":
version "6.6.0"
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-6.6.0.tgz#66cf004918eb05d90778d64bd42077c1800d481b"
integrity sha512-MImKVx8JEvVVBnaShMr7/yTX4Y062JZMupht1T+IEgbqBj4aQeQ1z2SH4VHWKNtWtppk4kz9gYyUiMWqx6tNSw==
dependencies:
lodash "^4.0.0"
prop-types "^15.6.2"
yargs "^13.2.2"
lodash "^4.17.15"
prop-types "^15.7.2"
yargs "^15.0.2"

react-native@0.61.5:
version "0.61.5"
Expand Down Expand Up @@ -5590,6 +5642,15 @@ string-width@^3.0.0, string-width@^3.1.0:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^5.1.0"

string-width@^4.1.0, string-width@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5"
integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"

string.prototype.trimleft@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634"
Expand Down Expand Up @@ -5634,6 +5695,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
dependencies:
ansi-regex "^4.1.0"

strip-ansi@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==
dependencies:
ansi-regex "^5.0.0"

strip-bom@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
Expand Down Expand Up @@ -6092,6 +6160,15 @@ wrap-ansi@^5.1.0:
string-width "^3.0.0"
strip-ansi "^5.0.0"

wrap-ansi@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53"
integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
Expand Down Expand Up @@ -6215,6 +6292,14 @@ yargs-parser@^13.1.1:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs-parser@^16.1.0:
version "16.1.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-16.1.0.tgz#73747d53ae187e7b8dbe333f95714c76ea00ecf1"
integrity sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs-parser@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9"
Expand All @@ -6240,7 +6325,7 @@ yargs@^12.0.5:
y18n "^3.2.1 || ^4.0.0"
yargs-parser "^11.1.1"

yargs@^13.2.2, yargs@^13.3.0:
yargs@^13.3.0:
version "13.3.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83"
integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==
Expand All @@ -6256,6 +6341,23 @@ yargs@^13.2.2, yargs@^13.3.0:
y18n "^4.0.0"
yargs-parser "^13.1.1"

yargs@^15.0.2:
version "15.1.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.1.0.tgz#e111381f5830e863a89550bd4b136bb6a5f37219"
integrity sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==
dependencies:
cliui "^6.0.0"
decamelize "^1.2.0"
find-up "^4.1.0"
get-caller-file "^2.0.1"
require-directory "^2.1.1"
require-main-filename "^2.0.0"
set-blocking "^2.0.0"
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^16.1.0"

yargs@^9.0.0:
version "9.0.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-9.0.1.tgz#52acc23feecac34042078ee78c0c007f5085db4c"
Expand Down
1 change: 1 addition & 0 deletions Feather.js
Expand Up @@ -15,4 +15,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;
2 changes: 1 addition & 1 deletion FontAwesome.js
Expand Up @@ -15,5 +15,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;

1 change: 1 addition & 0 deletions FontAwesome5.js
Expand Up @@ -19,4 +19,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;
1 change: 1 addition & 0 deletions FontAwesome5Pro.js
Expand Up @@ -19,4 +19,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;
2 changes: 1 addition & 1 deletion Fontisto.js
Expand Up @@ -15,5 +15,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;

2 changes: 1 addition & 1 deletion Foundation.js
Expand Up @@ -15,5 +15,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;

2 changes: 1 addition & 1 deletion Ionicons.js
Expand Up @@ -15,5 +15,5 @@ export const {
TabBarItemIOS,
ToolbarAndroid,
getImageSource,
getImageSourceSync,
} = iconSet;

0 comments on commit 7e77b89

Please sign in to comment.