File tree Expand file tree Collapse file tree 4 files changed +13
-18109
lines changed
Expand file tree Collapse file tree 4 files changed +13
-18109
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " gitea-react-toolkit" ,
3- "version" : " 1.3.13 " ,
3+ "version" : " 1.3.14-rc.1 " ,
44 "license" : " MIT" ,
55 "description" : " A Gitea API React Toolkit Component Library" ,
66 "homepage" : " https://gitea-react-toolkit.netlify.com/" ,
1818 "localforage" : " 1.7.3" ,
1919 "markdown-translatable" : " 1.2.8" ,
2020 "prop-types" : " 15.7.2" ,
21- "react-json-view" : " ^1.19.1" ,
2221 "use-deep-compare-effect" : " ^1.3.1" ,
2322 "utf8" : " 3.0.0"
2423 },
Original file line number Diff line number Diff line change 11import React , { useState , useCallback } from 'react' ;
22import PropTypes from 'prop-types' ;
3- import ReactJson from 'react-json-view' ;
43import { Paper , Button } from '@material-ui/core' ;
54
65import { useAuthentication } from '..' ;
@@ -37,17 +36,17 @@ function Core({
3736 }
3837
3938 if ( response ) {
40- responseComponent = < ReactJson src = { response } / >;
39+ responseComponent = < div > { JSON . stringify ( response ) } </ div > ;
4140 } else if ( loading ) {
42- responseComponent = < ReactJson src = { { pending : true } } /> ;
41+ responseComponent = < div /> ;
4342 } else if ( ! response && typeof ( response ) !== 'undefined' && ! loading ) {
4443 responseComponent = 'No response' ;
4544 }
4645 return (
4746 < >
4847 < h3 > Props</ h3 >
4948 < Paper >
50- < ReactJson src = { props } / >
49+ < div > { JSON . stringify ( props ) } </ div >
5150 </ Paper >
5251 < h3 > Response</ h3 >
5352 < Paper >
Original file line number Diff line number Diff line change @@ -12,9 +12,16 @@ const strings = {
1212} ;
1313
1414export const localString = ( id ) => {
15- let lang = navigator . language . split ( / - | _ / ) [ 0 ] ;
15+ let lang = null ;
16+
17+ if ( typeof window !== 'undefined' )
18+ {
19+ if ( navigator ) {
20+ lang = navigator . language . split ( / - | _ / ) [ 0 ] ;
21+ }
22+ }
1623 // if language is unknown (not sure this can actually happen)
17- if ( lang === undefined ) {
24+ if ( ! lang ) {
1825 lang = 'en' ;
1926 }
2027 // if there are no strings for the language
You can’t perform that action at this time.
0 commit comments