Skip to content

Commit 8ed9105

Browse files
Merge pull request #20 from creativetimofficial/v1.4.0
V1.4.0
2 parents b08d88b + f46a91d commit 8ed9105

13 files changed

Lines changed: 369 additions & 285 deletions

File tree

App.js

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import React from 'react';
2-
import { Image } from 'react-native';
3-
import { AppLoading } from 'expo';
4-
import { Asset } from 'expo-asset';
5-
import { Block, GalioProvider } from 'galio-framework';
1+
import React from "react";
2+
import { Image } from "react-native";
3+
import { AppLoading } from "expo";
4+
import { Asset } from "expo-asset";
5+
import { Block, GalioProvider } from "galio-framework";
6+
import { NavigationContainer } from "@react-navigation/native";
67

7-
import Screens from './navigation/Screens';
8-
import { Images, articles, argonTheme } from './constants';
8+
// Before rendering any navigation stack
9+
import { enableScreens } from "react-native-screens";
10+
enableScreens();
11+
12+
import Screens from "./navigation/Screens";
13+
import { Images, articles, argonTheme } from "./constants";
914

1015
// cache app images
1116
const assetImages = [
@@ -23,7 +28,7 @@ articles.map(article => assetImages.push(article.image));
2328

2429
function cacheImages(images) {
2530
return images.map(image => {
26-
if (typeof image === 'string') {
31+
if (typeof image === "string") {
2732
return Image.prefetch(image);
2833
} else {
2934
return Asset.fromModule(image).downloadAsync();
@@ -33,11 +38,11 @@ function cacheImages(images) {
3338

3439
export default class App extends React.Component {
3540
state = {
36-
isLoadingComplete: false,
37-
}
38-
41+
isLoadingComplete: false
42+
};
43+
3944
render() {
40-
if(!this.state.isLoadingComplete) {
45+
if (!this.state.isLoadingComplete) {
4146
return (
4247
<AppLoading
4348
startAsync={this._loadResourcesAsync}
@@ -47,19 +52,19 @@ export default class App extends React.Component {
4752
);
4853
} else {
4954
return (
50-
<GalioProvider theme={argonTheme}>
51-
<Block flex>
52-
<Screens />
53-
</Block>
54-
</GalioProvider>
55+
<NavigationContainer>
56+
<GalioProvider theme={argonTheme}>
57+
<Block flex>
58+
<Screens />
59+
</Block>
60+
</GalioProvider>
61+
</NavigationContainer>
5562
);
5663
}
5764
}
5865

5966
_loadResourcesAsync = async () => {
60-
return Promise.all([
61-
...cacheImages(assetImages),
62-
]);
67+
return Promise.all([...cacheImages(assetImages)]);
6368
};
6469

6570
_handleLoadingError = error => {
@@ -71,5 +76,4 @@ export default class App extends React.Component {
7176
_handleFinishLoading = () => {
7277
this.setState({ isLoadingComplete: true });
7378
};
74-
7579
}

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## [1.3.0] 2019-11-06
2+
### Updated dependencies
3+
- `expo@34.0.3` to `expo@35.0.0`
4+
- `expo-font@6.0.1` to `expo-font@7.0.0`
5+
- `expo-asset@6.0.0` to `expo-asset@7.0.0`
6+
- `react-native SDK@34.0.0` to `react-native SDK@35.0.0`
7+
- `galio-framework@0.6.1` to `galio-framework@0.6.3`
8+
- `babel-preset-expo@5.0.0` to `babel-preset-expo@7.0.0`
9+
### Updated files
10+
- changed drawer items in order to have a similar look to the PRO version
11+
112
## [1.2.0] 2019-09-18
213
### Updated dependencies
314
- `expo@33.0.0` to `expo@34.0.3`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [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)
22

33

4-
![version](https://img.shields.io/badge/version-1.3.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)
4+
![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)
55

66

77
![Product Gif](https://raw.githubusercontent.com/creativetimofficial/public-assets/master/argon-react-native/arg-rn-thumbnail.jpg)

app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"name": "Argon FREE React Native",
44
"slug": "argon-free-react-native",
55
"privacy": "public",
6-
"sdkVersion": "35.0.0",
6+
"sdkVersion": "36.0.0",
77
"platforms": [
88
"ios",
99
"android"
1010
],
11-
"version": "1.3.0",
11+
"version": "1.4.0",
1212
"orientation": "portrait",
1313
"icon": "./assets/icon.png",
1414
"splash": {

components/Card.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { withNavigation } from 'react-navigation';
2+
import { withNavigation } from '@react-navigation/compat';
33
import PropTypes from 'prop-types';
44
import { StyleSheet, Dimensions, Image, TouchableWithoutFeedback } from 'react-native';
55
import { Block, Text, theme } from 'galio-framework';

components/DrawerItem.js

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { StyleSheet } from "react-native";
2+
import { StyleSheet, TouchableOpacity } from "react-native";
33
import { Block, Text, theme } from "galio-framework";
44

55
import Icon from "./Icon";
@@ -15,7 +15,7 @@ class DrawerItem extends React.Component {
1515
<Icon
1616
name="shop"
1717
family="ArgonExtra"
18-
size={10}
18+
size={14}
1919
color={focused ? "white" : argonTheme.COLORS.PRIMARY}
2020
/>
2121
);
@@ -24,7 +24,7 @@ class DrawerItem extends React.Component {
2424
<Icon
2525
name="map-big"
2626
family="ArgonExtra"
27-
size={12}
27+
size={14}
2828
color={focused ? "white" : argonTheme.COLORS.ERROR}
2929
/>
3030
);
@@ -33,7 +33,7 @@ class DrawerItem extends React.Component {
3333
<Icon
3434
name="spaceship"
3535
family="ArgonExtra"
36-
size={12}
36+
size={14}
3737
color={focused ? "white" : argonTheme.COLORS.PRIMARY}
3838
/>
3939
);
@@ -42,7 +42,7 @@ class DrawerItem extends React.Component {
4242
<Icon
4343
name="chart-pie-35"
4444
family="ArgonExtra"
45-
size={12}
45+
size={14}
4646
color={focused ? "white" : argonTheme.COLORS.WARNING}
4747
/>
4848
);
@@ -51,12 +51,17 @@ class DrawerItem extends React.Component {
5151
<Icon
5252
name="calendar-date"
5353
family="ArgonExtra"
54-
size={12}
54+
size={14}
5555
color={focused ? "white" : argonTheme.COLORS.INFO}
5656
/>
5757
);
5858
case "Getting Started":
59-
return <Icon />;
59+
return (<Icon
60+
name="spaceship"
61+
family="ArgonExtra"
62+
size={14}
63+
color={focused ? "white" : "rgba(0,0,0,0.5)"}
64+
/>);
6065
case "Log out":
6166
return <Icon />;
6267
default:
@@ -65,36 +70,47 @@ class DrawerItem extends React.Component {
6570
};
6671

6772
render() {
68-
const { focused, title } = this.props;
73+
const { focused, title, navigation } = this.props;
6974

7075
const containerStyles = [
7176
styles.defaultStyle,
7277
focused ? [styles.activeStyle, styles.shadow] : null
7378
];
7479

7580
return (
76-
<Block flex row style={containerStyles}>
77-
<Block middle flex={0.1} style={{ marginRight: 5 }}>
78-
{this.renderIcon()}
79-
</Block>
80-
<Block row center flex={0.9}>
81-
<Text
82-
size={15}
83-
bold={focused ? true : false}
84-
color={focused ? "white" : "rgba(0,0,0,0.5)"}
85-
>
86-
{title}
87-
</Text>
81+
<TouchableOpacity
82+
style={{ height: 60 }}
83+
onPress={() =>
84+
title == "Getting Started"
85+
? Linking.openURL(
86+
"https://demos.creative-tim.com/argon-pro-react-native/docs/"
87+
).catch(err => console.error("An error occurred", err))
88+
: navigation.navigate(title)
89+
}
90+
>
91+
<Block flex row style={containerStyles}>
92+
<Block middle flex={0.1} style={{ marginRight: 5 }}>
93+
{this.renderIcon()}
94+
</Block>
95+
<Block row center flex={0.9}>
96+
<Text
97+
size={15}
98+
bold={focused ? true : false}
99+
color={focused ? "white" : "rgba(0,0,0,0.5)"}
100+
>
101+
{title}
102+
</Text>
103+
</Block>
88104
</Block>
89-
</Block>
105+
</TouchableOpacity>
90106
);
91107
}
92108
}
93109

94110
const styles = StyleSheet.create({
95111
defaultStyle: {
96-
paddingVertical: 15,
97-
paddingHorizontal: 14
112+
paddingVertical: 16,
113+
paddingHorizontal: 16
98114
},
99115
activeStyle: {
100116
backgroundColor: argonTheme.COLORS.ACTIVE,

components/Header.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { withNavigation } from 'react-navigation';
2+
import { withNavigation } from '@react-navigation/compat';
33
import { TouchableOpacity, StyleSheet, Platform, Dimensions } from 'react-native';
44
import { Button, Block, NavBar, Text, theme } from 'galio-framework';
55

@@ -52,7 +52,6 @@ class Header extends React.Component {
5252
}
5353
renderRight = () => {
5454
const { white, title, navigation } = this.props;
55-
const { routeName } = navigation.state;
5655

5756
if (title === 'Title') {
5857
return [
@@ -61,7 +60,7 @@ class Header extends React.Component {
6160
]
6261
}
6362

64-
switch (routeName) {
63+
switch (title) {
6564
case 'Home':
6665
return ([
6766
<BellButton key='chat-home' navigation={navigation} isWhite={white} />,
@@ -167,8 +166,8 @@ class Header extends React.Component {
167166
}
168167
render() {
169168
const { back, title, white, transparent, bgColor, iconColor, titleColor, navigation, ...props } = this.props;
170-
const { routeName } = navigation.state;
171-
const noShadow = ['Search', 'Categories', 'Deals', 'Pro', 'Profile'].includes(routeName);
169+
170+
const noShadow = ['Search', 'Categories', 'Deals', 'Pro', 'Profile'].includes(title);
172171
const headerStyles = [
173172
!noShadow ? styles.shadow : null,
174173
transparent ? { backgroundColor: 'rgba(0,0,0,0)' } : null,
@@ -182,17 +181,20 @@ class Header extends React.Component {
182181
return (
183182
<Block style={headerStyles}>
184183
<NavBar
185-
back={back}
184+
back={false}
186185
title={title}
187186
style={navbarStyles}
188187
transparent={transparent}
189188
right={this.renderRight()}
190189
rightStyle={{ alignItems: 'center' }}
191190
left={
192191
<Icon
193-
name={back ? 'nav-left' : "menu-8"} family="ArgonExtra"
194-
size={14} onPress={this.handleLeftPress}
195-
color={iconColor || argonTheme.COLORS.ICON}/>
192+
name={back ? 'chevron-left' : "menu"} family="entypo"
193+
size={20} onPress={this.handleLeftPress}
194+
color={iconColor || (white ? argonTheme.COLORS.WHITE : argonTheme.COLORS.ICON)}
195+
style={{ marginTop: 2 }}
196+
/>
197+
196198
}
197199
leftStyle={{ paddingVertical: 12, flex: 0.2 }}
198200
titleStyle={[

0 commit comments

Comments
 (0)