Skip to content

Commit

Permalink
Merge pull request coingrig#6 from coingrig/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
florindumitru committed Dec 10, 2021
2 parents 521d6aa + fc3d996 commit b4d1644
Show file tree
Hide file tree
Showing 42 changed files with 2,380 additions and 655 deletions.
6 changes: 5 additions & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {Platform, StatusBar} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
// eslint-disable-next-line no-unused-vars
import AppsStateService from './src/services/appStates';
import {MenuProvider} from 'react-native-popup-menu';
import {NavigationScreens} from './src/routes';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {LoadingSheet} from './src/components/loadingSheet';
Expand All @@ -24,7 +25,10 @@ function App() {
return (
<SafeAreaProvider>
<NavigationContainer theme={CoingrigTheme}>
<NavigationScreens />
<MenuProvider>
<NavigationScreens />
</MenuProvider>

<FlashMessage position="top" />
<LoadingSheet />
</NavigationContainer>
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ android {
applicationId "com.coingrig"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 29
versionName "1.2.0"
versionCode 33
versionName "1.3.1"
missingDimensionStrategy 'react-native-camera', 'general'

}
Expand Down
8 changes: 4 additions & 4 deletions ios/Coingrig.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 33;
DEVELOPMENT_TEAM = L63HFFVTBZ;
ENABLE_BITCODE = NO;
HEADER_SEARCH_PATHS = (
Expand Down Expand Up @@ -707,7 +707,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.0;
MARKETING_VERSION = 1.3.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -731,7 +731,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 29;
CURRENT_PROJECT_VERSION = 33;
DEVELOPMENT_TEAM = L63HFFVTBZ;
"HEADER_SEARCH_PATHS[arch=*]" = (
"$(inherited)",
Expand Down Expand Up @@ -807,7 +807,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.0;
MARKETING_VERSION = 1.3.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ PODS:
- React-Core
- react-native-safe-area-context (3.3.2):
- React-Core
- react-native-splash-screen (3.2.0):
- React
- react-native-splash-screen (3.3.0):
- React-Core
- React-perflogger (0.64.2)
- React-RCTActionSheet (0.64.2):
- React-Core/RCTActionSheetHeaders (= 0.64.2)
Expand Down Expand Up @@ -666,7 +666,7 @@ SPEC CHECKSUMS:
react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846
react-native-restart: 733a51ad137f15b0f8dc34c4082e55af7da00979
react-native-safe-area-context: 584dc04881deb49474363f3be89e4ca0e854c057
react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865
react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457
React-perflogger: 25373e382fed75ce768a443822f07098a15ab737
React-RCTActionSheet: af7796ba49ffe4ca92e7277a5d992d37203f7da5
React-RCTAnimation: 6a2e76ab50c6f25b428d81b76a5a45351c4d77aa
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coingrig",
"version": "1.2.0",
"version": "1.3.1",
"private": true,
"scripts": {
"android": "npx react-native run-android",
Expand All @@ -24,7 +24,7 @@
"url": "git+https://github.com/coingrig/coingrig-wallet.git"
},
"dependencies": {
"@coingrig/core": "1.2.0",
"@coingrig/core": "1.3.1",
"@haskkor/react-native-pincode": "1.22.6",
"@rainbow-me/animated-charts": "1.0.0-alpha.5",
"@react-native-async-storage/async-storage": "1.15.7",
Expand All @@ -34,6 +34,9 @@
"@react-navigation/native": "6.0.2",
"@react-navigation/stack": "6.0.6",
"@tradle/react-native-http": "2.0.1",
"@walletconnect/client": "^1.6.6",
"@walletconnect/types": "^1.6.6",
"@walletconnect/utils": "^1.6.6",
"assert": "^2.0.0",
"asyncstorage-down": "4.2.0",
"axios": "0.21.1",
Expand Down
Binary file added src/assets/wc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 11 additions & 22 deletions src/components/Send/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function SendContainer(props: any) {
const [wallet, setWallet] = useState<any>();
const [fees, setFees] = useState<any>();
const [feeFiat, setFeeFiat] = useState<any>(0);
const [toFiat, setToFiat] = useState<string>('$0');
const [toFiat, setToFiat] = useState<any>(0);
const [keyboardEnabled, setKeyboardEnabled] = useState(false);

useEffect(() => {
Expand Down Expand Up @@ -102,7 +102,7 @@ export function SendContainer(props: any) {
return;
}
const amountToSend = formatNoComma(value.toString());
setValue(amountToSend.toString());
// setValue(amountToSend.toString());
await sleep(500);

LoadingModal.instance.current?.show();
Expand Down Expand Up @@ -146,8 +146,9 @@ export function SendContainer(props: any) {
const fiatValue = !formattedValue
? 0
: WalletStore.getWalletByCoinId(props.coin, props.chain)?.price! *
//@ts-ignore
formattedValue;
setToFiat(formatPrice(fiatValue, true));
setToFiat(fiatValue);
};

const openLink = async url => {
Expand Down Expand Up @@ -256,20 +257,19 @@ export function SendContainer(props: any) {
</View>
</View>
<View style={{justifyContent: 'space-between', flexDirection: 'row'}}>
<Text style={styles.toFiat}>{toFiat}</Text>
<Text style={styles.toFiat}>
{formatPrice(toFiat, true) || '$0'}
</Text>
</View>
</View>
</View>
<View style={styles.preparetx}>
<View
style={{
backgroundColor: Colors.darker,
borderRadius: 5,
paddingHorizontal: 20,
paddingVertical: 5,
justifyContent: 'center',
alignSelf: 'center',
marginBottom: 10,
marginBottom: 5,
}}>
<Text
style={{fontSize: 11, color: Colors.lighter, textAlign: 'center'}}>
Expand Down Expand Up @@ -300,24 +300,13 @@ export function SendContainer(props: any) {
<Text style={styles.confirmtx}>{t('tx.confirm_tx')}</Text>
<View style={styles.amountusd}>
<Text style={{marginBottom: 5}}>
{t('tx.amount_in_usd')}:{' '}
{formatPrice(
value! *
WalletStore.getWalletByCoinId(props.coin, props.chain)
?.price!,
)}
{t('tx.amount_in_usd')}: {formatPrice(toFiat, true) || '$0'}
</Text>
<Text>
{t('tx.network_fee')}: {formatPrice(feeFiat)}
{t('tx.network_fee')}: {formatPrice(feeFiat, true)}
</Text>
<Text style={styles.totalusd}>
{t('tx.total_usd')}:{' '}
{formatPrice(
value! *
WalletStore.getWalletByCoinId(props.coin, props.chain)
?.price! +
feeFiat,
)}
{t('tx.total_usd')}: {formatPrice(toFiat + feeFiat)}
</Text>
</View>
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Send/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const styles = StyleSheet.create({
container: {
justifyContent: 'space-between',
borderRadius: 10,
marginBottom: 25,
marginBottom: 5,
paddingBottom: 10,
},
toFiat: {
Expand All @@ -29,7 +29,7 @@ export const styles = StyleSheet.create({
alignSelf: 'center',
// marginRight: 15,
color: Colors.lighter,
marginTop: 5,
marginTop: 3,
textAlign: 'center',
},
cameracontainer: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/brick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Brick = observer((props: any) => {
{name}
</Text>
<Text adjustsFontSizeToFit numberOfLines={1} style={styles.dollar}>
{formatPrice(wallet?.value) || 0}
{formatPrice(wallet?.value, true) || 0}
</Text>
<Text adjustsFontSizeToFit numberOfLines={1} style={styles.coinValue}>
{formatCoins(wallet?.balance) || 0} {props.coin}
Expand Down
2 changes: 1 addition & 1 deletion src/components/smallButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const styles = StyleSheet.create({
smallBtnText: {
fontSize: 17,
color: '#353333',
fontFamily: 'RobotoSlab-Bold',
fontFamily: 'RobotoSlab-Medium',
textAlign: 'center',
},
});
145 changes: 145 additions & 0 deletions src/components/widgets/TokenPreview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
import {CoinsAvatar} from 'components/coinsAvatar';
import {formatCoins} from '../../utils';
import {Colors} from 'utils/colors';
import {CryptoService} from 'services/crypto';

const TokenPreview = props => {
const chain = CryptoService.getSupportedChainNamebyID(props.coin.chain);
return (
<View style={{height: 80, marginVertical: 4}}>
<View style={styles.container}>
<View style={styles.card}>
<View style={styles.logo}>
<CoinsAvatar
style={styles.logoimg}
coin={props.coin.symbol}
source={props.coin.image}
/>
</View>
<View style={styles.mcontainer}>
<Text
adjustsFontSizeToFit
numberOfLines={2}
style={styles.coinName}>
{props.coin.name}
</Text>
<View>
<Text style={styles.coinSymbol} numberOfLines={1}>
{chain + ' '}
{chain.length < 15 ? 'Network' : null}
</Text>
</View>
</View>
<View style={styles.rcontainer}>
<Text style={styles.balance} numberOfLines={1}>
{formatCoins(props.coin.balance) + ' ' + props.coin.symbol}
</Text>
</View>
</View>
</View>
</View>
);
};

const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
},
logoimg: {
width: 30,
height: 30,
opacity: 0.9,
justifyContent: 'center',
},
coinSymbol: {
fontSize: 12,
marginTop: 3,
color: Colors.lighter,
},
chart: {
paddingRight: 0,
paddingBottom: 20,
paddingTop: 20,
},
mcontainer: {
flexDirection: 'column',
justifyContent: 'center',
marginLeft: 10,
flex: 1.5,
// backgroundColor: 'red',
},
verticalLine: {
backgroundColor: '#EDE2C1',
width: 2,
height: 50,
position: 'absolute',
left: 0,
top: 15,
borderRadius: 10,
},
chartContainer: {
flexDirection: 'column',
justifyContent: 'center',
marginLeft: 0,
flex: 1,
},
coinName: {
fontSize: 16,
marginBottom: 0,
fontFamily: 'RobotoSlab-Bold',
color: Colors.foreground,
},
balance: {
fontSize: 13,
textAlign: 'right',
fontWeight: 'bold',
color: Colors.foreground,
marginRight: 5,
},
value: {
fontSize: 13,
textAlign: 'right',
color: Colors.lighter,
marginTop: 5,
marginRight: 5,
},
logo: {
width: 35,
height: 35,
alignSelf: 'center',
backgroundColor: Colors.background,
borderRadius: 100,
justifyContent: 'center',
alignItems: 'center',
margin: 0,
},
bgprice: {
padding: 5,
// backgroundColor: Colors.background,
justifyContent: 'center',
alignItems: 'center',
// borderRadius: 5,
},
rcontainer: {
flexDirection: 'column',
justifyContent: 'center',
paddingLeft: 5,
flex: 1,
},
card: {
flexDirection: 'row',
flex: 1,
height: 70,
borderRadius: 10,
padding: 10,
backgroundColor: Colors.card,
justifyContent: 'center',
marginHorizontal: 15,
},
});

export default React.memo(TokenPreview);
2 changes: 1 addition & 1 deletion src/config.sample.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const CONFIG = {};

process.env.TESTNET = true;
process.env.TESTNET = false;

CONFIG.APP_VERSION = '1.2.0 (29)';
CONFIG.BUILD_NUMBER = 29;
Expand Down
Loading

0 comments on commit b4d1644

Please sign in to comment.