mirror of
https://github.com/fergalmoran/argon-react-native.git
synced 2025-12-27 03:38:21 +00:00
@@ -1 +1,2 @@
|
||||
{}
|
||||
|
||||
|
||||
106
App.js
106
App.js
@@ -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 });
|
||||
// };
|
||||
// }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# [Argon React Native](https://creativetimofficial.github.io/argon-react-native/docs/#) [](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)
|
||||
|
||||
|
||||
 [](https://github.com/creativetimofficial/argon-react-native/issues?q=is%3Aopen+is%3Aissue) [](https://github.com/creativetimofficial/argon-react-native/issues?q=is%3Aissue+is%3Aclosed)
|
||||
 [](https://github.com/creativetimofficial/argon-react-native/issues?q=is%3Aopen+is%3Aissue) [](https://github.com/creativetimofficial/argon-react-native/issues?q=is%3Aissue+is%3Aclosed)
|
||||
|
||||
|
||||

|
||||
@@ -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)
|
||||
|
||||
|
||||
7
app.json
7
app.json
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
23
package.json
23
package.json
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user