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",
"private": true,
"dependencies": {
"@cerc-io/registry-sdk": "^0.2.4",
"@cerc-io/registry-sdk": "^0.2.5",
"@cosmjs/amino": "^0.32.3",
"@cosmjs/crypto": "^0.32.3",
"@cosmjs/proto-signing": "^0.32.3",

View File

@ -1,5 +1,5 @@
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 = ({
error,
@ -11,17 +11,15 @@ const TxErrorDialog = ({
hideDialog: () => void;
}) => {
return (
<Portal>
<Dialog visible={visible} onDismiss={hideDialog}>
<Dialog.Title>Transaction Error</Dialog.Title>
<Dialog.Content>
<Text variant="bodyMedium">{error}</Text>
</Dialog.Content>
<Dialog.Actions>
<Button onPress={hideDialog}>OK</Button>
</Dialog.Actions>
<Dialog open={visible} onClose={hideDialog}>
<DialogTitle>Transaction Error</DialogTitle>
<DialogContent>
<Typography variant="body1">{error}</Typography>
</DialogContent>
<DialogActions>
<Button onClick={hideDialog}>OK</Button>
</DialogActions>
</Dialog>
</Portal>
);
};

View File

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

View File

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

View File

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

View File

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

View File

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