From f4b5ccd471a6d1dc02cf6e4f2b34a94689bd50c8 Mon Sep 17 00:00:00 2001 From: Sven Date: Sun, 26 Jul 2020 21:29:32 +0200 Subject: [PATCH 1/3] Nimiq button: small, big, arrow, back --- src/components/NimiqButton.vue | 117 +++++++++++++++++++++++++++++++++ src/stories/index.stories.js | 21 ++++++ 2 files changed, 138 insertions(+) create mode 100644 src/components/NimiqButton.vue diff --git a/src/components/NimiqButton.vue b/src/components/NimiqButton.vue new file mode 100644 index 00000000..c50dbd5a --- /dev/null +++ b/src/components/NimiqButton.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/src/stories/index.stories.js b/src/stories/index.stories.js index 30f65c75..187ac302 100644 --- a/src/stories/index.stories.js +++ b/src/stories/index.stories.js @@ -29,6 +29,7 @@ import LabelInput from '../components/LabelInput.vue'; import Wallet from '../components/Wallet.vue'; import WalletList from '../components/WalletList.vue'; import WalletMenu from '../components/WalletMenu.vue'; +import NimiqButton from '../components/NimiqButton.vue'; import PaymentInfoLine from '../components/PaymentInfoLine.vue'; import QrCode from '../components/QrCode.vue'; import QrScanner from '../components/QrScanner.vue'; @@ -45,6 +46,7 @@ import MigrationWelcome from '../components/MigrationWelcome.vue'; import * as Icons from '../components/Icons'; import '@nimiq/style/nimiq-style.min.css'; +import { getNodeMajorVersion } from 'typescript'; function windowTemplate(slot) { return ` @@ -641,6 +643,25 @@ storiesOf('Components', module) template: ``, }; }) + .add('NimiqButton', () => { + const label = text('label', 'Nimiq Button'); + const link = text('link', ''); + const color = select('color', ['gray', 'blue', 'light-blue', 'green', 'orange', 'red', 'gold'], 'light-blue'); + const small = boolean('small', false); + const inverse = boolean('inverse', false); + const arrow = boolean('arrow', true); + const back = boolean('back', false); + return { + components: {NimiqButton}, + methods: { + click: action('click'), + }, + data() { + return { label, link, color, small, inverse, arrow, back } + }, + template: ``, + }; + }) .add('Contact (deprecated)', () => { const label = text('label', 'Burn address'); const address = text('address', 'NQ07 0000 00000000 0000 0000 0000 0000 0000'); From eb2aca7c82e5808ef6a03eaa43f06c6eae8df689 Mon Sep 17 00:00:00 2001 From: Sven Date: Tue, 28 Jul 2020 12:31:45 +0200 Subject: [PATCH 2/3] switching to SASS --- src/components/NimiqButton.vue | 100 +++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 36 deletions(-) diff --git a/src/components/NimiqButton.vue b/src/components/NimiqButton.vue index c50dbd5a..8e67f660 100644 --- a/src/components/NimiqButton.vue +++ b/src/components/NimiqButton.vue @@ -8,7 +8,7 @@ 'nq-button-pill': small && color != 'gray', 'go-back': back, 'has-arrow': arrow || back, - small, inverse, }]" + small, medium, inverse, }]" :target="(link && link.startsWith('http')) ? '_blank' : '_self'"> {{ $t(text) }} @@ -29,7 +29,7 @@ - + @@ -49,69 +49,97 @@ export default class NimiqButton extends Mixins(I18nMixin) { @Prop(String) private link?: string; @Prop({ type: String, default: 'light-blue' }) private color!: string; @Prop(Boolean) private arrow?: boolean; - @Prop(Boolean) private small?: boolean; + @Prop(Boolean) private small?: boolean; // "big" is default + @Prop(Boolean) private medium?: boolean; @Prop(Boolean) private inverse?: boolean; @Prop(Boolean) private back?: boolean; } - From 642c4bc8ccd9479c37db30f15a37c1e5823d527e Mon Sep 17 00:00:00 2001 From: Sven Date: Tue, 28 Jul 2020 14:47:48 +0200 Subject: [PATCH 3/3] back to CSS + style single icon for small and normal --- src/components/NimiqButton.vue | 130 ++++++++++++++------------------- 1 file changed, 56 insertions(+), 74 deletions(-) diff --git a/src/components/NimiqButton.vue b/src/components/NimiqButton.vue index 8e67f660..fecf8bda 100644 --- a/src/components/NimiqButton.vue +++ b/src/components/NimiqButton.vue @@ -12,23 +12,6 @@ :target="(link && link.startsWith('http')) ? '_blank' : '_self'"> {{ $t(text) }} - @@ -56,66 +39,66 @@ export default class NimiqButton extends Mixins(I18nMixin) { } -