Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/1194 leos asset manager #1270

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"@types/react-test-renderer": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"argon2": "^0.40.3",
"argon2": "^0.41.1",
"babel-plugin-module-resolver": "^5.0.2",
"babel-plugin-rewrite-require": "^1.14.5",
"babel-plugin-transform-builtin-extend": "^1.1.2",
Expand All @@ -136,8 +136,7 @@
},
"resolutions": {
"jsonld": "link:./node_modules/@digitalcredentials/jsonld",
"isomorphic-webcrypto": "link:./node_modules/@sphereon/isomorphic-webcrypto",
"@tonomy/tonomy-id-sdk": "portal:/home/sadia/TonomyFoundation/Tonomy-ID-Integration/Tonomy-ID-SDK"
"isomorphic-webcrypto": "link:./node_modules/@sphereon/isomorphic-webcrypto"
},
"private": true,
"packageManager": "yarn@4.3.1",
Expand Down
181 changes: 181 additions & 0 deletions src/containers/LeosAssetContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
import { StyleSheet, Text, View, TouchableOpacity, ImageBackground } from 'react-native';
import { Props } from '../screens/LeosAssetScreen';
import theme, { commonStyles } from '../utils/theme';
import { ArrowDown, ArrowUp, Clock, ArrowRight } from 'iconoir-react-native';

export type LeosAssetProps = {
navigation: Props['navigation'];
};

const LeosAssetContainer = ({ navigation }: LeosAssetProps) => {
return (
<View style={styles.container}>
<Text style={styles.subTitle}>Total assets</Text>
<ImageBackground
source={require('../assets/images/vesting/bg1.png')}
style={styles.imageBackground}
imageStyle={{ borderRadius: 10 }}
resizeMode="cover"
>
<Text style={styles.imageNetworkText}>Pangea Network</Text>
<Text style={styles.imageText}>69,023.35 LEOS</Text>
<Text style={styles.imageUsdText}>= $3273.1</Text>
</ImageBackground>
<Text style={styles.subTitle}>Available assets</Text>

<View style={styles.availableAssetView}>
<View style={styles.header}>
<Text style={styles.headerAssetsAmount}>{`69,023.35 LEOS`}</Text>
<Text style={styles.headerUSDAmount}>{`= $3273.1`}</Text>

<View style={styles.sendReceiveButtons}>
<TouchableOpacity style={styles.flexCenter}>
<View style={styles.headerButton}>
<ArrowUp height={18} width={18} color={theme.colors.black} strokeWidth={2} />
</View>
<Text style={styles.textSize}>Send</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.flexCenter}>
<View style={styles.headerButton}>
<ArrowDown height={18} width={18} color={theme.colors.black} strokeWidth={2} />
</View>
<Text style={styles.textSize}>Receive</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.flexCenter}>
<View style={styles.headerButton}>
<Clock height={18} width={18} color={theme.colors.black} strokeWidth={2} />
</View>
<Text style={styles.textSize}>History</Text>
</TouchableOpacity>
</View>
</View>
</View>

<Text style={styles.subTitle}>More</Text>
<View style={styles.moreView}>
<Text style={{ fontWeight: '600' }}>Vested assets</Text>
<View style={styles.flexColEnd}>
<ArrowRight height={18} width={18} color={theme.colors.grey2} strokeWidth={2} />
</View>
</View>
<View style={styles.moreView}>
<Text style={{ fontWeight: '600' }}>Staking</Text>
<View style={styles.flexColEnd}>
<ArrowRight height={18} width={18} color={theme.colors.grey2} strokeWidth={2} />
</View>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
marginHorizontal: 15,
},

textContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
text: {
fontSize: 22,
color: 'black',
fontWeight: 'bold',
textAlign: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.5)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reuse or define color in theme.colors?

padding: 35,
borderRadius: 10,
},
header: {
flexDirection: 'column',
alignItems: 'center',
},
headerAssetsAmount: {
fontSize: 22,
fontWeight: '500',
...commonStyles.secondaryFontFamily,
},
headerUSDAmount: {
fontSize: 15,
fontWeight: '400',
color: theme.colors.grey9,
},
headerButton: {
backgroundColor: theme.colors.backgroundGray,
width: 35,
height: 35,
alignItems: 'center',
justifyContent: 'center',
borderRadius: 30,
},
sendReceiveButtons: {
flexDirection: 'row',
gap: 30,
marginTop: 10,
},
flexCenter: {
justifyContent: 'center',
alignItems: 'center',
gap: 5,
},
textSize: {
fontSize: 12,
fontWeight: '500',
...commonStyles.secondaryFontFamily,
},
availableAssetView: {
alignItems: 'center',
borderWidth: 1,
borderColor: theme.colors.grey8,
borderRadius: 8,
padding: 20,
},
subTitle: {
marginTop: 15,
marginBottom: 5,
fontSize: 16,
...commonStyles.primaryFontFamily,
},
moreView: {
borderWidth: 1,
borderColor: theme.colors.grey8,
borderRadius: 8,
paddingHorizontal: 13,
paddingVertical: 18,
flexDirection: 'row',
justifyContent: 'space-between',
marginBottom: 10,
},
flexColEnd: {
flexDirection: 'column',
alignItems: 'flex-end',
},
imageBackground: {
width: '100%',
height: 170,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 20,
},
imageText: {
color: theme.colors.white,
fontSize: 24,
fontWeight: 'bold',
},
imageUsdText: {
color: theme.colors.white,
fontSize: 15,
fontWeight: '500',
},
imageNetworkText: {
color: theme.colors.white,
fontSize: 12,
backgroundColor: 'rgba(0, 0, 0, 0.6)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reuse or define color in theme.colors?

padding: 4,
borderRadius: 5,
},
});

export default LeosAssetContainer;
10 changes: 10 additions & 0 deletions src/screens/LeosAssetScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import LeosAssetContainer from '../containers/LeosAssetContainer';
import { NativeStackScreenProps } from '@react-navigation/native-stack';
import { RouteStackParamList } from '../navigation/Root';

export type Props = NativeStackScreenProps<RouteStackParamList, 'LeosAssetManager'>;

Check failure on line 6 in src/screens/LeosAssetScreen.tsx

View workflow job for this annotation

GitHub Actions / build

Type '"LeosAssetManager"' does not satisfy the constraint '"SignTransaction" | "WalletConnectLogin" | "Home" | "Splash" | "CreateAccountUsername" | "CreateAccountPassword" | "CreatePassphrase" | "Hcaptcha" | "LoginUsername" | "LoginPassphrase" | ... 24 more ... | "ScanQR"'.

export default function LeosAssetScreen(props: Props) {
return <LeosAssetContainer navigation={props.navigation}></LeosAssetContainer>;
}
43 changes: 38 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4684,9 +4684,9 @@ __metadata:
languageName: node
linkType: hard

"@tonomy/tonomy-id-sdk@portal:/home/sadia/TonomyFoundation/Tonomy-ID-Integration/Tonomy-ID-SDK::locator=tonomy-id%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@tonomy/tonomy-id-sdk@portal:/home/sadia/TonomyFoundation/Tonomy-ID-Integration/Tonomy-ID-SDK::locator=tonomy-id%40workspace%3A."
"@tonomy/tonomy-id-sdk@npm:0.26.0-development.1":
version: 0.26.0-development.1
resolution: "@tonomy/tonomy-id-sdk@npm:0.26.0-development.1"
dependencies:
"@consento/sync-randombytes": "npm:^1.0.5"
"@tonomy/antelope-did-resolver": "npm:^0.10.0"
Expand All @@ -4713,8 +4713,9 @@ __metadata:
typeorm: "npm:^0.3.20"
universal-base64url: "npm:^1.1.0"
web-did-resolver: "npm:^2.0.27"
checksum: 10c0/cd733745d121015cbb092fd70a7723fade1c17792667bbb42a1fc38aecfbf09e32c552c53942baacf3bcd1ad606ed1df2125d4894e0319c6cf585f2e46d9d22d
languageName: node
linkType: soft
linkType: hard

"@tootallnate/once@npm:1":
version: 1.1.2
Expand Down Expand Up @@ -6452,6 +6453,18 @@ __metadata:
languageName: node
linkType: hard

"argon2@npm:^0.41.1":
version: 0.41.1
resolution: "argon2@npm:0.41.1"
dependencies:
"@phc/format": "npm:^1.0.0"
node-addon-api: "npm:^8.1.0"
node-gyp: "npm:latest"
node-gyp-build: "npm:^4.8.1"
checksum: 10c0/69f8f7e00f3d487a2cd7b3151fee6f5feb13e627e8f0551bac18f5d2dba50b1a521245d9c55140b80d7bfde1416bace520277627eb2d57c9e71403af4a4977d7
languageName: node
linkType: hard

"argparse@npm:^1.0.7":
version: 1.0.10
resolution: "argparse@npm:1.0.10"
Expand Down Expand Up @@ -15138,6 +15151,15 @@ __metadata:
languageName: node
linkType: hard

"node-addon-api@npm:^8.1.0":
version: 8.3.0
resolution: "node-addon-api@npm:8.3.0"
dependencies:
node-gyp: "npm:latest"
checksum: 10c0/0ed4206cb68921b33fc637c6f7ffcb91fcde85aea88ea60fadb7b0537bf177226a5600584eac9db2aff93600041d42796fb20576b3299b9be6ff7539592b2180
languageName: node
linkType: hard

"node-dir@npm:^0.1.17":
version: 0.1.17
resolution: "node-dir@npm:0.1.17"
Expand Down Expand Up @@ -15208,6 +15230,17 @@ __metadata:
languageName: node
linkType: hard

"node-gyp-build@npm:^4.8.1":
version: 4.8.4
resolution: "node-gyp-build@npm:4.8.4"
bin:
node-gyp-build: bin.js
node-gyp-build-optional: optional.js
node-gyp-build-test: build-test.js
checksum: 10c0/444e189907ece2081fe60e75368784f7782cfddb554b60123743dfb89509df89f1f29c03bbfa16b3a3e0be3f48799a4783f487da6203245fa5bed239ba7407e1
languageName: node
linkType: hard

"node-gyp@npm:8.x":
version: 8.4.1
resolution: "node-gyp@npm:8.4.1"
Expand Down Expand Up @@ -19441,7 +19474,7 @@ __metadata:
"@wharfkit/session": "npm:^1.4.0"
"@wharfkit/signing-request": "npm:^3.2.0"
"@wharfkit/wallet-plugin-privatekey": "npm:^1.1.0"
argon2: "npm:^0.40.3"
argon2: "npm:^0.41.1"
babel-plugin-module-resolver: "npm:^5.0.2"
babel-plugin-rewrite-require: "npm:^1.14.5"
babel-plugin-transform-builtin-extend: "npm:^1.1.2"
Expand Down
Loading