Skip to content

Commit

Permalink
chore(ds): update stories (#2273)
Browse files Browse the repository at this point in the history
  • Loading branch information
josenriagu committed May 14, 2024
1 parent 130d3c9 commit fc4c41d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Default: Story = {
paragraphOneLabel:
'We use cookies. Some are necessary to operate effectively the platform, others are to help us improve AKASHA World.',
paragraphTwo: {
ctaLabel: `By opting-in you allow us to collect data via `,
introLabel: `By opting-in you allow us to collect data via `,
analyticsLabel: 'Matomo',
analyticsURL: '',
middleParagraphLabeL: `, an open source analytics platform that will help us improve AKASHA World. As we respect your privacy, rest assured that we don't store personal identifiable information (PII). In addition, if you change your mind, you can always opt-out by accessing the `,
Expand All @@ -33,9 +33,9 @@ export const Default: Story = {
onSettingsClick: () => ({}),
},
paragraphThree: {
ctaLabel: 'For more info, see our ',
urlLabel: 'Privacy Policy',
url: 'https://ethereum.world/privacy-policy',
introLabel: 'For more info, see our ',
ctaLabel: 'Privacy Policy',
onPrivacyClick: () => ({}),
},
acceptAllLabel: 'Accept all',
onlyEssentialLabel: 'Only essential',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import AuthorProfileAvatar from '@akashaorg/ui-lib-feed/lib/components/cards/author-profile-avatar';
import EntryCard, { EntryCardProps } from '../../components/Entry/EntryCard';
import type { Meta, StoryObj } from '@storybook/react';
import { EntityTypes } from '@akashaorg/typings/lib/ui';
Expand All @@ -17,7 +18,6 @@ const meta: Meta<EntryCardProps> = {
argTypes: {
isLoggedIn: { control: 'boolean' },
entryData: { control: 'object' },
authorProfile: { control: 'object' },
itemType: {
control: 'select',
options: [
Expand All @@ -32,37 +32,27 @@ const meta: Meta<EntryCardProps> = {
onContentClick: { action: 'content clicked' },
onMentionClick: { action: 'mention clicked' },
onTagClick: { action: 'tag clicked' },
transformSource: { action: 'source transformed' },
},
};

type Story = StoryObj<EntryCardProps>;

const isLoggedIn = true;

const error = new Error('an error occured');

const entryData = {
active: true,
authorId: 'did:pkh:eip155:5:0xa2aabe32856a8d50c748d50a5111312d986208a8',
createdAt: '12/12/2023',
id: 'kshggg55555',
};

const authorProfile = {
data: {
did: { id: 'did:pkh:eip155:5:0xa2aabe32856a8d50c748d50a5111312d986208a8' },
name: 'Coffee Lover',
},
loading: false,
error,
};

const baseArgs: Story = {
args: {
isLoggedIn,
entryData,
authorProfile,
profileAvatarExt: (
<AuthorProfileAvatar authorId="authorId" createdAt={new Date('Jan 01 2024').toISOString()} />
),
itemType: EntityTypes?.REFLECT,
flagAsLabel: 'Flag',
slateContent: [
Expand All @@ -78,11 +68,6 @@ const baseArgs: Story = {
onContentClick: () => ({}),
onMentionClick: () => ({}),
onTagClick: () => ({}),
transformSource: () => ({
src: 'https://placebeard.it/360x360',
width: 360,
height: 360,
}),
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import AuthorProfileAvatar from '@akashaorg/ui-lib-feed/lib/components/cards/author-profile-avatar';
import VibesConsoleContentCard, {
VibesConsoleContentCardProps,
} from '../../components/VibesConsoleContentCard';
Expand All @@ -25,14 +27,9 @@ const sampleEntryData: EntryCardProps = {
createdAt: '12/12/2023',
id: 'kshggg55555',
},
authorProfile: {
data: {
did: { id: 'did:pkh:eip155:5:0xa2aabe32856a8d50c748d50a5111312d986208a8' },
name: 'Coffee Lover',
},
loading: false,
error: new Error('an error occured'),
},
profileAvatarExt: (
<AuthorProfileAvatar authorId="authorId" createdAt={new Date('Jan 01 2024').toISOString()} />
),
itemType: EntityTypes?.REFLECT,
flagAsLabel: 'Flag',
slateContent: [
Expand All @@ -48,11 +45,6 @@ const sampleEntryData: EntryCardProps = {
onContentClick: () => ({}),
onMentionClick: () => ({}),
onTagClick: () => ({}),
transformSource: () => ({
src: 'https://placebeard.it/360x360',
width: 360,
height: 360,
}),
};

const sampleProfileData: ProfileItemData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ const meta: Meta<ProfileAvatarButtonProps> = {
avatar: { control: 'object' },
alternativeAvatars: { control: 'object' },
label: { control: 'text' },
size: { control: 'select', options: ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'] },
profileId: { control: 'text' },
truncateText: { control: 'boolean' },
href: { control: 'text' },
onClick: { action: 'button clicked' },
onClickAvatar: { action: 'avatar clicked' },
onMouseEnter: { action: 'mouse entered' },
onMouseLeave: { action: 'mouse left' },
},
};

Expand All @@ -43,6 +39,4 @@ export const Default: Story = { args: { ...baseArgs.args } };

export const NotTruncatedButton: Story = { args: { ...baseArgs.args, truncateText: false } };

export const ButtonWithSize: Story = { args: { ...baseArgs.args, size: 'lg' } };

export default meta;

0 comments on commit fc4c41d

Please sign in to comment.