11import React , { Component } from "react" ;
22import Grid from "@material-ui/core/Grid" ;
3- import { Card , CardContent } from "@material-ui/core" ;
3+ import { Card , CardContent , Theme , withStyles , WithStyles } from "@material-ui/core" ;
44import ReactJson from "react-json-view" ;
55import ReactMarkdown from "react-markdown" ;
66import { MethodObject , ExampleObject , ExamplePairingObject } from "@open-rpc/meta-schema" ;
77import _ from "lodash" ;
88
9- interface IProps {
9+ interface IProps extends WithStyles < typeof styles > {
1010 examplePosition ?: number ;
1111 method ?: MethodObject ;
1212 reactJsonOptions ?: any ;
1313}
1414
15- export default class ExamplePairing extends Component < IProps , { } > {
15+ const styles = ( theme : Theme ) => ( {
16+ description : {
17+ color : theme . palette . text . primary ,
18+ } ,
19+ } ) ;
20+
21+ class ExamplePairing extends Component < IProps , { } > {
1622 public render ( ) {
17- const { examplePosition, method } = this . props ;
23+ const { examplePosition, method, classes } = this . props ;
1824 if ( _ . isUndefined ( examplePosition ) ) {
1925 return null ;
2026 }
@@ -28,7 +34,7 @@ export default class ExamplePairing extends Component<IProps, {}> {
2834 return (
2935 < Grid container spacing = { 24 } >
3036 < Grid item xs = { 12 } >
31- < ReactMarkdown source = { example . description } />
37+ < ReactMarkdown source = { example . description } className = { classes . description } />
3238 </ Grid >
3339 < Grid item xs = { 6 } >
3440 < Card >
@@ -57,3 +63,5 @@ export default class ExamplePairing extends Component<IProps, {}> {
5763 ) ;
5864 }
5965}
66+
67+ export default withStyles ( styles ) ( ExamplePairing ) ;
0 commit comments