File tree Expand file tree Collapse file tree
designSystem/designComponents/textComponents
mainApp/sidebar/settings/tabViews/aboutSettings Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 "eslint" : " ^8.8.0" ,
6666 "eslint-plugin-import" : " ^2.20.0" ,
6767 "fork-ts-checker-webpack-plugin" : " ^7.1.1" ,
68+ "html-loader" : " ^4.2.0" ,
6869 "lint-staged" : " ^12.3.4" ,
70+ "markdown-loader" : " ^8.0.0" ,
6971 "mock-aws-s3" : " ^4.0.2" ,
7072 "node-loader" : " ^2.0.0" ,
7173 "patch-package" : " ^6.5.1" ,
111113 "file-type" : " ^17.1.6" ,
112114 "github-url-to-object" : " ^4.0.6" ,
113115 "lodash" : " ^4.17.21" ,
116+ "markdown-to-jsx" : " ^7.2.1" ,
114117 "multicoin-address-validator" : " ^0.5.8" ,
115118 "nock" : " ^13.2.4" ,
116119 "node-cache" : " ^5.1.2" ,
148151 " prettier --write"
149152 ]
150153 }
151- }
154+ }
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1+ import Box from '@mui/material/Box' ;
2+ import Link from '@mui/material/Link' ;
3+ import Typography from '@mui/material/Typography' ;
4+ import { shell } from 'electron' ;
5+ import ReactMarkdown from 'markdown-to-jsx' ;
6+ import * as React from 'react' ;
7+
8+ function MarkdownListItem ( props : any ) {
9+ return < Box component = "li" sx = { { typography : 'body1' } } { ...props } /> ;
10+ }
11+
12+ const openExternalLink = ( event : React . SyntheticEvent , link : string ) => {
13+ event . preventDefault ( ) ;
14+ shell . openExternal ( link ) ;
15+ } ;
16+
17+ const ExternalLink : React . FC = ( { children } ) => (
18+ < Link
19+ href = "#"
20+ onClick = { e => openExternalLink ( e , children . toString ( ) ) }
21+ color = "secondary"
22+ underline = "hover"
23+ >
24+ { children }
25+ </ Link >
26+ ) ;
27+
28+ const options = {
29+ overrides : {
30+ h1 : {
31+ component : Typography ,
32+ props : {
33+ color : 'textPrimary' ,
34+ variant : 'h3' ,
35+ gutterBottom : true ,
36+ style : { fontWeight : 700 , marginTop : '1.5rem' }
37+ }
38+ } ,
39+ h2 : {
40+ component : Typography ,
41+ props : {
42+ color : 'textPrimary' ,
43+ variant : 'h5' ,
44+ gutterBottom : true ,
45+ style : { fontWeight : 600 , marginTop : '1rem' }
46+ }
47+ } ,
48+ p : {
49+ component : Typography ,
50+ props : {
51+ color : 'textPrimary' ,
52+ paragraph : true
53+ }
54+ } ,
55+ a : {
56+ component : ExternalLink
57+ } ,
58+ li : {
59+ component : MarkdownListItem
60+ }
61+ }
62+ } ;
63+
64+ export default function Markdown ( props : any ) {
65+ return < ReactMarkdown options = { options } { ...props } /> ;
66+ }
Original file line number Diff line number Diff line change 1+ declare module '*.md' {
2+ const content : string ;
3+ export default content ;
4+ }
15declare module '*.png' {
26 const value : any ;
37 export default value ;
You can’t perform that action at this time.
0 commit comments