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 3838 "firebase-admin" : " ^8.5.0" ,
3939 "firebase-functions" : " ^2.1.0" ,
4040 "grpc" : " ^1.22.2" ,
41+ "markdown-to-jsx" : " ^6.10.3" ,
4142 "next" : " 9.1.2" ,
4243 "patternfly-react" : " ^2.25.1" ,
4344 "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 = [
77 {
88 linkText : 'Live Form Editor' ,
99 link : 'live-editor' ,
10- } ,
11- {
10+ } , {
1211 title : 'React form renderer' ,
1312 link : 'renderer' ,
1413 noRoute : true ,
@@ -31,6 +30,9 @@ const schema = [
3130 fields : [
3231 ...otherExamples ,
3332 ] ,
33+ } , {
34+ linkText : 'Releases' ,
35+ link : 'releases' ,
3436 } ,
3537] ;
3638
Original file line number Diff line number Diff line change @@ -11586,6 +11586,14 @@ markdown-escapes@^1.0.0:
1158611586 version "1.0.3"
1158711587 resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.3.tgz#6155e10416efaafab665d466ce598216375195f5"
1158811588
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+
1158911597marked-terminal@^3.0.0, marked-terminal@^3.2.0, marked-terminal@^3.3.0:
1159011598 version "3.3.0"
1159111599 resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-3.3.0.tgz#25ce0c0299285998c7636beaefc87055341ba1bd"
1750717515 version "1.0.0"
1750817516 resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
1750917517
17510- unquote@~1.1.1:
17518+ unquote@^1.1.0, unquote@ ~1.1.1:
1751117519 version "1.1.1"
1751217520 resolved "https://registry.yarnpkg.com/unquote/-/unquote-1.1.1.tgz#8fded7324ec6e88a0ff8b905e7c098cdc086d544"
1751317521
You can’t perform that action at this time.
0 commit comments