Replace photon with alnt for laconicd network (#6)

Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675)

- Use MUI dialog component for tx error

Co-authored-by: IshaVenikar <ishavenikar7@gmail.com>
Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Reviewed-on: cerc-io/laconic-wallet-web#6
This commit is contained in:
nabarun 2024-07-30 12:18:53 +00:00
parent 7273165e2c
commit cd0f6fa5d2
7 changed files with 53 additions and 26 deletions

View File

@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@cerc-io/registry-sdk": "^0.2.4", "@cerc-io/registry-sdk": "^0.2.5",
"@cosmjs/amino": "^0.32.3", "@cosmjs/amino": "^0.32.3",
"@cosmjs/crypto": "^0.32.3", "@cosmjs/crypto": "^0.32.3",
"@cosmjs/proto-signing": "^0.32.3", "@cosmjs/proto-signing": "^0.32.3",

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Button, Dialog, Portal, Text } from 'react-native-paper'; import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from '@mui/material';
const TxErrorDialog = ({ const TxErrorDialog = ({
error, error,
@ -11,17 +11,15 @@ const TxErrorDialog = ({
hideDialog: () => void; hideDialog: () => void;
}) => { }) => {
return ( return (
<Portal> <Dialog open={visible} onClose={hideDialog}>
<Dialog visible={visible} onDismiss={hideDialog}> <DialogTitle>Transaction Error</DialogTitle>
<Dialog.Title>Transaction Error</Dialog.Title> <DialogContent>
<Dialog.Content> <Typography variant="body1">{error}</Typography>
<Text variant="bodyMedium">{error}</Text> </DialogContent>
</Dialog.Content> <DialogActions>
<Dialog.Actions> <Button onClick={hideDialog}>OK</Button>
<Button onPress={hideDialog}>OK</Button> </DialogActions>
</Dialog.Actions> </Dialog>
</Dialog>
</Portal>
); );
}; };

View File

@ -409,6 +409,7 @@ const AddNetwork = () => {
mode="contained" mode="contained"
loading={isSubmitting} loading={isSubmitting}
disabled={isSubmitting} disabled={isSubmitting}
style={styles.networksButton}
onPress={handleSubmit(submit)}> onPress={handleSubmit(submit)}>
{isSubmitting ? 'Adding' : 'Submit'} {isSubmitting ? 'Adding' : 'Submit'}
</Button> </Button>

View File

@ -187,6 +187,7 @@ const EditNetwork = ({ route }: EditNetworkProps) => {
mode="contained" mode="contained"
loading={isSubmitting} loading={isSubmitting}
disabled={isSubmitting} disabled={isSubmitting}
style={styles.networksButton}
onPress={handleSubmit(submit)}> onPress={handleSubmit(submit)}>
{isSubmitting ? 'Adding' : 'Submit'} {isSubmitting ? 'Adding' : 'Submit'}
</Button> </Button>

View File

@ -5,6 +5,7 @@ const styles = StyleSheet.create({
marginTop: 20, marginTop: 20,
width: 150, width: 150,
alignSelf: 'center', alignSelf: 'center',
marginBottom: 40
}, },
signLink: { signLink: {
alignItems: 'flex-end', alignItems: 'flex-end',
@ -42,6 +43,7 @@ const styles = StyleSheet.create({
}, },
signButton: { signButton: {
marginTop: 20, marginTop: 20,
marginBottom: 20,
width: 150, width: 150,
alignSelf: 'center', alignSelf: 'center',
}, },
@ -143,6 +145,7 @@ const styles = StyleSheet.create({
buttonContainer: { buttonContainer: {
flexDirection: 'row', flexDirection: 'row',
marginLeft: 20, marginLeft: 20,
marginTop: 10,
marginBottom: 10, marginBottom: 10,
justifyContent: 'space-evenly', justifyContent: 'space-evenly',
}, },
@ -204,9 +207,9 @@ const styles = StyleSheet.create({
}, },
subHeading: { subHeading: {
textAlign: 'center', textAlign: 'center',
fontWeight: 'bold',
marginBottom: 10, marginBottom: 10,
marginTop: 10, marginTop: 10,
fontSize: 20
}, },
centerText: { centerText: {
textAlign: 'center', textAlign: 'center',
@ -253,12 +256,30 @@ const styles = StyleSheet.create({
balancePadding: { balancePadding: {
padding: 8, padding: 8,
}, },
noActiveSessions: { display: 'flex', alignItems: 'center', marginTop: 12 }, noActiveSessions: {
disconnectSession: { display: 'flex', justifyContent: 'center' }, display: 'flex',
sessionItem: { paddingLeft: 12, borderBottomWidth: 0.5 }, alignItems: 'center',
sessionsContainer: { paddingLeft: 12, borderBottomWidth: 0.5 }, marginTop: 20,
marginBottom: 20,
},
disconnectSession: {
display: 'flex',
justifyContent: 'center',
},
sessionItem: {
paddingLeft: 12,
borderBottomWidth: 0.5,
},
sessionsContainer: {
paddingLeft: 12,
borderBottomWidth: 0.5,
},
walletConnectUriText: { padding: 10 }, walletConnectUriText: { padding: 10 },
walletConnectLogo: { width: 24, height: 15, margin: 0 }, walletConnectLogo: {
width: 24,
height: 15,
margin: 0,
},
selectNetworkText: { selectNetworkText: {
fontWeight: 'bold', fontWeight: 'bold',
marginVertical: 10, marginVertical: 10,
@ -275,7 +296,11 @@ const styles = StyleSheet.create({
padding: 8, padding: 8,
}, },
linkContainer: { linkContainer: {
paddingBottom: 72 paddingBottom: 72,
},
networksButton: {
marginTop: 12,
marginBottom: 20,
} }
}); });

View File

@ -10,10 +10,10 @@ export const DEFAULT_NETWORKS = [
namespace: COSMOS, namespace: COSMOS,
rpcUrl: process.env.REACT_APP_LACONICD_RPC_URL!, rpcUrl: process.env.REACT_APP_LACONICD_RPC_URL!,
blockExplorerUrl: '', blockExplorerUrl: '',
nativeDenom: 'photon', nativeDenom: 'alnt',
addressPrefix: 'laconic', addressPrefix: 'laconic',
coinType: '118', coinType: '118',
gasPrice: '0.01', gasPrice: '1',
isDefault: true, isDefault: true,
}, },
{ {

View File

@ -1263,10 +1263,10 @@
deepmerge "^3.2.0" deepmerge "^3.2.0"
hoist-non-react-statics "^3.3.0" hoist-non-react-statics "^3.3.0"
"@cerc-io/registry-sdk@^0.2.4": "@cerc-io/registry-sdk@^0.2.5":
version "0.2.4" version "0.2.5"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.4/registry-sdk-0.2.4.tgz#60e4e75b1e6a957cf2b97490af4fda4af07b105f" resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.5/registry-sdk-0.2.5.tgz#9ca19fecb2923520dd6a19946c309ecb2ec780a2"
integrity sha512-hRZJP+s+uBvfrqtmQ38pmf74SyfFDC65AVwvWigJGxc6uKJG4jyuMyhsoD1P4XkjwAQSnFO89TuDC5JGkdXyrA== integrity sha512-/KXAYf9gStaX/rRBMCEeDCexEIpTOFHeHzMK9B3xfCT+SyYZE9WC9GpX299LzBYJKKPsb0/JvnDfip9S1igJtA==
dependencies: dependencies:
"@cosmjs/amino" "^0.28.1" "@cosmjs/amino" "^0.28.1"
"@cosmjs/crypto" "^0.28.1" "@cosmjs/crypto" "^0.28.1"
@ -13626,6 +13626,8 @@ tr46@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==
dependencies:
punycode "^2.1.0"
tr46@^2.1.0: tr46@^2.1.0:
version "2.1.0" version "2.1.0"