Skip to content

Commit

Permalink
Merge pull request #207 from ostdotcom/post-eth-cc-fixes
Browse files Browse the repository at this point in the history
Post eth cc fixes into master
  • Loading branch information
sunilkhedar authored Mar 13, 2020
2 parents c5145e4 + 8c6b400 commit 2ee2f41
Show file tree
Hide file tree
Showing 19 changed files with 149 additions and 75 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ android {
applicationId "com.pepo.v2.production"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 31
versionName "1.0.4"
versionCode 32
versionName "1.0.5"
missingDimensionStrategy 'react-native-camera', 'general'
manifestPlaceholders = [
appAuthRedirectScheme: 'com.pepo.v2.production'
Expand Down
8 changes: 4 additions & 4 deletions ios/Pepo2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Pepo2/Pepo2.entitlements;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 30;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = N83K86W6P4;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -628,7 +628,7 @@
INFOPLIST_FILE = Pepo2/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.4;
MARKETING_VERSION = 1.0.5;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -649,7 +649,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Pepo2/Pepo2.entitlements;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 30;
DEVELOPMENT_TEAM = N83K86W6P4;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -659,7 +659,7 @@
INFOPLIST_FILE = Pepo2/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.4;
MARKETING_VERSION = 1.0.5;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
4 changes: 2 additions & 2 deletions ios/Pepo2/InfoPlist/com.pepo.staging-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.4</string>
<string>1.0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>29</string>
<string>30</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/Pepo2/InfoPlist/com.pepo.v2.production-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.4</string>
<string>1.0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>29</string>
<string>30</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/Pepo2/InfoPlist/com.pepo.v2.sandbox-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.4</string>
<string>1.0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>29</string>
<string>30</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
Binary file removed src/assets/StorePink.png
Binary file not shown.
Binary file added src/assets/balanace-header-store.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion src/components/CommonComponents/UserInfo/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Colors from '../../../theme/styles/Colors';
import { Dimensions } from 'react-native';
import {fontFamWeight} from "../../../theme/constants";

const isSmallPhone = Dimensions.get('window').width <= 360;

let stylesMap = {
infoHeaderWrapper: {
justifyContent: 'space-between',
Expand All @@ -18,9 +20,19 @@ let stylesMap = {
shadowOffset: {width: 0, height: 0},
elevation: 5,
paddingVertical: 8,
paddingHorizontal: 15,
paddingHorizontal: isSmallPhone ? 8 : 15,
marginBottom: 20
},
balanceHeaderIcons: {
width: 48,
height: 48
},
dividerLine:{
width: 1,
height: 20,
marginTop: 16.5,
marginHorizontal: isSmallPhone ? 5 : 8
},
userProfileImageSkipFont: {
height: 100,
width: 100,
Expand Down
13 changes: 0 additions & 13 deletions src/components/CustomDrawerContent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import helpIcon from '../../assets/settings-support.png';
import about from '../../assets/settings-about.png';
import privacy from '../../assets/settings-privacy.png';
import tac from '../../assets/settings-terms-and-conditions.png';
import storePink from '../../assets/StorePink.png';
import Toast from '../../theme/components/NotificationToast';
import multipleClickHandler from '../../services/MultipleClickHandler';
import OstWalletSdkHelper from '../../helpers/OstWalletSdkHelper';
Expand Down Expand Up @@ -240,18 +239,6 @@ class CustomDrawerContent extends Component {

<View style={{paddingBottom: 80}}>

<TouchableOpacity
onPress={multipleClickHandler(() => {
this.onPepocornsClick();
})}
disabled={this.state.disableButtons}
{...testProps('side-toggle-drawer-pepo-store')}
>
<View style={styles.itemParent}>
<Image style={{ height: 27, width: 27, resizeMode: 'contain' }} source={storePink} />
<Text style={styles.item}>Pepo.com Store</Text>
</View>
</TouchableOpacity>

<TouchableOpacity
onPress={multipleClickHandler(() => {
Expand Down
43 changes: 21 additions & 22 deletions src/components/LoginPopover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import profilePicture from "../../assets/default_user_icon.png";
import WebLogins from '../../services/WebLogins';
import { analyticsSetCurrentScreen } from '../../helpers/helpers';
import {globalEvents, globalEventsMap} from "../../helpers/GlobalEvents";
import debounce from "lodash/debounce";

import {testProps} from "../../constants/AppiumAutomation";

Expand All @@ -29,7 +28,7 @@ const btnPostText = 'Connecting...';
const versionIOS = DeviceInfo.getSystemVersion();
const finalVersionIOS = parseFloat( versionIOS ) <= 13;

let sequenceOfLoginServices = [serviceTypes.twitter, serviceTypes.google, serviceTypes.github ] ;
let sequenceOfLoginServices = [serviceTypes.twitter, serviceTypes.google ] ; // Initially also had: serviceTypes.github
if( Platform.OS == 'ios' && !finalVersionIOS ){
sequenceOfLoginServices.splice(1, 0, serviceTypes.apple);
}
Expand All @@ -43,7 +42,7 @@ class loginPopover extends React.Component {
showAllOptions : !this.isLastLoginUser(),
currentConnecting: ''
};
this.resetBtnTimeOut = 0
this.resetBtnTimeOut = 0;
this.setLoginServicesConfig();
}

Expand All @@ -62,7 +61,7 @@ class loginPopover extends React.Component {
this.resetBtnTimeOut = setTimeout(()=> {
this.setState({disableLoginBtn : false, currentConnecting: ""});
} , 100)
}
};

setLoginServicesConfig = () => {
this.loginServicesConfig = {
Expand Down Expand Up @@ -93,43 +92,43 @@ class loginPopover extends React.Component {
connectingHeader: btnPostText,
testIdName: 'continue-with-google'
},
[serviceTypes.github]: {
header: 'Continue with GitHub',
pressHandler: this.githubPressHandler,
icon: LastLoginedUser.getOAuthIcon(serviceTypes.github),
width: 19,
height: 18.5,
connectingHeader: btnPostText,
testIdName: 'continue-with-github'
},
// [serviceTypes.github]: {
// header: 'Continue with GitHub',
// pressHandler: this.githubPressHandler,
// icon: LastLoginedUser.getOAuthIcon(serviceTypes.github),
// width: 19,
// height: 18.5,
// connectingHeader: btnPostText,
// testIdName: 'continue-with-github'
// },
};
};


beforeOAuthInvoke = (service ) => {
analyticsSetCurrentScreen( service );
this.setState({disableLoginBtn : true , currentConnecting: AppConfig.authServiceTypes[service] })
}
};

gmailPressHandler = () => {
this.beforeOAuthInvoke(AppConfig.authServiceTypes.google);
GoogleOAuth.signIn();
}
};

githubPressHandler = () => {
this.beforeOAuthInvoke(AppConfig.authServiceTypes.github);
WebLogins.openGitHubWebLogin();
}
};

twitterPressHandler = () => {
this.beforeOAuthInvoke(AppConfig.authServiceTypes.twitter);
WebLogins.openTwitterWebLogin();
}
};

applePressHandler = () => {
this.beforeOAuthInvoke(AppConfig.authServiceTypes.apple);
AppleOAuth.signIn();
}
};

//Use this function if needed to handle hardware back handling for android.
closeModal = () => {
Expand Down Expand Up @@ -193,7 +192,7 @@ class loginPopover extends React.Component {

onMoreOptionClick = () => {
this.setState({showAllOptions : true});
}
};

getProfileImageMarkup(){
const profilePic = LastLoginedUser.getProfileImage();
Expand All @@ -208,7 +207,7 @@ class loginPopover extends React.Component {

signInViaLastLoginService = () => {
const serviceConfig = this.loginServicesConfig[LastLoginedUser.getLastLoginServiceType()];
if(serviceConfig.pressHandler){
if(serviceConfig && serviceConfig.pressHandler){
serviceConfig.pressHandler.apply(this);
return;
}
Expand All @@ -217,9 +216,9 @@ class loginPopover extends React.Component {
* This should never happen. But just incase if it dose user can still login.
* The app wont be blocking for it.
*/
console.warn("AS services was found but pressHandler was unavaialable in serviceConfig LoginPopover.");
console.warn("AS services / pressHandler was unavaialable in serviceConfig LoginPopover.");
this.setState({showAllOptions: true});
}
};

render() {
return (
Expand Down
45 changes: 34 additions & 11 deletions src/components/Profile/BalanceHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import {connect} from 'react-redux';
import { View, TouchableWithoutFeedback, TouchableOpacity } from 'react-native';
import { Text, Image } from 'react-native';
import pricer from '../../services/Pricer';
import inlineStyles from './styles';
import inlineProfileStyles from './styles';
import selfAmountWallet from '../../assets/pepo-amount-wallet.png';
import topUpIcon from '../../assets/top-up-icon.png'
import inlineStyle from "../CommonComponents/UserInfo/styles";
import topUpIcon from '../../assets/top-up-icon.png';
import storeIcon from '../../assets/balanace-header-store.png'
import inlineUserStyles from "../CommonComponents/UserInfo/styles";
import LinearGradient from "react-native-linear-gradient";
import { withNavigation } from 'react-navigation';
import CurrentUser from '../../models/CurrentUser';
Expand All @@ -24,6 +25,9 @@ import MultipleClickHandler from '../../services/MultipleClickHandler';
import { OstWalletSdk } from '@ostdotcom/ost-wallet-sdk-react-native';
import pepoCornsImg from '../../assets/UnicornSmall.png';
import {testProps} from "../../constants/AppiumAutomation";
import Utilities from "../../services/Utilities";

import multipleClickHandler from '../../services/MultipleClickHandler';

const mapStateToProps = (state) => ({ balance: state.balance });

Expand Down Expand Up @@ -126,36 +130,55 @@ class BalanceHeader extends PureComponent {
}
}

onStoreClick = () => {
Utilities.openRedemptionWebView();
}

render() {
return (
<View style={inlineStyle.infoHeaderWrapper}>
<View style={inlineUserStyles.infoHeaderWrapper}>
<View style={{flexDirection: 'row'}}>
<TouchableOpacity onPress={this.onTopUp}>
<View style={{alignItems: 'center'}}>
<Image style={{ width: 50, height: 50 }} source={topUpIcon}></Image>
<Text style={inlineStyles.redeemBalance}>Top Up</Text>
<Image style={inlineUserStyles.balanceHeaderIcons} source={topUpIcon}></Image>
<Text style={inlineProfileStyles.redeemBalance}>Top Up</Text>
</View>
</TouchableOpacity>
<LinearGradient
colors={['#dadfdc', '#dadfdc']}
locations={[0, 1]}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 0 }}
style={{height: 20, width: 1, marginHorizontal: 8, marginTop: 16.5}}
style={inlineUserStyles.dividerLine}
></LinearGradient>
<TouchableOpacity onPress={MultipleClickHandler(() => this.onRedemptionClick())} >
<View style={{alignItems: 'center'}}>
<Image style={{ width: 50, height: 50 }} source={pepoCornsImg}></Image>
<Text style={inlineStyles.redeemBalance}>{AppConfig.redemption.pepoCornsName}</Text>
<Image style={inlineUserStyles.balanceHeaderIcons} source={pepoCornsImg}></Image>
<Text style={inlineProfileStyles.redeemBalance}>{AppConfig.redemption.pepoCornsName}</Text>
</View>
</TouchableOpacity>
<LinearGradient
colors={['#dadfdc', '#dadfdc']}
locations={[0, 1]}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 0 }}
style={inlineUserStyles.dividerLine}
></LinearGradient>
<TouchableOpacity onPress={multipleClickHandler(() => {
this.onStoreClick();
})} >
<View style={{alignItems: 'center'}}>
<Image style={inlineUserStyles.balanceHeaderIcons} source={storeIcon}></Image>
<Text style={inlineProfileStyles.redeemBalance}>Store</Text>
</View>
</TouchableOpacity>
</View>
<View style={{alignItems: 'flex-end'}}>
<View style={{flexDirection: "row", alignItems: 'center'}}>
{this.getWalletIcon()}
<Text style={inlineStyles.pepoBalance} {...testProps('balance-header-pepo-amount')}>{' '}{this.toBt(this.props.balance) || 0.00}</Text>
<Text style={inlineProfileStyles.pepoBalance} {...testProps('balance-header-pepo-amount')}>{' '}{this.toBt(this.props.balance) || 0.00}</Text>
</View>
<Text style={inlineStyles.usdBalance} {...testProps('balance-header-usd-amount')}>${' '}{this.toFiat( this.props.balance ) || 0.00} </Text>
<Text style={inlineProfileStyles.usdBalance} {...testProps('balance-header-usd-amount')}>${' '}{this.toFiat( this.props.balance ) || 0.00} </Text>
</View>
</View>
);
Expand Down
Loading

0 comments on commit 2ee2f41

Please sign in to comment.