Merge pull request #23 from creativetimofficial/v1.5.0

V1.5.0
This commit is contained in:
Petru Alin Gheorghe
2020-06-04 20:08:43 -04:00
committed by GitHub
8 changed files with 95 additions and 50 deletions

View File

@@ -1 +1,2 @@
{}

106
App.js
View File

@@ -1,6 +1,7 @@
import React from "react";
import React, {useState} from "react";
import { Image } from "react-native";
import { AppLoading } from "expo";
import { useFonts } from '@use-expo/font';
import { Asset } from "expo-asset";
import { Block, GalioProvider } from "galio-framework";
import { NavigationContainer } from "@react-navigation/native";
@@ -36,44 +37,85 @@ function cacheImages(images) {
});
}
export default class App extends React.Component {
state = {
isLoadingComplete: false
};
export default props => {
const [isLoadingComplete, setLoading] = useState(false);
let [fontsLoaded] = useFonts({
'ArgonExtra': require('./assets/font/argon.ttf'),
});
render() {
if (!this.state.isLoadingComplete) {
return (
<AppLoading
startAsync={this._loadResourcesAsync}
onError={this._handleLoadingError}
onFinish={this._handleFinishLoading}
/>
);
} else {
return (
<NavigationContainer>
<GalioProvider theme={argonTheme}>
<Block flex>
<Screens />
</Block>
</GalioProvider>
</NavigationContainer>
);
}
function _loadResourcesAsync() {
return Promise.all([...cacheImages(assetImages)]);
}
_loadResourcesAsync = async () => {
return Promise.all([...cacheImages(assetImages)]);
};
_handleLoadingError = error => {
function _handleLoadingError(error) {
// In this case, you might want to report the error to your error
// reporting service, for example Sentry
console.warn(error);
};
_handleFinishLoading = () => {
this.setState({ isLoadingComplete: true });
function _handleFinishLoading() {
setLoading(true);
};
if(!fontsLoaded && !isLoadingComplete) {
return (
<AppLoading
startAsync={_loadResourcesAsync}
onError={_handleLoadingError}
onFinish={_handleFinishLoading}
/>
);
} else if(fontsLoaded) {
return (
<NavigationContainer>
<GalioProvider theme={argonTheme}>
<Block flex>
<Screens />
</Block>
</GalioProvider>
</NavigationContainer>
);
}
}
// export default class App extends React.Component {
// state = {
// isLoadingComplete: false
// };
// render() {
// if (!this.state.isLoadingComplete) {
// return (
// <AppLoading
// startAsync={this._loadResourcesAsync}
// onError={this._handleLoadingError}
// onFinish={this._handleFinishLoading}
// />
// );
// } else {
// return (
// <NavigationContainer>
// <GalioProvider theme={argonTheme}>
// <Block flex>
// <Screens />
// </Block>
// </GalioProvider>
// </NavigationContainer>
// );
// }
// }
// _loadResourcesAsync = async () => {
// return Promise.all([...cacheImages(assetImages)]);
// };
// _handleLoadingError = error => {
// // In this case, you might want to report the error to your error
// // reporting service, for example Sentry
// console.warn(error);
// };
// _handleFinishLoading = () => {
// this.setState({ isLoadingComplete: true });
// };
// }

View File

@@ -1,7 +1,7 @@
# [Argon React Native](https://creativetimofficial.github.io/argon-react-native/docs/#) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter)](https://twitter.com/home?status=Argon%20React%20Native,%20a%20cool%20Argon%20React%20Native%20App%20Template%20%E2%9D%A4%EF%B8%8F%20https%3A//bit.ly/2KAj86H%20%23reactnative%20%23argon%20%23designsystem%20%23developers%20via%20%40CreativeTim)
![version](https://img.shields.io/badge/version-1.4.0-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/argon-react-native.svg?style=flat)](https://github.com/creativetimofficial/argon-react-native/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/argon-react-native.svg?maxAge=2592000)](https://github.com/creativetimofficial/argon-react-native/issues?q=is%3Aissue+is%3Aclosed)
![version](https://img.shields.io/badge/version-1.5.0-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/argon-react-native.svg?style=flat)](https://github.com/creativetimofficial/argon-react-native/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/argon-react-native.svg?maxAge=2592000)](https://github.com/creativetimofficial/argon-react-native/issues?q=is%3Aissue+is%3Aclosed)
![Product Gif](https://raw.githubusercontent.com/creativetimofficial/public-assets/master/argon-react-native/arg-rn-thumbnail.jpg)
@@ -162,7 +162,7 @@ If you have questions or need help integrating the product please [contact us](h
## Licensing
- Copyright 2019 Creative Tim (https://www.creative-tim.com/)
- Copyright 2020 Creative Tim (https://www.creative-tim.com/)
- Licensed under MIT (https://github.com/creativetimofficial/argon-react-native/blob/master/LICENSE.md)

View File

@@ -3,12 +3,12 @@
"name": "Argon FREE React Native",
"slug": "argon-free-react-native",
"privacy": "public",
"sdkVersion": "36.0.0",
"sdkVersion": "37.0.0",
"platforms": [
"ios",
"android"
],
"version": "1.4.0",
"version": "1.5.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
@@ -24,6 +24,7 @@
],
"ios": {
"supportsTablet": true
}
},
"description": "Argon React Native, based on Argon Design System. Coded by Creative Tim"
}
}

View File

@@ -1,5 +1,5 @@
import React from "react";
import { StyleSheet, TouchableOpacity } from "react-native";
import { StyleSheet, TouchableOpacity, Linking } from "react-native";
import { Block, Text, theme } from "galio-framework";
import Icon from "./Icon";

View File

@@ -3,7 +3,7 @@ import * as Font from 'expo-font';
import { createIconSetFromIcoMoon } from '@expo/vector-icons';
import { Icon } from 'galio-framework';
import argonConfig from '../assets/font/argon.json';
import argonConfig from '../assets/config/argon.json';
const ArgonExtra = require('../assets/font/argon.ttf');
const IconArgonExtra = createIconSetFromIcoMoon(argonConfig, 'ArgonExtra');

View File

@@ -1,6 +1,6 @@
{
"name": "argon-react-native",
"version": "1.4.0",
"version": "1.5.0",
"description": "Argon React Native, based on Argon Design System. Coded by Creative Tim",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
@@ -14,27 +14,28 @@
"url": "git+https://github.com/creativetimofficial/argon-react-native.git"
},
"dependencies": {
"@react-native-community/masked-view": "0.1.5",
"@react-native-community/masked-view": "0.1.6",
"@react-navigation/bottom-tabs": "^5.0.6",
"@react-navigation/compat": "^5.0.0",
"@react-navigation/drawer": "5.0.0",
"@react-navigation/native": "5.0.0",
"@react-navigation/stack": "5.0.0",
"expo": "^36.0.0",
"expo-asset": "~8.0.0",
"expo-font": "~8.0.0",
"@use-expo/font": "^2.0.0",
"expo": "^37.0.0",
"expo-asset": "~8.1.5",
"expo-font": "~8.1.0",
"galio-framework": "^0.6.3",
"prop-types": "^15.7.2",
"react": "16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",
"react-native-gesture-handler": "~1.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-gesture-handler": "~1.6.0",
"react-native-modal-dropdown": "^0.7.0",
"react-native-reanimated": "~1.4.0",
"react-native-safe-area-context": "0.6.0",
"react-native-screens": "2.0.0-alpha.12"
"react-native-reanimated": "~1.7.0",
"react-native-safe-area-context": "0.7.3",
"react-native-screens": "~2.2.0"
},
"devDependencies": {
"babel-preset-expo": "^7.0.0"
"babel-preset-expo": "^8.2.1"
},
"keywords": [
"argon react native",