Skip to content

Commit

Permalink
fix: added some missing story mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
dyersituations committed Feb 6, 2024
1 parent 1205eab commit f853fb5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .storybook/stories/DonationNudgeLightbox.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import DonationNudgeLightbox from '@/components/Checkout/DonationNudge/DonationNudgeLightbox.vue';
import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin';
import apolloStoryMixin from '../mixins/apollo-story-mixin';

export default {
title: 'Components/Donation Nudge Lightbox',
Expand All @@ -11,6 +13,7 @@ export default {
export const Default = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { DonationNudgeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<donation-nudge-lightbox
:loan-count="1"
Expand Down
19 changes: 15 additions & 4 deletions .storybook/stories/EcoChallengeLightbox.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import EcoChallengeLightbox from '@/components/Lightboxes/EcoChallengeLightbox.vue';
import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin';
import apolloStoryMixin from '../mixins/apollo-story-mixin';

const ecoChallengeMilestoneValues = {
'sustainable-agriculture': [
Expand Down Expand Up @@ -43,18 +45,19 @@ const ecoChallengeMilestoneValues = {
function allCombinations(obj) {
let combos = [[]]
for (const [key, values] of Object.entries(obj)) {
combos = combos.flatMap((combo) =>
values.map((value) => ([...combo, value ]))
)
combos = combos.flatMap((combo) =>
values.map((value) => ([...combo, value]))
)
}
return combos
}
}

const allMilestoneCombinations = allCombinations(ecoChallengeMilestoneValues);

export default {
title: 'Components/Eco Challenge Lightbox',
component: EcoChallengeLightbox,
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
args: {
progresses: [],
visible: true
Expand All @@ -64,6 +67,7 @@ export default {
export const EcoChallengeLightboxCombo0 = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { EcoChallengeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<eco-challenge-lightbox
:visible="visible"
Expand All @@ -79,6 +83,7 @@ EcoChallengeLightboxCombo0.args = {
export const EcoChallengeLightboxCombo1 = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { EcoChallengeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<eco-challenge-lightbox
:visible="visible"
Expand All @@ -94,6 +99,7 @@ EcoChallengeLightboxCombo1.args = {
export const EcoChallengeLightboxCombo2 = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { EcoChallengeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<eco-challenge-lightbox
:visible="visible"
Expand All @@ -109,6 +115,7 @@ EcoChallengeLightboxCombo2.args = {
export const EcoChallengeLightboxCombo3 = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { EcoChallengeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<eco-challenge-lightbox
:visible="visible"
Expand All @@ -125,6 +132,7 @@ EcoChallengeLightboxCombo3.args = {
export const EcoChallengeLightboxCombo4 = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { EcoChallengeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<eco-challenge-lightbox
:visible="visible"
Expand All @@ -140,6 +148,7 @@ EcoChallengeLightboxCombo4.args = {
export const EcoChallengeLightboxCombo5 = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { EcoChallengeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<eco-challenge-lightbox
:visible="visible"
Expand All @@ -155,6 +164,7 @@ EcoChallengeLightboxCombo5.args = {
export const EcoChallengeLightboxCombo6 = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { EcoChallengeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<eco-challenge-lightbox
:visible="visible"
Expand All @@ -170,6 +180,7 @@ EcoChallengeLightboxCombo6.args = {
export const EcoChallengeLightboxCombo7 = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { EcoChallengeLightbox },
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
template: `
<eco-challenge-lightbox
:visible="visible"
Expand Down
4 changes: 3 additions & 1 deletion .storybook/stories/KvSocialShareButton.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import KvSocialShareButton from '@/components/Kv/KvSocialShareButton';
import apolloStoryMixin from '../mixins/apollo-story-mixin';

export default {
title: 'Kv/KvSocialShareButton',
Expand All @@ -22,11 +23,12 @@ export default {
};


export const Default= (args, { argTypes }) => ({
export const Default = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
KvSocialShareButton,
},
mixins: [apolloStoryMixin()],
template: `
<kv-social-share-button
:modal-title="modalTitle"
Expand Down
5 changes: 3 additions & 2 deletions .storybook/stories/ListLoanCard.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import apolloStoryMixin from '../mixins/apollo-story-mixin';
import ListLoanCard from '@/components/LoanCards/ListLoanCard';
import { mockLoansArray } from '../utils';
import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin';

const loan = mockLoansArray(1)[0];
export default {
Expand All @@ -11,14 +12,14 @@ export default {

export const Default = (_args, { argTypes }) => ({
props: Object.keys(argTypes),
mixins: [apolloStoryMixin()],
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
components: { ListLoanCard },
template: `<list-loan-card :loan="loan" />`,
});

export const RoundedCorners = (_args, { argTypes }) => ({
props: Object.keys(argTypes),
mixins: [apolloStoryMixin()],
mixins: [cookieStoreStoryMixin(), apolloStoryMixin()],
components: { ListLoanCard },
template: `
<list-loan-card
Expand Down

0 comments on commit f853fb5

Please sign in to comment.