From 2aeb1d597b4f3d565f4cf7571275cda13d47ad3b Mon Sep 17 00:00:00 2001 From: Clemence Kyara Date: Tue, 13 Aug 2024 09:58:07 +0300 Subject: [PATCH 1/4] Default Link to variant=inherit --- .../src/components/RichText/RichText.js | 22 +++++++++++++------ .../src/components/RichText/RichText.snap.js | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/civicsignalblog/src/components/RichText/RichText.js b/apps/civicsignalblog/src/components/RichText/RichText.js index dd1c236bd..3d3a9c3c2 100644 --- a/apps/civicsignalblog/src/components/RichText/RichText.js +++ b/apps/civicsignalblog/src/components/RichText/RichText.js @@ -1,6 +1,7 @@ /* eslint-disable react/no-array-index-key */ import { Link, RichTypography } from "@commons-ui/next"; import { Box } from "@mui/material"; +import { deepmerge } from "@mui/utils"; import React, { Fragment } from "react"; import { Text } from "slate"; @@ -30,41 +31,42 @@ const serialize = (children, props) => if (!node) { return null; } + const nodeProps = deepmerge(DEFAULT_PROPS, props, { clone: true }); // TODO(kilemensi): handle node.type === indent switch (node.type) { case "h1": return ( - + {serialize(node.children)} ); case "h2": return ( - + {serialize(node.children)} ); case "h3": return ( - + {serialize(node.children)} ); case "h4": return ( - + {serialize(node.children)} ); case "h5": return ( - + {serialize(node.children)} ); case "h6": return ( - + {serialize(node.children)} ); @@ -72,7 +74,13 @@ const serialize = (children, props) => return
{serialize(node.children)}
; case "link": return ( - + {serialize(node.children)} ); diff --git a/apps/civicsignalblog/src/components/RichText/RichText.snap.js b/apps/civicsignalblog/src/components/RichText/RichText.snap.js index c11b17806..8b0ddbe8e 100644 --- a/apps/civicsignalblog/src/components/RichText/RichText.snap.js +++ b/apps/civicsignalblog/src/components/RichText/RichText.snap.js @@ -20,7 +20,7 @@ exports[` renders unchanged 1`] = ` > The project currently supports initiatives in 11 countries. Find out more here From cae148cc09b512ca8e29cd3de9946b25d70894b8 Mon Sep 17 00:00:00 2001 From: Clemence Kyara Date: Tue, 13 Aug 2024 09:58:28 +0300 Subject: [PATCH 2/4] anchor should inherit parent font --- .../src/components/LongFormRichText/LongFormRichText.js | 7 ++----- .../components/LongFormRichText/LongFormRichText.snap.js | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/civicsignalblog/src/components/LongFormRichText/LongFormRichText.js b/apps/civicsignalblog/src/components/LongFormRichText/LongFormRichText.js index 6ee632f04..6ac524db3 100644 --- a/apps/civicsignalblog/src/components/LongFormRichText/LongFormRichText.js +++ b/apps/civicsignalblog/src/components/LongFormRichText/LongFormRichText.js @@ -54,11 +54,8 @@ const LongFormRichText = React.forwardRef((props, ref) => { }, }, "& a": { - ...theme.typography.body1, - mb: 2, - [theme.breakpoints.up("md")]: { - ...theme.typography.body3, - }, + font: "inherit", + margin: "inherit", }, "& ul": { mb: 2, diff --git a/apps/civicsignalblog/src/components/LongFormRichText/LongFormRichText.snap.js b/apps/civicsignalblog/src/components/LongFormRichText/LongFormRichText.snap.js index 081a60e3e..075b9d127 100644 --- a/apps/civicsignalblog/src/components/LongFormRichText/LongFormRichText.snap.js +++ b/apps/civicsignalblog/src/components/LongFormRichText/LongFormRichText.snap.js @@ -3,14 +3,14 @@ exports[` renders unchanged 1`] = `

Women make up only 22% of the people seen, heard or read about in the news in Africa, the results of theĀ  Date: Tue, 13 Aug 2024 09:58:49 +0300 Subject: [PATCH 3/4] Update test snapshots --- .../src/components/CMSContent/CMSContent.snap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/civicsignalblog/src/components/CMSContent/CMSContent.snap.js b/apps/civicsignalblog/src/components/CMSContent/CMSContent.snap.js index 7c7132a05..4f8818320 100644 --- a/apps/civicsignalblog/src/components/CMSContent/CMSContent.snap.js +++ b/apps/civicsignalblog/src/components/CMSContent/CMSContent.snap.js @@ -6,14 +6,14 @@ exports[` renders unchanged 1`] = ` class="MuiContainer-root MuiContainer-maxWidthLg MuiContainer-fixed MuiContainer-disableGutters css-1y3f71u-MuiContainer-root" >