From 523796a505b80736bf004a1ebd2b0721a44716a6 Mon Sep 17 00:00:00 2001 From: Minghua Sun Date: Wed, 7 Oct 2020 13:49:27 -0400 Subject: [PATCH] render RichText in noto sans, enable RichText to inherit other attributes --- .../base/Typography/Typography.stories.mdx | 62 +++++++++---------- .../components/organisms/RichText/index.js | 4 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/react/src/components/base/Typography/Typography.stories.mdx b/react/src/components/base/Typography/Typography.stories.mdx index 31b4b71d1d..d3e68d92e5 100644 --- a/react/src/components/base/Typography/Typography.stories.mdx +++ b/react/src/components/base/Typography/Typography.stories.mdx @@ -79,72 +79,72 @@ It's selected to be the Mayflower typeface to: The following languages are officially supported by [Mass.gov](https://www.mass.gov). If your project needs to support an addtional language, please [submit a feature request](https://github.com/massgov/mayflower/issues/new/choose) on Github. #### Arabic -

Arabic: مرحبا بكم في ماساتشوستس

-

Persian: به ماساچوست خوش آمدید

-

Urdu: میساچوسٹس میں آپ کا استقبال ہےد

+Arabic: مرحبا بكم في ماساتشوستس +Persian: به ماساچوست خوش آمدید +Urdu: میساچوسٹس میں آپ کا استقبال ہےد #### Armenian -

Բարի գալուստ Մասաչուսեթս

+Բարի գալուստ Մասաչուսեթս #### Chinese -

Simplified: 欢迎来到马萨诸塞州

-

Tranditional: 歡迎來到馬薩諸塞州

+Simplified: 欢迎来到马萨诸塞州 +Tranditional: 歡迎來到馬薩諸塞州 #### Cyrillic -

Russian: Добро пожаловать в Массачусетс

-

Ukrainian: Ласкаво просимо до Массачусетсу

+Russian: Добро пожаловать в Массачусетс +Ukrainian: Ласкаво просимо до Массачусетсу #### Greek -

Καλώς ήλθατε στη Μασαχουσέτη

+Καλώς ήλθατε στη Μασαχουσέτη #### Gujarati -

મેસેચ્યુસેટ્સમાં

+મેસેચ્યુસેટ્સમાં #### Hebrew -

ברוך הבא למסצ'וסט.ס

+ברוך הבא למסצ'וסט.ס #### Hindi -

मैसाचुसेट्स में आपका स्वागत है

+मैसाचुसेट्स में आपका स्वागत है #### Japanese -

マサチューセッツへようこそ

+マサチューセッツへようこそ #### Khmer -

សូមស្វាគមន៍មកកាន់ម៉ាសាឈូសេត

+សូមស្វាគមន៍មកកាន់ម៉ាសាឈូសេត #### Korean -

매사추세츠에 오신 것을 환영합니다

+매사추세츠에 오신 것을 환영합니다 #### Lao -

ຍິນດີຕ້ອນຮັບສູ່ Massachusetts

+ຍິນດີຕ້ອນຮັບສູ່ Massachusetts #### Latin -

English: Welcome to Massachusetts

-

Filipino: Maligayang pagdating sa Massachusetts

-

French: Bienvenue au Massachusetts

-

German: Willkommen in Massachusetts

-

Haitian Creole: Byenveni nan Massachusetts

-

Arabic: Maligayang pagdating sa Massachusetts

-

Italian: Benvenuto in Massachusetts

-

Polish: Witamy w Massachusetts

-

Portuguese: Bem vindo a Massachusetts

-

Spanish: Bienvenido a massachusetts

+English: Welcome to Massachusetts +Filipino: Maligayang pagdating sa Massachusetts +French: Bienvenue au Massachusetts +German: Willkommen in Massachusetts +Haitian Creole: Byenveni nan Massachusetts +Arabic: Maligayang pagdating sa Massachusetts +Italian: Benvenuto in Massachusetts +Polish: Witamy w Massachusetts +Portuguese: Bem vindo a Massachusetts +Spanish: Bienvenido a massachusetts #### Malayalam -

മസാച്ചുസെറ്റ്സിലേക്ക് സ്വാഗതം

+മസാച്ചുസെറ്റ്സിലേക്ക് സ്വാഗതം #### Tamil -

மாசசூசெட்ஸுக்கு வருக

+மாசசூசெட்ஸுக்கு வருக #### Telugu -

మసాచుసెట్స్‌కు స్వాగతం

+మసాచుసెట్స్‌కు స్వాగతం #### Thai -

ยินดีต้อนรับสู่แมสซาชูเซตส์

+ยินดีต้อนรับสู่แมสซาชูเซตส์ #### Vietnamese -

Chào mừng đến với Massachusetts

+Chào mừng đến với Massachusetts ## Styles and Usage Noto Sans is being used both as the display fonts and the text fonts. diff --git a/react/src/components/organisms/RichText/index.js b/react/src/components/organisms/RichText/index.js index 05d07fa8ed..a5f2cfa693 100644 --- a/react/src/components/organisms/RichText/index.js +++ b/react/src/components/organisms/RichText/index.js @@ -8,13 +8,13 @@ import ReactHtmlParser from 'react-html-parser'; import ReactDOMServer from 'react-dom/server'; const RichText = ({ - className, id, htmlTag, rawHtml, transform, children + className, id, htmlTag, rawHtml, transform, children, ...rest }) => { const CustomElement = htmlTag; // If chidlren don't exist, expect to render the rawHtml string. const markup = children ? ReactDOMServer.renderToStaticMarkup(children) : rawHtml; return( - element} className={className} id={id}> + element} className={className} id={id} {...rest}> {ReactHtmlParser(markup, { transform })} );