File tree Expand file tree Collapse file tree 4 files changed +59
-3
lines changed
packages/react-renderer-demo
src/components/navigation Expand file tree Collapse file tree 4 files changed +59
-3
lines changed Original file line number Diff line number Diff line change 38
38
"firebase-admin" : " ^8.5.0" ,
39
39
"firebase-functions" : " ^2.1.0" ,
40
40
"grpc" : " ^1.22.2" ,
41
+ "markdown-to-jsx" : " ^6.10.3" ,
41
42
"next" : " 9.1.2" ,
42
43
"patternfly-react" : " ^2.25.1" ,
43
44
"prop-types" : " ^15.6.2" ,
Original file line number Diff line number Diff line change
1
+ import React , { useEffect , useState } from 'react' ;
2
+ import Grid from '@material-ui/core/Grid' ;
3
+ import CircularProgress from '@material-ui/core/CircularProgress' ;
4
+ import Markdown from 'markdown-to-jsx' ;
5
+ import { Heading } from '../src/components/mdx/mdx-components' ;
6
+ import mdxComponents from '@docs/components/mdx/mdx-components' ;
7
+
8
+ const options = {
9
+ overrides : { a : mdxComponents . link } ,
10
+ } ;
11
+
12
+ const parseData = data => data . map ( ( release ) => (
13
+ < React . Fragment key = { release . name } >
14
+ < Markdown options = { options } > { release . body } </ Markdown >
15
+ </ React . Fragment >
16
+ ) ) ;
17
+
18
+ const ReleasesPage = ( ) => {
19
+ const [ data , setData ] = useState ( undefined ) ;
20
+
21
+ useEffect ( ( ) => {
22
+ fetch ( 'https://api.github.com/repos/data-driven-forms/react-forms/releases?page=1' )
23
+ . then ( res => res . json ( ) )
24
+ . then ( ( data ) => {
25
+ setData ( parseData ( data ) ) ;
26
+ } )
27
+ . catch ( ( ) => {
28
+ setData ( 'Something wrong happened :(' ) ;
29
+ } ) ;
30
+ } , [ ] ) ;
31
+
32
+ return ( < div >
33
+ < Heading level = "4" component = "h1" > Releases</ Heading >
34
+ { ! data ? ( < Grid
35
+ container
36
+ direction = "row"
37
+ justify = "center"
38
+ alignItems = "center"
39
+ >
40
+ < CircularProgress disableShrink />
41
+ </ Grid > ) : data }
42
+ </ div > ) ;
43
+ } ;
44
+
45
+ export default ReleasesPage ;
Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ const schema = [
7
7
{
8
8
linkText : 'Live Form Editor' ,
9
9
link : 'live-editor' ,
10
- } ,
11
- {
10
+ } , {
12
11
title : 'React form renderer' ,
13
12
link : 'renderer' ,
14
13
noRoute : true ,
@@ -31,6 +30,9 @@ const schema = [
31
30
fields : [
32
31
...otherExamples ,
33
32
] ,
33
+ } , {
34
+ linkText : 'Releases' ,
35
+ link : 'releases' ,
34
36
} ,
35
37
] ;
36
38
Original file line number Diff line number Diff line change @@ -11586,6 +11586,14 @@ markdown-escapes@^1.0.0:
11586
11586
version "1.0.3"
11587
11587
resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.3.tgz#6155e10416efaafab665d466ce598216375195f5"
11588
11588
11589
+ markdown-to-jsx@^6.10.3:
11590
+ version "6.10.3"
11591
+ resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-6.10.3.tgz#7f0946684acd321125ff2de7fd258a9b9c7c40b7"
11592
+ integrity sha512-PSoUyLnW/xoW6RsxZrquSSz5eGEOTwa15H5eqp3enmrp8esmgDJmhzd6zmQ9tgAA9TxJzx1Hmf3incYU/IamoQ==
11593
+ dependencies:
11594
+ prop-types "^15.6.2"
11595
+ unquote "^1.1.0"
11596
+
11589
11597
marked-terminal@^3.0.0, marked-terminal@^3.2.0, marked-terminal@^3.3.0:
11590
11598
version "3.3.0"
11591
11599
resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-3.3.0.tgz#25ce0c0299285998c7636beaefc87055341ba1bd"
17507
17515
version "1.0.0"
17508
17516
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
17509
17517
17510
- unquote@~1.1.1:
17518
+ unquote@^1.1.0, unquote@ ~1.1.1:
17511
17519
version "1.1.1"
17512
17520
resolved "https://registry.yarnpkg.com/unquote/-/unquote-1.1.1.tgz#8fded7324ec6e88a0ff8b905e7c098cdc086d544"
17513
17521
You can’t perform that action at this time.
0 commit comments