aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-14 12:39:09 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-14 12:50:32 +0100
commit50f1c501a87ef5f5650750dbeca797e833ec7c3a (patch)
treef1f55092696c7261eaa7f9f9a9338253ede65c2b /src/pages
parentfb29b0f017fae162ffa7ad6bdfc80099346802de (diff)
refactor(components): replace Sharing with SharingWidget component
* all the widgets should have a coherent name * fix mailto uri * remove useless CSS * add tests
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/article/[slug].tsx11
-rw-r--r--src/pages/projets/[slug].tsx10
2 files changed, 17 insertions, 4 deletions
diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx
index d35541a..4eb7f2b 100644
--- a/src/pages/article/[slug].tsx
+++ b/src/pages/article/[slug].tsx
@@ -13,11 +13,12 @@ import {
getLayout,
Link,
PageLayout,
- Sharing,
+ SharingWidget,
Spinner,
type MetaItemData,
Time,
type CommentData,
+ Heading,
} from '../../components';
import {
getAllArticlesSlugs,
@@ -301,6 +302,11 @@ const ArticlePage: NextPageWithLayout<ArticlePageProps> = ({
);
const pageUrl = `${website.url}${slug}`;
+ const sharingWidgetTitle = intl.formatMessage({
+ defaultMessage: 'Share',
+ id: 'HKKkQk',
+ description: 'SharingWidget: widget title',
+ });
return (
<>
@@ -335,11 +341,12 @@ const ArticlePage: NextPageWithLayout<ArticlePageProps> = ({
title={title}
withToC={true}
widgets={[
- <Sharing
+ <SharingWidget
// eslint-disable-next-line react/jsx-no-literals -- Key allowed
key="sharing-widget"
className={styles.widget}
data={{ excerpt: intro, title, url: pageUrl }}
+ heading={<Heading level={3}>{sharingWidgetTitle}</Heading>}
media={[
'diaspora',
'email',
diff --git a/src/pages/projets/[slug].tsx b/src/pages/projets/[slug].tsx
index 58c03ce..fa8f43a 100644
--- a/src/pages/projets/[slug].tsx
+++ b/src/pages/projets/[slug].tsx
@@ -13,7 +13,7 @@ import {
getLayout,
Link,
PageLayout,
- Sharing,
+ SharingWidget,
Spinner,
Heading,
List,
@@ -289,6 +289,11 @@ const ProjectPage: NextPageWithLayout<ProjectPageProps> = ({ project }) => {
title,
});
const schemaJsonLd = getSchemaJson([webpageSchema, articleSchema]);
+ const sharingWidgetTitle = intl.formatMessage({
+ defaultMessage: 'Share',
+ id: 'HKKkQk',
+ description: 'SharingWidget: widget title',
+ });
return (
<>
@@ -317,10 +322,11 @@ const ProjectPage: NextPageWithLayout<ProjectPageProps> = ({ project }) => {
headerMeta={filteredHeaderMeta}
withToC={true}
widgets={[
- <Sharing
+ <SharingWidget
// eslint-disable-next-line react/jsx-no-literals -- Key allowed
key="sharing-widget"
data={{ excerpt: intro, title, url: page.url }}
+ heading={<Heading level={3}>{sharingWidgetTitle}</Heading>}
media={[
'diaspora',
'email',