Unverified Commit 36a6eff5 authored by Hanwen Cheng's avatar Hanwen Cheng Committed by GitHub
Browse files

chore: add name into account qr code (#538)

* chore: add name into account qr code

* chore: rename

* merge master
parent 5700a4dd
Pipeline #77806 failed with stages
in 1 minute and 44 seconds
...@@ -110,7 +110,9 @@ function AccountDetails({ accounts, navigation }) { ...@@ -110,7 +110,9 @@ function AccountDetails({ accounts, navigation }) {
/> />
<View> <View>
{protocol !== NetworkProtocols.UNKNOWN ? ( {protocol !== NetworkProtocols.UNKNOWN ? (
<QrView data={selectedKey} /> <QrView
data={account.name ? `${selectedKey}:${account.name}` : selectedKey}
/>
) : ( ) : (
<UnknownAccountWarning /> <UnknownAccountWarning />
)} )}
......
...@@ -28,6 +28,7 @@ import QrView from '../components/QrView'; ...@@ -28,6 +28,7 @@ import QrView from '../components/QrView';
import { import {
getAddressWithPath, getAddressWithPath,
getNetworkKey, getNetworkKey,
getPathName,
getPathsWithSubstrateNetwork, getPathsWithSubstrateNetwork,
isSubstratePath isSubstratePath
} from '../util/identitiesUtils'; } from '../util/identitiesUtils';
...@@ -44,6 +45,7 @@ import UnknownAccountWarning from '../components/UnknownAccountWarning'; ...@@ -44,6 +45,7 @@ import UnknownAccountWarning from '../components/UnknownAccountWarning';
export function PathDetailsView({ accounts, navigation, path, networkKey }) { export function PathDetailsView({ accounts, navigation, path, networkKey }) {
const { currentIdentity } = accounts.state; const { currentIdentity } = accounts.state;
const address = getAddressWithPath(path, currentIdentity); const address = getAddressWithPath(path, currentIdentity);
const accountName = getPathName(path, currentIdentity);
if (!address) return null; if (!address) return null;
const isUnknownNetwork = networkKey === UnknownNetworkKeys.UNKNOWN; const isUnknownNetwork = networkKey === UnknownNetworkKeys.UNKNOWN;
const formattedNetworkKey = isUnknownNetwork ? defaultNetworkKey : networkKey; const formattedNetworkKey = isUnknownNetwork ? defaultNetworkKey : networkKey;
...@@ -104,7 +106,7 @@ export function PathDetailsView({ accounts, navigation, path, networkKey }) { ...@@ -104,7 +106,7 @@ export function PathDetailsView({ accounts, navigation, path, networkKey }) {
</View> </View>
<ScrollView> <ScrollView>
<PathCard identity={currentIdentity} path={path} /> <PathCard identity={currentIdentity} path={path} />
<QrView data={accountId} /> <QrView data={`${accountId}:${accountName}`} />
{isUnknownNetwork && <UnknownAccountWarning isPath />} {isUnknownNetwork && <UnknownAccountWarning isPath />}
</ScrollView> </ScrollView>
</View> </View>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment