diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-10 17:38:07 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-13 15:46:01 +0200 |
| commit | 9c8921db92d16b07ffc2a63ff3c80c4dcdd9ff9d (patch) | |
| tree | 52e87fa8e758ec51cfbf7aa200982e0a6f5ab1ca /src/components/organisms/widgets/sharing.tsx | |
| parent | 0d59a6d2995b4119865271ed1908ede0bb96497c (diff) | |
chore: add Project single pages
Diffstat (limited to 'src/components/organisms/widgets/sharing.tsx')
| -rw-r--r-- | src/components/organisms/widgets/sharing.tsx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/components/organisms/widgets/sharing.tsx b/src/components/organisms/widgets/sharing.tsx index 05a3f73..85dadb0 100644 --- a/src/components/organisms/widgets/sharing.tsx +++ b/src/components/organisms/widgets/sharing.tsx @@ -21,12 +21,20 @@ export type SharingData = { url: string; }; -export type SharingProps = Pick<WidgetProps, 'expanded' | 'level' | 'title'> & { +export type SharingProps = { /** * The page data to share. */ data: SharingData; /** + * The widget default state. + */ + expanded?: WidgetProps['expanded']; + /** + * The HTML heading level. + */ + level?: WidgetProps['level']; + /** * A list of active and ordered sharing medium. */ media: SharingMedium[]; @@ -37,8 +45,19 @@ export type SharingProps = Pick<WidgetProps, 'expanded' | 'level' | 'title'> & { * * Render a list of sharing links inside a widget. */ -const Sharing: FC<SharingProps> = ({ data, media, ...props }) => { +const Sharing: FC<SharingProps> = ({ + data, + media, + expanded = true, + level = 2, + ...props +}) => { const intl = useIntl(); + const widgetTitle = intl.formatMessage({ + defaultMessage: 'Share', + id: 'q3U6uI', + description: 'Sharing: widget title', + }); /** * Build the Diaspora sharing url with provided data. @@ -181,7 +200,7 @@ const Sharing: FC<SharingProps> = ({ data, media, ...props }) => { }; return ( - <Widget {...props}> + <Widget expanded={expanded} level={level} title={widgetTitle} {...props}> <ul className={styles.list}>{getItems()}</ul> </Widget> ); |
