diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-16 19:40:23 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-16 19:40:23 +0200 |
| commit | c77c58e18143233be042c4980a6ed08ae9beac52 (patch) | |
| tree | 94f7d828571a86470ae299fff7dffd32fb38de7c /src/components/organisms/widgets | |
| parent | 2155550fa36a3bc3c8f66e0926530123b4018cd4 (diff) | |
chore: adjust and complete missing styles
* add logo to topics pages and links
* add Prism styles to articles
* and a few other adjustements
Diffstat (limited to 'src/components/organisms/widgets')
| -rw-r--r-- | src/components/organisms/widgets/sharing.stories.tsx | 21 | ||||
| -rw-r--r-- | src/components/organisms/widgets/sharing.tsx | 7 |
2 files changed, 19 insertions, 9 deletions
diff --git a/src/components/organisms/widgets/sharing.stories.tsx b/src/components/organisms/widgets/sharing.stories.tsx index 47213b6..59b86d3 100644 --- a/src/components/organisms/widgets/sharing.stories.tsx +++ b/src/components/organisms/widgets/sharing.stories.tsx @@ -1,5 +1,4 @@ import { ComponentMeta, ComponentStory } from '@storybook/react'; -import { IntlProvider } from 'react-intl'; import SharingWidget from './sharing'; /** @@ -9,6 +8,19 @@ export default { title: 'Organisms/Widgets', component: SharingWidget, argTypes: { + className: { + control: { + type: 'text', + }, + description: 'Set additional classnames to the sharing links list.', + table: { + category: 'Styles', + }, + type: { + name: 'string', + required: false, + }, + }, data: { description: 'The page data.', type: { @@ -58,13 +70,6 @@ export default { }, }, }, - decorators: [ - (Story) => ( - <IntlProvider locale="en"> - <Story /> - </IntlProvider> - ), - ], } as ComponentMeta<typeof SharingWidget>; const Template: ComponentStory<typeof SharingWidget> = (args) => ( diff --git a/src/components/organisms/widgets/sharing.tsx b/src/components/organisms/widgets/sharing.tsx index 85dadb0..c63f5db 100644 --- a/src/components/organisms/widgets/sharing.tsx +++ b/src/components/organisms/widgets/sharing.tsx @@ -23,6 +23,10 @@ export type SharingData = { export type SharingProps = { /** + * Set additional classnames to the sharing links list. + */ + className?: string; + /** * The page data to share. */ data: SharingData; @@ -46,6 +50,7 @@ export type SharingProps = { * Render a list of sharing links inside a widget. */ const Sharing: FC<SharingProps> = ({ + className = '', data, media, expanded = true, @@ -201,7 +206,7 @@ const Sharing: FC<SharingProps> = ({ return ( <Widget expanded={expanded} level={level} title={widgetTitle} {...props}> - <ul className={styles.list}>{getItems()}</ul> + <ul className={`${styles.list} ${className}`}>{getItems()}</ul> </Widget> ); }; |
