Add markdown support, add bold to community title

This commit is contained in:
Maciej Ziarkowski 2021-10-11 11:49:04 +02:00
parent 22cac99675
commit ad8b4343d3
5 changed files with 15 additions and 3 deletions

5
app/package-lock.json generated
View File

@ -11148,6 +11148,11 @@
"resolved": "https://registry.npmjs.org/mapnik-vector-tile/-/mapnik-vector-tile-3.0.1.tgz",
"integrity": "sha512-w3/mKA8RUODR4qeVUyU8MhSqeuHqCLhCPdekqb+FBo+SRPXgxYOvffQBcu8mhEu6EK1n1Syrq26FcNcLfkYLEw=="
},
"markdown-to-jsx": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.1.3.tgz",
"integrity": "sha512-jtQ6VyT7rMT5tPV0g2EJakEnXLiPksnvlYtwQsVVZ611JsWGN8bQ1tVSDX4s6JllfEH6wmsYxNjTUAMrPmNA8w=="
},
"mdn-data": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz",

View File

@ -30,6 +30,7 @@
"leaflet": "^1.7.1",
"lodash": "^4.17.21",
"mapnik": "^4.5.8",
"markdown-to-jsx": "^7.1.3",
"node-fs": "^0.1.7",
"nodemailer": "^6.4.11",
"pg-format": "^1.0.4",

View File

@ -1,3 +1,4 @@
import Markdown from 'markdown-to-jsx';
import React from 'react';
import Tooltip from '../../components/tooltip';
@ -34,7 +35,9 @@ const DataTitleCopyable: React.FunctionComponent<DataTitleCopyableProps> = (prop
<div className="data-title">
<div className="data-title-text">
<label htmlFor={`${props.slug}${props.slugModifier ?? ''}`}>
<Markdown>
{ props.title }
</Markdown>
</label>
</div>
<div className="data-title-actions icon-buttons">

View File

@ -3,6 +3,7 @@ import React, { Component } from 'react';
import './tooltip.css';
import { InfoIcon } from './icons';
import Markdown from 'markdown-to-jsx';
interface TooltipProps {
text: string;
@ -79,7 +80,9 @@ class Tooltip extends Component<TooltipProps, TooltipState> {
<div className="tooltip bs-tooltip-bottom">
<div className="arrow"></div>
<div className="tooltip-inner">
{tooltipTextToComponents(this.props.text)}
<Markdown>
{this.props.text}
</Markdown>
</div>
</div>
)

View File

@ -85,7 +85,7 @@ export const buildingUserFields = {
community_type_worth_keeping: {
perUser: true,
category: Category.Community,
title: "Do you think this type of building is generally worth keeping?",
title: "Do you think this **type** of building is generally worth keeping?",
example: true,
},
community_type_worth_keeping_reasons: {