🐛 identicon has isAlternative both as data and prop (#668)

* 🐛 identicon has isAlternative both as data and prop

* 🏷️ Identicon has isAlternativeIcon as data
This commit is contained in:
Viki Val
2022-07-23 15:13:11 +02:00
committed by GitHub
parent 96b0470ee7
commit 5396b8f73f
+5 -5
View File
@@ -18,7 +18,7 @@ interface Account {
interface Data { interface Data {
address: string; address: string;
iconSize: number; iconSize: number;
isAlternative: boolean; isAlternativeIcon: boolean;
publicKey: string; publicKey: string;
type: 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate'; type: 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate';
} }
@@ -60,7 +60,7 @@ export const Identicon = Vue.extend({
return { return {
address: '', address: '',
iconSize: DEFAULT_SIZE, iconSize: DEFAULT_SIZE,
isAlternative: false, isAlternativeIcon: false,
publicKey: '0x', publicKey: '0x',
type: 'empty' type: 'empty'
}; };
@@ -69,7 +69,7 @@ export const Identicon = Vue.extend({
createData: function (): void { createData: function (): void {
this.iconSize = this.size as number || DEFAULT_SIZE; this.iconSize = this.size as number || DEFAULT_SIZE;
this.type = this.theme as 'empty'; this.type = this.theme as 'empty';
this.isAlternativeIcon = this.isAlternative as boolean || false;
this.recodeAddress(); this.recodeAddress();
}, },
recodeAddress: function (): void { recodeAddress: function (): void {
@@ -81,7 +81,7 @@ export const Identicon = Vue.extend({
}, },
props: ['prefix', 'isAlternative', 'size', 'theme', 'value'], props: ['prefix', 'isAlternative', 'size', 'theme', 'value'],
render (h): VNode { render (h): VNode {
const { address, iconSize, isAlternative, publicKey, type } = this.$data as Data; const { address, iconSize, isAlternativeIcon, publicKey, type } = this.$data as Data;
if (type === 'empty') { if (type === 'empty') {
return h('Empty', { attrs: { key: address, size: iconSize } }, []); return h('Empty', { attrs: { key: address, size: iconSize } }, []);
@@ -92,7 +92,7 @@ export const Identicon = Vue.extend({
// TODO: substrate // TODO: substrate
const cmp = type.charAt(0).toUpperCase() + type.slice(1); const cmp = type.charAt(0).toUpperCase() + type.slice(1);
return h(cmp, { attrs: { address, isAlternative, key: address, size: iconSize } }, []); return h(cmp, { attrs: { address, isAlternative: isAlternativeIcon, key: address, size: iconSize } }, []);
} }
}, },
watch: { watch: {