🐛 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 {
address: string;
iconSize: number;
isAlternative: boolean;
isAlternativeIcon: boolean;
publicKey: string;
type: 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate';
}
@@ -60,7 +60,7 @@ export const Identicon = Vue.extend({
return {
address: '',
iconSize: DEFAULT_SIZE,
isAlternative: false,
isAlternativeIcon: false,
publicKey: '0x',
type: 'empty'
};
@@ -69,7 +69,7 @@ export const Identicon = Vue.extend({
createData: function (): void {
this.iconSize = this.size as number || DEFAULT_SIZE;
this.type = this.theme as 'empty';
this.isAlternativeIcon = this.isAlternative as boolean || false;
this.recodeAddress();
},
recodeAddress: function (): void {
@@ -81,7 +81,7 @@ export const Identicon = Vue.extend({
},
props: ['prefix', 'isAlternative', 'size', 'theme', 'value'],
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') {
return h('Empty', { attrs: { key: address, size: iconSize } }, []);
@@ -92,7 +92,7 @@ export const Identicon = Vue.extend({
// TODO: substrate
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: {