From ba54d8fd8eb6cb10a4840dc00b713cc49e021598 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 22 Aug 2019 22:29:57 -0600 Subject: [PATCH 01/12] Carousel: initial implementation --- src/components/Carousel.vue | 234 +++++++++++++++++++++++++++++++++++ src/main.ts | 1 + src/stories/index.stories.js | 40 ++++++ 3 files changed, 275 insertions(+) create mode 100644 src/components/Carousel.vue diff --git a/src/components/Carousel.vue b/src/components/Carousel.vue new file mode 100644 index 00000000..bd3c8a22 --- /dev/null +++ b/src/components/Carousel.vue @@ -0,0 +1,234 @@ + + + + + + diff --git a/src/main.ts b/src/main.ts index 41999665..9633275c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,6 +12,7 @@ export { default as AmountInput } from './components/AmountInput.vue'; export { default as AmountWithDetails } from './components/AmountWithDetails.vue'; export { default as AmountWithFee } from './components/AmountWithFee.vue'; export { default as BottomOverlay } from './components/BottomOverlay.vue'; +export { default as Carousel } from './components/Carousel.vue'; export { default as CircleSpinner } from './components/CircleSpinner.vue'; export { default as CloseButton } from './components/CloseButton.vue'; export { default as Contact } from './components/Contact.vue'; diff --git a/src/stories/index.stories.js b/src/stories/index.stories.js index 4133c90e..6e5e8a81 100644 --- a/src/stories/index.stories.js +++ b/src/stories/index.stories.js @@ -16,6 +16,7 @@ import AmountInput from '../components/AmountInput.vue'; import AmountWithDetails from '../components/AmountWithDetails.vue'; import AmountWithFee from '../components/AmountWithFee.vue'; import BottomOverlay from '../components/BottomOverlay.vue'; +import Carousel from '../components/Carousel.vue'; import CircleSpinner from '../components/CircleSpinner.vue'; import CloseButton from '../components/CloseButton.vue'; import Contact from '../components/Contact.vue'; @@ -570,6 +571,45 @@ storiesOf('Components', module) `, } }) + .add('Carousel', () => ({ + components: {Carousel,SmallPage}, + data: () => ({ + currencies: { + nim: true, + btc: true, + eth: true, + ltc: false, + }, + }), + computed: { + enabledCurrencies() { + return Object.keys(this.currencies).filter((currency) => this.currencies[currency]); + } + }, + template: ` +
+ + + +
+ + + + +
+
+ `, + })) .add('CloseButton', () => { return { components: {CloseButton}, From 1755a6bbeaeb031e97dabc49baddbc836dcd907d Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 22 Aug 2019 22:52:20 -0600 Subject: [PATCH 02/12] Carousel: more general demo --- src/stories/index.stories.js | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/stories/index.stories.js b/src/stories/index.stories.js index 6e5e8a81..e773f0ce 100644 --- a/src/stories/index.stories.js +++ b/src/stories/index.stories.js @@ -573,38 +573,22 @@ storiesOf('Components', module) }) .add('Carousel', () => ({ components: {Carousel,SmallPage}, - data: () => ({ - currencies: { - nim: true, - btc: true, - eth: true, - ltc: false, - }, - }), + data: () => ({ entryCount: 3 }), computed: { - enabledCurrencies() { - return Object.keys(this.currencies).filter((currency) => this.currencies[currency]); + entries() { + return new Array(parseInt(this.entryCount)).fill('Card-').map((v, i) => `${v}${i}`); } }, template: `
- -