File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,15 @@ function CodeBlock(props) {
27
27
) ;
28
28
}
29
29
30
+ function InlineImage ( { alt, title, src } ) {
31
+ return (
32
+ < div class = { style . inlineImageContainer } >
33
+ < img class = { style . inlineImage } src = { src } alt = { alt } />
34
+ { title && < span class = { style . inlineImageTitle } > { title } </ span > }
35
+ </ div >
36
+ ) ;
37
+ }
38
+
30
39
function getBlogBody ( data , isLoading ) {
31
40
if ( isLoading ) {
32
41
return (
@@ -52,6 +61,9 @@ function getBlogBody(data, isLoading) {
52
61
< div class = { style . blogbody } >
53
62
< Markdown options = { {
54
63
overrides : {
64
+ img : {
65
+ component : InlineImage
66
+ } ,
55
67
code : {
56
68
component : CodeBlock
57
69
}
Original file line number Diff line number Diff line change @@ -105,3 +105,22 @@ code.inline {
105
105
.loadingBody : nth-child (3 ) {
106
106
width : 65% ;
107
107
}
108
+
109
+ .inlineImageContainer {
110
+ display : flex;
111
+ flex-direction : column;
112
+ justify-content : center;
113
+ align-items : center;
114
+ width : 80% ;
115
+ margin : 32px auto;
116
+ }
117
+
118
+ .inlineImage {
119
+ max-width : 100% ;
120
+ }
121
+
122
+ .inlineImageTitle {
123
+ font-size : 0.8rem ;
124
+ margin-top : 8px ;
125
+ color : # 777 ;
126
+ }
You can’t perform that action at this time.
0 commit comments