-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjust navbar and settings menu (#173)
- Loading branch information
Showing
11 changed files
with
283 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Typography } from '@mui/material' | ||
import React from 'react' | ||
import { displayFirstPartLongString, displaySecondPartLongString } from '../utils/display-utils' | ||
const LongString = ({ value }) => { | ||
const content = | ||
value && value.length < 12 ? ( | ||
<Typography>{value}</Typography> | ||
) : ( | ||
<Typography> | ||
{displayFirstPartLongString(value)}… | ||
{displaySecondPartLongString(value)} | ||
</Typography> | ||
) | ||
return <>{content}</> | ||
} | ||
export default LongString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { mdiWalletOutline } from '@mdi/js' | ||
import Icon from '@mdi/react' | ||
import React, { useEffect, useState } from 'react' | ||
import { | ||
getNameOfMultiSigWallet, | ||
getPchainAddress, | ||
isMultiSigWallet, | ||
} from '../../helpers/walletStore' | ||
import { useAppSelector } from '../../hooks/reduxHooks' | ||
import { getPChainAddress } from '../../redux/slices/app-config' | ||
import { getActiveNetwork } from '../../redux/slices/network' | ||
import LongString from '../LongString' | ||
|
||
const LoggedInAccount = () => { | ||
const [walletName, setWalletName] = useState('') | ||
const pChainAddress = useAppSelector(getPChainAddress) | ||
const activeNetwork = useAppSelector(getActiveNetwork) | ||
|
||
useEffect(() => { | ||
if (isMultiSigWallet()) { | ||
setWalletName(getNameOfMultiSigWallet() || getPchainAddress()[0]) | ||
} else setWalletName(getPchainAddress()[0]) | ||
}, [pChainAddress, activeNetwork]) | ||
return ( | ||
<> | ||
<Icon path={mdiWalletOutline} size={1} /> | ||
<LongString value={walletName} /> | ||
</> | ||
) | ||
} | ||
export default LoggedInAccount |
Oops, something went wrong.