diff --git a/src/components/Account.vue b/src/components/Account.vue index 1cad1b5b..cc737ac6 100644 --- a/src/components/Account.vue +++ b/src/components/Account.vue @@ -10,10 +10,10 @@ - + -
{{ label }}
-
+
{{ label }}
+
@@ -33,10 +33,10 @@ @Component({components: {Amount, Identicon, LabelInput}}) export default class Account extends Vue { - @Prop(String) public address!: string; + @Prop(String) public label!: string; + @Prop(String) public address?: string; @Prop(String) public image?: string; @Prop({type: Boolean, default: false}) public displayAsCashlink!: boolean; - @Prop(String) public label!: string; @Prop(String) public placeholder?: string; @Prop(String) public walletLabel?: string; @Prop(Number) public balance?: number; @@ -65,7 +65,11 @@ this.showImage = !!this.image; } - private get _isLabelAddress() { + private get _isNimiqAddress() { + return ValidationUtils.isValidAddress(this.address); + } + + private get _isLabelNimiqAddress() { return ValidationUtils.isValidAddress(this.label); } } diff --git a/src/components/PaymentInfoLine.vue b/src/components/PaymentInfoLine.vue index 95f7bef7..38ccb3b6 100644 --- a/src/components/PaymentInfoLine.vue +++ b/src/components/PaymentInfoLine.vue @@ -1,41 +1,97 @@ diff --git a/src/stories/index.stories.js b/src/stories/index.stories.js index 79d30c88..4133c90e 100644 --- a/src/stories/index.stories.js +++ b/src/stories/index.stories.js @@ -941,18 +941,32 @@ storiesOf('Components', module) }; }) .add('PaymentInfoLine', () => { - const address = text('address', 'NQ07 0000 00000000 0000 0000 0000 0000 0000'); + const theme = select('theme', Object.values(PaymentInfoLine.Themes), PaymentInfoLine.Themes.NORMAL); + const cryptoAmount = { + amount: number('cryptoAmount.amount', 199862), + currency: text('cryptoAmount.currency', 'NIM'), + decimals: number('cryptoAmount.decimals', 5), + }; + let fiatAmount = { + amount: number('fiatAmount.amount (-1 for unset)', -1), + currency: text('fiatAmount.currency', 'EUR'), + }; + if (fiatAmount.amount < 0) fiatAmount = null; const origin = text('origin', 'https://shop.nimiq.com'); + const address = text('address', 'NQ07 0000 00000000 0000 0000 0000 0000 0000'); const shopLogo = text('shopLogo', 'https://pbs.twimg.com/profile_images/1150268408287698945/x4f3ITmx_400x400.png'); - const amount = number('amount', 199862); - const fee = number('fee', 138); + let startTime = number('startTime', Date.now()); + let expires = number('expires (-1 for unset)', -1); + if (expires < 0) expires = null; + return { components: {PaymentInfoLine}, - methods: { - merchantInfoClicked: action('merchant-info-clicked'), - }, - template: `
`, + data: () => ({ cryptoAmount, fiatAmount, origin, address, shopLogo, startTime, expires, theme }), + template: `
+ +
`, }; }) .add('QrCode', () => {