mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
* Set up Storybook story for membership card component * Update changelogpull/5303/head
committed by
GitHub
2 changed files with 54 additions and 0 deletions
@ -0,0 +1,50 @@ |
|||
import { CommonModule } from '@angular/common'; |
|||
import '@angular/localize/init'; |
|||
import { MatButtonModule } from '@angular/material/button'; |
|||
import { ActivatedRoute, RouterModule } from '@angular/router'; |
|||
import { IonIcon } from '@ionic/angular/standalone'; |
|||
import { moduleMetadata } from '@storybook/angular'; |
|||
import type { Meta, StoryObj } from '@storybook/angular'; |
|||
import { addYears } from 'date-fns'; |
|||
|
|||
import { GfLogoComponent } from '../logo'; |
|||
import { GfMembershipCardComponent } from './membership-card.component'; |
|||
|
|||
export default { |
|||
title: 'Membership Card', |
|||
component: GfMembershipCardComponent, |
|||
decorators: [ |
|||
moduleMetadata({ |
|||
imports: [ |
|||
CommonModule, |
|||
GfLogoComponent, |
|||
IonIcon, |
|||
MatButtonModule, |
|||
RouterModule.forChild([]) |
|||
], |
|||
providers: [{ provide: ActivatedRoute, useValue: {} }] |
|||
}) |
|||
], |
|||
argTypes: { |
|||
name: { |
|||
control: { type: 'select' }, |
|||
options: ['Basic', 'Premium'] |
|||
} |
|||
} |
|||
} as Meta<GfMembershipCardComponent>; |
|||
|
|||
type Story = StoryObj<GfMembershipCardComponent>; |
|||
|
|||
export const Basic: Story = { |
|||
args: { |
|||
name: 'Basic' |
|||
} |
|||
}; |
|||
|
|||
export const Premium: Story = { |
|||
args: { |
|||
expiresAt: addYears(new Date(), 1).toLocaleDateString(), |
|||
hasPermissionToCreateApiKey: true, |
|||
name: 'Premium' |
|||
} |
|||
}; |
Loading…
Reference in new issue