mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-14 05:41:01 +00:00
🐛 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:
@@ -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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user