diff --git a/.gitignore b/.gitignore index dafa7b700..556f173c4 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,5 @@ config.js keystore/ .env package-lock.json +my-release-key.keystore +gradle.properties diff --git a/android/app/src/main/java/app/esteem/mobile/MainApplication.java b/android/app/src/main/java/app/esteem/mobile/MainApplication.java index 90dcd919b..d901ca39b 100644 --- a/android/app/src/main/java/app/esteem/mobile/MainApplication.java +++ b/android/app/src/main/java/app/esteem/mobile/MainApplication.java @@ -19,6 +19,7 @@ import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; +import com.facebook.react.BuildConfig; import java.util.Arrays; import java.util.List; diff --git a/android/app/src/main/java/com/esteem/MainActivity.java b/android/app/src/main/java/com/esteem/MainActivity.java deleted file mode 100644 index 538b41cdd..000000000 --- a/android/app/src/main/java/com/esteem/MainActivity.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.esteem; - -import com.facebook.react.ReactActivity; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. - * This is used to schedule rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "eSteem"; - } -} diff --git a/android/app/src/main/java/com/esteem/MainApplication.java b/android/app/src/main/java/com/esteem/MainApplication.java deleted file mode 100644 index dc130a285..000000000 --- a/android/app/src/main/java/com/esteem/MainApplication.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.esteem; - -import android.app.Application; - -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.shell.MainReactPackage; -import com.facebook.soloader.SoLoader; - -import java.util.Arrays; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage() - ); - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - } -} diff --git a/appcenter-post-build.sh b/appcenter-post-build.sh new file mode 100644 index 000000000..536fb839f --- /dev/null +++ b/appcenter-post-build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +printf "Post-Build.sh\n" diff --git a/appcenter-pre-build.sh b/appcenter-pre-build.sh index c96fd0b9b..db0e02ff6 100644 --- a/appcenter-pre-build.sh +++ b/appcenter-pre-build.sh @@ -1,8 +1,12 @@ #!/usr/bin/env bash # Creates an .env from ENV variables for use with react-native-config -ENV_WHITELIST=${ENV_WHITELIST:-"."} +printf "Old .env file:\n" +cat .env +printf "Started script:\n" +ENV_WHITELIST=${ENV_WHITELIST:-"/ACTIVITY|WEBSOCKET|BACKEND|API|TOKEN|URL/"} printf "Creating an .env file with the following whitelist:\n" printf "%s\n\n" $ENV_WHITELIST -set | egrep -e $ENV_WHITELIST | egrep -v "^_" | egrep -v "WHITELIST" > .env +set | egrep -e $ENV_WHITELIST | egrep -v "^_" | egrep -v "WHITELIST" | egrep -v "USER-DEFINED" > .env printf "\n.env created with contents:\n" -cat .env \ No newline at end of file +cat .env +printf "\nEND OF .env\n" \ No newline at end of file diff --git a/ios/eSteem.xcworkspace/xcuserdata/m.xcuserdatad/UserInterfaceState.xcuserstate b/ios/eSteem.xcworkspace/xcuserdata/m.xcuserdatad/UserInterfaceState.xcuserstate index cece3c959..908ec09f6 100644 Binary files a/ios/eSteem.xcworkspace/xcuserdata/m.xcuserdatad/UserInterfaceState.xcuserstate and b/ios/eSteem.xcworkspace/xcuserdata/m.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/src/components/comments/view/commentsView.js b/src/components/comments/view/commentsView.js index fc934cbf3..963198a51 100644 --- a/src/components/comments/view/commentsView.js +++ b/src/components/comments/view/commentsView.js @@ -36,7 +36,6 @@ class CommentsView extends Component { avatarSize, marginLeft, handleOnUserPress, - currentUser, commentNumber, handleOnReplyPress, isProfilePreview, diff --git a/src/components/commentsDisplay/view/commentsDisplayView.js b/src/components/commentsDisplay/view/commentsDisplayView.js index 1ee81895c..6fbb8088b 100644 --- a/src/components/commentsDisplay/view/commentsDisplayView.js +++ b/src/components/commentsDisplay/view/commentsDisplayView.js @@ -29,9 +29,7 @@ class CommentsDisplayView extends Component { }; render() { - const { - currentUser, author, permlink, commentCount, - } = this.props; + const { author, permlink, commentCount } = this.props; return ( @@ -44,7 +42,7 @@ class CommentsDisplayView extends Component { onDropdownSelect={this._handleOnDropdownSelect} /> - + )} diff --git a/src/components/header/container/headerContainer.js b/src/components/header/container/headerContainer.js index fa3d838e2..f65b7c294 100644 --- a/src/components/header/container/headerContainer.js +++ b/src/components/header/container/headerContainer.js @@ -9,10 +9,13 @@ import { connect } from 'react-redux'; // Constants // Utilities +import { getReputation } from '../../../utils/user'; // Component import { HeaderView } from '..'; +const DEFAULT_IMAGE = require('../../../assets/avatar_default.png'); + /* * Props Name Description Value *@props --> props name here description here Value Type Here @@ -42,14 +45,37 @@ class HeaderContainer extends Component { }; render() { - const { isLoggedIn, currentUser, user } = this.props; + const { + isLoggedIn, currentAccount, selectedUser, isReverse, isLoginDone, + } = this.props; + let avatar; + let displayName; + let userName; + let reputation; + + if (isReverse && selectedUser) { + avatar = selectedUser.avatar ? { uri: selectedUser.avatar } : DEFAULT_IMAGE; + displayName = selectedUser.display_name; + userName = selectedUser.name; + reputation = getReputation(selectedUser.reputation); + } else if (!isReverse) { + avatar = currentAccount.avatar ? { uri: currentAccount.avatar } : DEFAULT_IMAGE; + displayName = currentAccount.display_name; + userName = currentAccount.name; + reputation = getReputation(currentAccount.reputation); + } + return ( ); } @@ -57,7 +83,9 @@ class HeaderContainer extends Component { const mapStateToProps = state => ({ isLoggedIn: state.application.isLoggedIn, - currentUser: state.account.currentAccount, + isLoginDone: state.application.isLoginDone, + + currentAccount: state.account.currentAccount, }); export default connect(mapStateToProps)(withNavigation(HeaderContainer)); diff --git a/src/components/header/view/headerView.js b/src/components/header/view/headerView.js index fa1c3e9c1..380d49f15 100644 --- a/src/components/header/view/headerView.js +++ b/src/components/header/view/headerView.js @@ -1,14 +1,10 @@ import React, { Component } from 'react'; import { - View, StatusBar, Text, SafeAreaView, TouchableOpacity, + View, StatusBar, Text, SafeAreaView, TouchableOpacity, Image, } from 'react-native'; -import FastImage from 'react-native-fast-image'; import LinearGradient from 'react-native-linear-gradient'; import { injectIntl } from 'react-intl'; -// Utils -import { getReputation } from '../../../utils/user'; - // Components import { SearchModal } from '../../searchModal'; import { IconButton } from '../../iconButton'; @@ -42,18 +38,20 @@ class HeaderView extends Component { render() { const { - handleOpenDrawer, + avatar, + displayName, handleOnPressBackButton, + handleOpenDrawer, hideStatusBar, - isReverse, - currentAccount, intl, + isLoggedIn, + isLoginDone, + isReverse, + reputation, + userName, } = this.props; const { isSearchModalOpen } = this.state; - const _reputation = getReputation(currentAccount.reputation); - const _avatar = currentAccount.profile_image - ? { uri: currentAccount.profile_image } - : DEFAULT_IMAGE; + return ( {/*