File tree Expand file tree Collapse file tree 4 files changed +56
-3
lines changed
packages/react-renderer-demo
src/components/navigation Expand file tree Collapse file tree 4 files changed +56
-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+
7+ const parseData = data => data . map ( ( release ) => {
8+ return (
9+ < React . Fragment key = { release . name } >
10+ < Markdown > { release . body } </ Markdown >
11+ </ React . Fragment >
12+ ) ;
13+ } ) ;
14+
15+ const ReleasesPage = ( ) => {
16+ const [ data , setData ] = useState ( undefined ) ;
17+
18+ useEffect ( ( ) => {
19+ fetch ( 'https://api.github.com/repos/data-driven-forms/react-forms/releases?page=1' )
20+ . then ( res => res . json ( ) )
21+ . then ( ( data ) => {
22+ setData ( parseData ( data ) ) ;
23+ } )
24+ . catch ( ( ) => {
25+ setData ( 'Something wrong happened :(' ) ;
26+ } ) ;
27+ } , [ ] ) ;
28+
29+ return ( < div >
30+ < Heading level = "4" component = "h1" > Releases</ Heading >
31+ { ! data ? ( < Grid
32+ container
33+ direction = "row"
34+ justify = "center"
35+ alignItems = "center"
36+ >
37+ < CircularProgress disableShrink />
38+ </ Grid > ) : data }
39+ </ div > ) ;
40+ } ;
41+
42+ export default ReleasesPage ;
Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ const schema = [
77 {
88 linkText : 'Live Form Editor' ,
99 link : 'live-editor' ,
10- } ,
11- {
10+ } , {
11+ linkText : 'Releases' ,
12+ link : 'releases' ,
13+ } , {
1214 title : 'React form renderer' ,
1315 link : 'renderer' ,
1416 noRoute : true ,
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"
@@ -17507,7 +17515,7 @@ unpipe@1.0.0, unpipe@~1.0.0:
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