From d671b9ff555115e739566289e4efad263a37e955 Mon Sep 17 00:00:00 2001 From: Vadim Date: Fri, 22 Jan 2021 17:37:02 +0300 Subject: [PATCH] Add custom arrows example --- src/ImageCarousel/ImageCarousel.stories.js | 11 +- src/ImageCarousel/ImageCarousel.svelte | 4 +- .../ImageCarouselViewCustomArrows.svelte | 133 ++++++++++++++++++ 3 files changed, 143 insertions(+), 5 deletions(-) create mode 100644 src/ImageCarousel/ImageCarouselViewCustomArrows.svelte diff --git a/src/ImageCarousel/ImageCarousel.stories.js b/src/ImageCarousel/ImageCarousel.stories.js index 2294fdd..282479c 100644 --- a/src/ImageCarousel/ImageCarousel.stories.js +++ b/src/ImageCarousel/ImageCarousel.stories.js @@ -1,5 +1,6 @@ import ImageCarouselView from './ImageCarouselView.svelte'; import ImageCarouselViewCustomDots from './ImageCarouselViewCustomDots.svelte'; +import ImageCarouselViewCustomArrows from './ImageCarouselViewCustomArrows.svelte'; export default { title: 'ImageCarousel', @@ -10,13 +11,17 @@ const Template = ({ ...args }) => ({ Component: ImageCarouselView, props: args }); +export const Primary = Template.bind({}); const TemplateCustomDots = ({ ...args }) => ({ Component: ImageCarouselViewCustomDots, props: args }); - -export const Primary = Template.bind({}); - export const WithCustomDots = TemplateCustomDots.bind({}); +const TemplateCustomArrows = ({ ...args }) => ({ + Component: ImageCarouselViewCustomArrows, + props: args +}); +export const WithCustomArrows = TemplateCustomArrows.bind({}); + diff --git a/src/ImageCarousel/ImageCarousel.svelte b/src/ImageCarousel/ImageCarousel.svelte index 1d6712e..b613a07 100644 --- a/src/ImageCarousel/ImageCarousel.svelte +++ b/src/ImageCarousel/ImageCarousel.svelte @@ -140,7 +140,7 @@
{#if arrows} - +
diff --git a/src/ImageCarousel/ImageCarouselViewCustomArrows.svelte b/src/ImageCarousel/ImageCarouselViewCustomArrows.svelte new file mode 100644 index 0000000..e26a3a3 --- /dev/null +++ b/src/ImageCarousel/ImageCarouselViewCustomArrows.svelte @@ -0,0 +1,133 @@ + + +
+ + {#each colors as color (color)} +
+

{color}

+
+ {/each} +
+
+ <<< +
+
+
+
+ >>> +
+
+
+
+ + \ No newline at end of file