Skip to content

Commit 711903f

Browse files
feature-zach-serverSide-577
1 parent 4773237 commit 711903f

File tree

4 files changed

+13
-18109
lines changed

4 files changed

+13
-18109
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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/",
@@ -18,7 +18,6 @@
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
},

src/components/core/Core.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useState, useCallback } from 'react';
22
import PropTypes from 'prop-types';
3-
import ReactJson from 'react-json-view';
43
import { Paper, Button } from '@material-ui/core';
54

65
import { 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>

src/core/localStrings.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@ const strings = {
1212
};
1313

1414
export 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

0 commit comments

Comments
 (0)