Skip to content

Commit

Permalink
Create multisig alias (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayagoumi authored Aug 21, 2023
1 parent 5964f7c commit 245b45b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
29 changes: 16 additions & 13 deletions src/components/Navbar/AliasPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mdiClose } from '@mdi/js'
import Icon from '@mdi/react'
import { Box, DialogContent, DialogTitle, Divider, Typography } from '@mui/material'
import { Box, DialogContent, DialogTitle, Divider, Typography, IconButton } from '@mui/material'
import React, { useEffect, useState } from 'react'
import store from 'wallet/store'
import { getMultisigAliases } from '../../api'
Expand Down Expand Up @@ -40,22 +40,25 @@ const AliasPicker = () => {
Switch Wallet
</MainButton>
<DialogAnimate open={open} onClose={handleCloseModal}>
<DialogTitle
sx={{
position: 'relative',
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
}}
>
<Typography variant="h4" component="h4">
<DialogTitle sx={{ m: 0, p: 2 }}>
<Typography variant="h4" component="span">
Wallet Switcher
</Typography>
<Box sx={{ cursor: 'pointer' }} onClick={handleCloseModal}>
<IconButton
aria-label="close"
onClick={handleCloseModal}
sx={{
position: 'absolute',
right: 10,
top: 15,
cursor: 'pointer',
color: theme => theme.palette.grey[500],
}}
>
<Icon path={mdiClose} size={1} />
</Box>
</IconButton>
</DialogTitle>

<Divider sx={{ borderWidth: '1.5px' }} />
<DialogContent>
<Box
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navbar/NetworkSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function NetworkSwitcher() {
</Typography>
</Box>
<Box sx={{ flexGrow: 1 }} />
{!network.readonly && (
{!network.readonly && network.url !== activeNetwork.url && (
<Box sx={{ display: 'flex', justifyContent: 'flex-end' }}>
<IconButton onClick={() => handleEditCustomNetwork()}>
<Icon path={mdiPencilOutline} size={0.8} />
Expand Down Expand Up @@ -173,7 +173,7 @@ export default function NetworkSwitcher() {
<Typography variant="subtitle1" component="span" noWrap>
{network.name}
</Typography>
{!network.readonly && (
{!network.readonly && network.url !== activeNetwork.url && (
<Box sx={{ display: 'flex', gap: 1, ml: 1 }}>
<Button
sx={{
Expand Down
6 changes: 2 additions & 4 deletions src/views/settings/Links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ function a11yProps(index: number) {
export default function Links() {
const [value, setValue] = useState(0)
const navigate = useNavigate()
const handleChange = (event: React.SyntheticEvent, newValue: number) => setValue(newValue)
const path = window.location.pathname

const handleChange = (event: React.SyntheticEvent, newValue: number) => setValue(newValue)
useEffect(() => {
if (path === '/settings') setValue(0)
else if (path === '/settings/create-multisig') setValue(1)
else setValue(0)
}, [path]) // eslint-disable-line react-hooks/exhaustive-deps

}, [path])
return (
<Box sx={{ display: 'flex', cursor: 'pointer', width: '100%', maxWidth: '1536px' }}>
<Tabs
Expand Down
2 changes: 1 addition & 1 deletion src/views/settings/MultisigWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const LoadMultisigWalletSetting = () => {
)
}

export default function MultisigWallet() {
export default function MultisigWalletSetting() {
return (
<React.Suspense fallback={<div>Loading...</div>}>
<LoadMultisigWalletSetting />
Expand Down

0 comments on commit 245b45b

Please sign in to comment.