Merge pull request #78 from esteemapp/splash

Splash
This commit is contained in:
Feruz M 2018-11-01 00:32:56 +05:30 committed by GitHub
commit bbe4762d34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 189 additions and 74 deletions

0
android/app/src/main/assets/fonts/Feather.ttf Normal file → Executable file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -58,6 +58,20 @@
FB28DFAA729D4DC3B1668FBC /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0754D5AAEA2D4DCA9DA7283D /* Entypo.ttf */; };
FE22D3734B2C48CB890715FF /* libRealmReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D0A4B6BC3004763A0094EF3 /* libRealmReact.a */; };
BA0C1519F2E34F3090353B33 /* libFastImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A0E809C308B04FFF8DEB1C3E /* libFastImage.a */; };
C9EFC2A575D04A5DB4E87919 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 25CA7C700A97494C8318E7BE /* Entypo.ttf */; };
BACE4502E4524BB99BE86991 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4282462FA5214119A868BBF3 /* EvilIcons.ttf */; };
6E051169A73240F396F72FB8 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 09EE0BBB84084400A431ED4F /* Feather.ttf */; };
9484750425EB4D2C9F3AE2AF /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3DBD34C10DAD438991B72B56 /* FontAwesome.ttf */; };
2FD6ACD9E48343B28515DF2E /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0A541A3100C342BFBC74F455 /* Foundation.ttf */; };
8E13C32502364B1B8AFF544A /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 66BA62309BEA41EC803D0A8E /* Ionicons.ttf */; };
73B981C9D35E42FB8D7C29E7 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A4A60418D5494F24804C5CA2 /* MaterialCommunityIcons.ttf */; };
0F0AB5633FBB48DDBB01CA66 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 02EA0F6654944B7D91A0DAA1 /* MaterialIcons.ttf */; };
D3576D00F64A4D1EAF856410 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 924FFBBEFB9243B3B302A091 /* Octicons.ttf */; };
B1C418360FF3494F93CB9363 /* RobotoMono-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 290072336E6C47ECAD3C1FE9 /* RobotoMono-Regular.ttf */; };
A746959D6C2D48A4979116D3 /* Sansation_Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4A4850C4497A47EB8AE7E44F /* Sansation_Bold.ttf */; };
779C868B0AC245B28B9BBF97 /* Sansation_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BEF289895AD748F8BB80FE7B /* Sansation_Regular.ttf */; };
7629588BF9D44505B5CAEFFE /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1A53834A36C645808C0D4040 /* SimpleLineIcons.ttf */; };
477BCAF129CB472C87E7E3F7 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6DD3401D1815479D962B5064 /* Zocial.ttf */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -424,6 +438,20 @@
FBBEEEBB9C8048F78189B2C0 /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
C840826DE45F44E5A4972D7F /* FastImage.xcodeproj */ = {isa = PBXFileReference; name = "FastImage.xcodeproj"; path = "../node_modules/react-native-fast-image/ios/FastImage.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
A0E809C308B04FFF8DEB1C3E /* libFastImage.a */ = {isa = PBXFileReference; name = "libFastImage.a"; path = "libFastImage.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
25CA7C700A97494C8318E7BE /* Entypo.ttf */ = {isa = PBXFileReference; name = "Entypo.ttf"; path = "../src/assets/Fonts/Entypo.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
4282462FA5214119A868BBF3 /* EvilIcons.ttf */ = {isa = PBXFileReference; name = "EvilIcons.ttf"; path = "../src/assets/Fonts/EvilIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
09EE0BBB84084400A431ED4F /* Feather.ttf */ = {isa = PBXFileReference; name = "Feather.ttf"; path = "../src/assets/Fonts/Feather.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
3DBD34C10DAD438991B72B56 /* FontAwesome.ttf */ = {isa = PBXFileReference; name = "FontAwesome.ttf"; path = "../src/assets/Fonts/FontAwesome.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
0A541A3100C342BFBC74F455 /* Foundation.ttf */ = {isa = PBXFileReference; name = "Foundation.ttf"; path = "../src/assets/Fonts/Foundation.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
66BA62309BEA41EC803D0A8E /* Ionicons.ttf */ = {isa = PBXFileReference; name = "Ionicons.ttf"; path = "../src/assets/Fonts/Ionicons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
A4A60418D5494F24804C5CA2 /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; name = "MaterialCommunityIcons.ttf"; path = "../src/assets/Fonts/MaterialCommunityIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
02EA0F6654944B7D91A0DAA1 /* MaterialIcons.ttf */ = {isa = PBXFileReference; name = "MaterialIcons.ttf"; path = "../src/assets/Fonts/MaterialIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
924FFBBEFB9243B3B302A091 /* Octicons.ttf */ = {isa = PBXFileReference; name = "Octicons.ttf"; path = "../src/assets/Fonts/Octicons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
290072336E6C47ECAD3C1FE9 /* RobotoMono-Regular.ttf */ = {isa = PBXFileReference; name = "RobotoMono-Regular.ttf"; path = "../src/assets/Fonts/RobotoMono-Regular.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
4A4850C4497A47EB8AE7E44F /* Sansation_Bold.ttf */ = {isa = PBXFileReference; name = "Sansation_Bold.ttf"; path = "../src/assets/Fonts/Sansation_Bold.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
BEF289895AD748F8BB80FE7B /* Sansation_Regular.ttf */ = {isa = PBXFileReference; name = "Sansation_Regular.ttf"; path = "../src/assets/Fonts/Sansation_Regular.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
1A53834A36C645808C0D4040 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; name = "SimpleLineIcons.ttf"; path = "../src/assets/Fonts/SimpleLineIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
6DD3401D1815479D962B5064 /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../src/assets/Fonts/Zocial.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -675,6 +703,20 @@
88197F38DF02441F9B738AFF /* rubicon-icon-font.ttf */,
B3E4DB34CA2240EDA2D0E831 /* SimpleLineIcons.ttf */,
2F7FE3F27575464186B3A5EC /* Zocial.ttf */,
25CA7C700A97494C8318E7BE /* Entypo.ttf */,
4282462FA5214119A868BBF3 /* EvilIcons.ttf */,
09EE0BBB84084400A431ED4F /* Feather.ttf */,
3DBD34C10DAD438991B72B56 /* FontAwesome.ttf */,
0A541A3100C342BFBC74F455 /* Foundation.ttf */,
66BA62309BEA41EC803D0A8E /* Ionicons.ttf */,
A4A60418D5494F24804C5CA2 /* MaterialCommunityIcons.ttf */,
02EA0F6654944B7D91A0DAA1 /* MaterialIcons.ttf */,
924FFBBEFB9243B3B302A091 /* Octicons.ttf */,
290072336E6C47ECAD3C1FE9 /* RobotoMono-Regular.ttf */,
4A4850C4497A47EB8AE7E44F /* Sansation_Bold.ttf */,
BEF289895AD748F8BB80FE7B /* Sansation_Regular.ttf */,
1A53834A36C645808C0D4040 /* SimpleLineIcons.ttf */,
6DD3401D1815479D962B5064 /* Zocial.ttf */,
);
name = Resources;
sourceTree = "<group>";
@ -1284,6 +1326,20 @@
ED5A78654C33412F88CC8D4F /* rubicon-icon-font.ttf in Resources */,
1954C43044AC4F14B97C7F24 /* SimpleLineIcons.ttf in Resources */,
50F38870321E45BAAD4ECC10 /* Zocial.ttf in Resources */,
C9EFC2A575D04A5DB4E87919 /* Entypo.ttf in Resources */,
BACE4502E4524BB99BE86991 /* EvilIcons.ttf in Resources */,
6E051169A73240F396F72FB8 /* Feather.ttf in Resources */,
9484750425EB4D2C9F3AE2AF /* FontAwesome.ttf in Resources */,
2FD6ACD9E48343B28515DF2E /* Foundation.ttf in Resources */,
8E13C32502364B1B8AFF544A /* Ionicons.ttf in Resources */,
73B981C9D35E42FB8D7C29E7 /* MaterialCommunityIcons.ttf in Resources */,
0F0AB5633FBB48DDBB01CA66 /* MaterialIcons.ttf in Resources */,
D3576D00F64A4D1EAF856410 /* Octicons.ttf in Resources */,
B1C418360FF3494F93CB9363 /* RobotoMono-Regular.ttf in Resources */,
A746959D6C2D48A4979116D3 /* Sansation_Bold.ttf in Resources */,
779C868B0AC245B28B9BBF97 /* Sansation_Regular.ttf in Resources */,
7629588BF9D44505B5CAEFFE /* SimpleLineIcons.ttf in Resources */,
477BCAF129CB472C87E7E3F7 /* Zocial.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -69,6 +69,9 @@
<string>rubicon-icon-font.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
<string>RobotoMono-Regular.ttf</string>
<string>Sansation_Bold.ttf</string>
<string>Sansation_Regular.ttf</string>
</array>
</dict>
</plist>

View File

@ -4,7 +4,7 @@
"private": true,
"rnpm": {
"assets": [
"./assets/fonts"
"./src/assets/Fonts"
]
},
"scripts": {

Binary file not shown.

Binary file not shown.

View File

@ -54,6 +54,6 @@ export default SwitchNavigator({
stackNavigatior,
[ROUTES.SCREENS.LOGIN]: { screen: RootComponent()(Login) },
[ROUTES.SCREENS.PINCODE]: { screen: RootComponent()(PinCode) },
[ROUTES.SCREENS.SPLASH]: { screen: RootComponent()(Splash) },
[ROUTES.SCREENS.SPLASH]: { screen: Splash },
[ROUTES.SCREENS.STEEM_CONNECT]: { screen: RootComponent()(SteemConnect) },
});

View File

@ -13,6 +13,7 @@ EStyleSheet.build({
$white: '#FFFFFF',
$black: '#000000',
$primaryBlue: '#357ce6',
$primaryDarkBlue: '#1a509a',
$primaryLightBlue: '#eaf2fc',
$primaryGray: '#f5f5f5',
$primaryDarkGray: '#788187',

View File

@ -143,10 +143,10 @@ export const setUserDataWithPinCode = data => new Promise((resolve, reject) => {
username: userData.name,
authType: 'steemConnect',
accessToken: encryptKey(data.accessToken, data.pinCode),
postingKey: '',
masterKey: '',
activeKey: '',
memoKey: '',
postingKey: encryptKey(privateKeys.posting.toString(), data.pinCode),
activeKey: encryptKey(privateKeys.active.toString(), data.pinCode),
memoKey: encryptKey(privateKeys.memo.toString(), data.pinCode),
};
}

View File

@ -30,7 +30,7 @@ const realm = new Realm({ path: 'esteem.realm', schema: [userSchema, authSchema]
// TODO: This is getting ALL user data, we should change this method with getUserDataWithUsername
export const getUserData = () => new Promise((resolve, reject) => {
try {
const user = realm.objects(USER_SCHEMA);
const user = Array.from(realm.objects(USER_SCHEMA));
resolve(user);
} catch (error) {
reject(error);

View File

@ -1,10 +1,9 @@
import { getAccount } from '../../providers/steem/dsteem';
import {
ADD_NEW_ACCOUNT,
UPDATE_ACCOUNT_DATA,
REMOVE_ACCOUNT_DATA,
FETCH_ACCOUNT_FAIL,
FETCHING_ACCOUNT,
ADD_OTHER_ACCOUNT,
UPDATE_CURRENT_ACCOUNT,
} from '../constants/constants';
export const fetchAccountFromSteem = (username, password) => (dispatch) => {
@ -12,29 +11,19 @@ export const fetchAccountFromSteem = (username, password) => (dispatch) => {
return getAccount(username)
.then(res => dispatch({
type: ADD_NEW_ACCOUNT,
type: UPDATE_CURRENT_ACCOUNT,
payload: { ...res[0], password },
}))
.catch(err => dispatch({ type: FETCH_ACCOUNT_FAIL, payload: err }));
};
export const addPassiveAccount = data => ({
type: ADD_NEW_ACCOUNT,
payload: { isActive: false, ...data },
});
export const addNewAccount = data => ({
type: ADD_NEW_ACCOUNT,
export const updateCurrentAccount = data => ({
type: UPDATE_CURRENT_ACCOUNT,
payload: data,
});
export const updateAccountData = data => ({
type: UPDATE_ACCOUNT_DATA,
payload: data,
});
export const removeAccountData = data => ({
type: REMOVE_ACCOUNT_DATA,
export const addOtherAccount = data => ({
type: ADD_OTHER_ACCOUNT,
payload: data,
});

View File

@ -1,5 +1,9 @@
import {
LOGIN, LOGOUT, OPEN_PIN_CODE_MODAL, CLOSE_PIN_CODE_MODAL,
LOGIN,
LOGOUT,
OPEN_PIN_CODE_MODAL,
CLOSE_PIN_CODE_MODAL,
ACTIVE_APPLICATION,
} from '../constants/constants';
export const login = () => ({
@ -17,3 +21,7 @@ export const openPinCodeModal = () => ({
export const closePinCodeModal = () => ({
type: CLOSE_PIN_CODE_MODAL,
});
export const activeApplication = () => ({
type: ACTIVE_APPLICATION,
});

View File

@ -8,12 +8,12 @@ export const LOGOUT = 'LOGOUT';
export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
export const LOGOUT_FAIL = 'LOGOUT_FAIL';
export const ADD_NEW_ACCOUNT = 'ADD_NEW_ACCOUNT';
export const UPDATE_ACCOUNT_DATA = 'UPDATE_ACCOUNT_DATA';
export const REMOVE_ACCOUNT_DATA = 'REMOVE_ACCOUNT_DATA';
export const ADD_OTHER_ACCOUNT = 'ADD_OTHER_ACCOUNT';
export const UPDATE_CURRENT_ACCOUNT = 'UPDATE_CURRENT_ACCOUNT';
export const FETCHING_ACCOUNT = 'FETCHING_ACCOUNT';
export const FETCH_ACCOUNT_FAIL = 'FETCH_ACCOUNT_FAIL';
export const IS_LOGGED_IN = 'IS_LOGGED_IN';
export const OPEN_PIN_CODE_MODAL = 'OPEN_PIN_CODE_MODAL';
export const CLOSE_PIN_CODE_MODAL = 'CLOSE_PIN_CODE_MODAL';
export const ACTIVE_APPLICATION = 'ACTIVE_APPLICATION';

View File

@ -1,17 +1,14 @@
import {
ADD_NEW_ACCOUNT,
UPDATE_ACCOUNT_DATA,
REMOVE_ACCOUNT_DATA,
FETCH_ACCOUNT_FAIL,
FETCHING_ACCOUNT,
ADD_OTHER_ACCOUNT,
UPDATE_CURRENT_ACCOUNT,
} from '../constants/constants';
const initialState = {
isFetching: null,
data: {
accounts: [],
currentAccountId: null,
},
otherAccounts: [],
currentAccount: {},
hasError: false,
errorMessage: null,
};
@ -32,34 +29,24 @@ export default function (state = initialState, action) {
hasError: true,
errorMessage: action.payload,
};
case ADD_NEW_ACCOUNT:
case ADD_OTHER_ACCOUNT:
return {
...state,
otherAccounts: [...state.otherAccounts, action.payload],
isFetching: false,
data: {
accounts: [...state.data.accounts, action.payload],
currentAccountId: action.payload.id,
},
hasError: false,
errorMessage: null,
};
case UPDATE_ACCOUNT_DATA:
return Object.assign({}, state, {
case UPDATE_CURRENT_ACCOUNT:
return {
...state,
currentAccount: action.payload,
isFetching: false,
data: action.payload,
hasError: false,
errorMessage: null,
});
case REMOVE_ACCOUNT_DATA:
return Object.assign({}, state, {
isFetching: false,
data: action.payload,
hasError: false,
errorMessage: null,
});
};
default:
return state;
}

View File

@ -1,11 +1,16 @@
import {
LOGIN, LOGOUT, OPEN_PIN_CODE_MODAL, CLOSE_PIN_CODE_MODAL,
LOGIN,
LOGOUT,
OPEN_PIN_CODE_MODAL,
CLOSE_PIN_CODE_MODAL,
ACTIVE_APPLICATION,
} from '../constants/constants';
const initialState = {
isLoggedIn: false, // Has any logged in user.
loading: false, // It is lock to all screen and shows loading animation.
isPinCodeReqiure: false,
isActive: false,
};
export default function (state = initialState, action) {
@ -30,6 +35,11 @@ export default function (state = initialState, action) {
...state,
isPinCodeReqiure: false,
};
case ACTIVE_APPLICATION:
return {
...state,
isActive: true,
};
default:
return state;
}

View File

@ -7,7 +7,9 @@ import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
import { connect } from 'react-redux';
// Actions
import { addPassiveAccount, failedAccount } from '../../../redux/actions/accountAction';
import {
failedAccount, addOtherAccount, updateCurrentAccount,
} from '../../../redux/actions/accountAction';
import {
login as loginAction, openPinCodeModal,
} from '../../../redux/actions/applicationActions';
@ -51,7 +53,8 @@ class LoginScreen extends Component {
Login(username, password)
.then((result) => {
if (result) {
dispatch(addPassiveAccount(result));
dispatch(updateCurrentAccount({ ...result }));
dispatch(addOtherAccount({ username: result.name }));
dispatch(loginAction());
dispatch(openPinCodeModal());
setPinCodeState({ navigateTo: ROUTES.DRAWER.MAIN });

View File

@ -130,9 +130,7 @@ class PinCodeContainer extends Component {
}
const mapStateToProps = state => ({
currentAccount: state.account.data.accounts.find(
item => item.id === state.account.data.currentAccountId,
),
currentAccount: state.account.currentAccount,
});
export default connect(mapStateToProps)(PinCodeContainer);

View File

@ -9,6 +9,9 @@ import { openPinCodeModal } from '../../../redux/actions/applicationActions';
import { Modal } from '../../../components';
import { PinCode } from '../..';
// Constants
import { default as ROUTES } from '../../../constants/routeNames';
const RootContainer = () => (WrappedComponent) => {
class RootComponent extends Component {
constructor(props) {
@ -20,6 +23,13 @@ const RootContainer = () => (WrappedComponent) => {
};
}
componentWillMount() {
const { isActiveApp, navigation } = this.props;
if (!isActiveApp) {
navigation.navigate(ROUTES.SCREENS.SPLASH);
}
}
componentDidMount() {
AppState.addEventListener('change', this._handleAppStateChange);
}
@ -74,6 +84,7 @@ const RootContainer = () => (WrappedComponent) => {
}
const mapStateToProps = state => ({
isPinCodeReqiure: state.application.isPinCodeReqiure,
isActiveApp: state.application.isActive,
});
return connect(mapStateToProps)(RootComponent);

View File

@ -1,6 +1,12 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { getUserData, getAuthStatus } from '../../../realm/realm';
import { getAccount } from '../../../providers/steem/dsteem';
// Actions
import { addOtherAccount, updateCurrentAccount } from '../../../redux/actions/accountAction';
import { activeApplication, login, openPinCodeModal } from '../../../redux/actions/applicationActions';
// Constants
import { default as ROUTES } from '../../../constants/routeNames';
@ -13,17 +19,28 @@ class SplashContainer extends Component {
};
_getUserData = () => {
const { navigation } = this.props;
const { navigation, dispatch } = this.props;
getAuthStatus().then((res) => {
getUserData().then((response) => {
if (response) {
navigation.navigate(ROUTES.SCREENS.PINCODE);
// navigation.navigate(ROUTES.DRAWER.MAIN);
} else {
navigation.navigate(ROUTES.SCREENS.LOGIN);
}
});
if (res) {
getUserData().then((response) => {
if (response.length > 0) {
response.forEach((accountData) => {
dispatch(addOtherAccount({ username: accountData.username }));
});
getAccount(response[response.length - 1].username).then((accountData) => {
dispatch(updateCurrentAccount(...accountData));
dispatch(activeApplication());
dispatch(login());
dispatch(openPinCodeModal());
navigation.navigate(ROUTES.DRAWER.MAIN);
});
}
});
} else {
dispatch(activeApplication());
navigation.navigate(ROUTES.DRAWER.MAIN);
}
});
};
@ -32,4 +49,4 @@ class SplashContainer extends Component {
}
}
export default SplashContainer;
export default connect()(SplashContainer);

View File

@ -2,6 +2,11 @@ import React, { Component } from 'react';
import { Text } from 'react-native';
import { Container } from 'native-base';
// Components
import { Logo } from '../../../components';
import styles from './splashStyles';
class SplashScreen extends Component {
constructor(props) {
super(props);
@ -9,8 +14,10 @@ class SplashScreen extends Component {
render() {
return (
<Container>
<Text>Splash Screen</Text>
<Container style={styles.container}>
<Logo style={styles.logo} />
<Text style={styles.title}>eSteem</Text>
<Text style={styles.subTitle}>mobile</Text>
</Container>
);
}

View File

@ -0,0 +1,24 @@
import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
title: {
fontFamily: 'Sansation_Bold',
color: '$primaryDarkBlue',
fontSize: 30,
paddingBottom: 0,
},
subTitle: {
fontFamily: 'Sansation_Regular',
color: '#00519c',
fontSize: 24,
},
logo: {
width: '$deviceWidth / 4',
height: '$deviceWidth / 4',
},
});

View File

@ -6,7 +6,7 @@ import { loginWithSC2 } from '../../providers/steem/auth';
import { steemConnectOptions } from './config';
// Actions
import { addPassiveAccount } from '../../redux/actions/accountAction';
import { addOtherAccount, updateCurrentAccount } from '../../redux/actions/accountAction';
import { login as loginAction, openPinCodeModal } from '../../redux/actions/applicationActions';
// Constants
@ -37,7 +37,8 @@ class SteemConnect extends Component {
loginWithSC2(accessToken, 'pinCode')
.then((result) => {
if (result) {
dispatch(addPassiveAccount(result));
dispatch(updateCurrentAccount({ ...result }));
dispatch(addOtherAccount({ username: result.name }));
dispatch(loginAction());
dispatch(openPinCodeModal());
setPinCodeState({ accessToken, navigateTo: ROUTES.DRAWER.MAIN });