Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontAwesome 5 #776

Merged
merged 23 commits into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5340877
FontAwesome5 implementation
hampustagerud Jul 16, 2018
8e789bf
Update README.md
hampustagerud Jul 17, 2018
13e644a
Easier way to use FontAwesome5 Pro
hampustagerud Jul 17, 2018
c682035
FontAwesome 5 instructions
hampustagerud Jul 17, 2018
a698fe1
Automatic build and upgrading, also added to directory and IconExplorer
hampustagerud Jul 17, 2018
5d2dae1
Buttons and TabBarItems should be working on iOS too now
hampustagerud Jul 17, 2018
b144027
Updated build flow
hampustagerud Jul 18, 2018
5c1e203
Upgrading FontAwesome is automatic and occurs locally
hampustagerud Jul 18, 2018
0f9b2a5
Create FontAwesome 5 iconSet with factory
hampustagerud Jul 18, 2018
f1ef199
Setup FontAwesome 5 automatically
hampustagerud Jul 18, 2018
8a8a1d1
Bug fixes with FontAwesome 5 loading
hampustagerud Jul 18, 2018
569473f
getImageSource() implementation for FontAwesome 5
hampustagerud Jul 18, 2018
47cece2
Export all types in FontAwesome5 iconSets
hampustagerud Jul 18, 2018
6fd8697
Changed name on FA5Type to FA5Style
hampustagerud Jul 18, 2018
50942b8
Update docs to reflect changes to FontAwesome 5
hampustagerud Jul 18, 2018
d952755
Some final iOS fixes for FontAwesome 5 PR
hampustagerud Jul 18, 2018
f6d6365
Updated scripts
hampustagerud Jul 19, 2018
6bd1e49
Name changes and minor fixes
hampustagerud Jul 19, 2018
8c3189e
ensureNativeModuleAvailable() in its own file
hampustagerud Jul 19, 2018
7eb5d31
Removed add-font-assets from user binaries
hampustagerud Jul 19, 2018
4d1503a
Edited package.json ends with blank line now
hampustagerud Jul 19, 2018
068dc30
Cleaner code
hampustagerud Jul 19, 2018
d8763ee
Docs update
hampustagerud Jul 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Name changes and minor fixes
  • Loading branch information
hampustagerud committed Jul 19, 2018
commit 6bd1e4910e139fc8fd02075360c729737d69976f
2 changes: 1 addition & 1 deletion fonts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def config = project.hasProperty("vectoricons") ? project.vectoricons : [];

def iconFontsDir = config.iconFontsDir ?: "../../node_modules/react-native-vector-icons/Fonts";
def iconFontNames = config.iconFontNames ?: [ "*.ttf", "*.otf" ];
def iconFontNames = config.iconFontNames ?: [ "*.ttf" ];

gradle.projectsEvaluated {
// Grab all build types and product flavors
Expand Down
10 changes: 5 additions & 5 deletions lib/create-icon-set-from-fontawesome5.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export const FA5Style = {
brand: 3,
};

let setupFA5 = true;
let shouldSetupFA5 = true;

export function createFA5iconSet(glyphMap, proVersion = false) {
if (Platform.OS === 'ios' && setupFA5) {
setupFA5 = false;
if (Platform.OS === 'ios' && shouldSetupFA5) {
shouldSetupFA5 = false;
ensureNativeModuleAvailable();
NativeIconAPI.setupFontAwesome5();
}
Expand All @@ -48,7 +48,7 @@ export function createFA5iconSet(glyphMap, proVersion = false) {
'Font Awesome 5 Brands'
);

function selectIconSet(props) {
function getIconSetForProps(props) {
const { brand, light, solid } = props;

if (brand) return BrandsSet;
Expand All @@ -73,7 +73,7 @@ export function createFA5iconSet(glyphMap, proVersion = false) {
};

render() {
const selectedIconSet = selectIconSet(this.props);
const selectedIconSet = getIconSetForProps(this.props);
const SelectedIconClass = selectClass(selectedIconSet);

return <SelectedIconClass {...this.props} />;
Expand Down
1 change: 0 additions & 1 deletion lib/create-icon-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export default function createIconSet(
static defaultProps = {
size: DEFAULT_ICON_SIZE,
allowFontScaling: false,
extraStyle: {},
};

setNativeProps(nativeProps) {
Expand Down