Skip to content

Commit 9163190

Browse files
committed
Small update to demo
1 parent 941547f commit 9163190

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ However, you can pass in your own theme object, or part thereof. The theme struc
215215

216216
```
217217

218-
The `styles` property is the main one to focus on. Each key (`property`, `bracket`, `itemCount`) refers to a part of the UI. The value for each key is *either* a `string`, in which case it is interpreted as the colour (or background colour in the case of `container` and `inputHighlight`), *or* a full CSS style object for fine-grained definition. You only need to provide properties you wish to override — all unspecified ones will fallback to either the default theme, or another theme that you specify as the "base".
218+
The `styles` property is the main one to focus on. Each key (`property`, `bracket`, `itemCount`) refers to a part of the UI. The value for each key is *either* a `string`, in which case it is interpreted as the colour (or background colour in the case of `container` and `inputHighlight`), *or* a full CSS style object for fine-grained definition. You only need to provide properties you wish to override — all unspecified ones will fallback to either the default theme, or another theme that you specify as the "base".
219219

220220
For example, if you want to use the "githubDark" theme, but just change a couple of small things, you'd specify something like this:
221221

demo/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useEffect, useRef } from 'react'
2-
import { JsonEditor, ThemeName, Theme, themes } from './json-edit-react/src'
2+
// import { JsonEditor, ThemeName, Theme, themes } from './json-edit-react/src'
3+
import { JsonEditor, ThemeName, Theme, themes } from 'json-edit-react'
34
import { FaNpm, FaExternalLinkAlt, FaGithub } from 'react-icons/fa'
45
import { BiReset } from 'react-icons/bi'
56
import { AiOutlineCloudUpload } from 'react-icons/ai'

demo/src/data.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ const data = {
4343
'To start a new line': 'Shift/Ctrl/Cmd-Enter (or just "Enter" when editing JSON nodes)',
4444
'When copying to clipboard': 'Hold down "Ctrl/Cmd" to copy path instead of data',
4545
},
46-
object: {
47-
name: 'Basic object data',
48-
info: 'You can edit individual values, or even a whole object node at once.',
49-
},
5046
},
5147
},
5248
starWars: {
@@ -70,7 +66,7 @@ const data = {
7066
</Text>
7167
</Flex>
7268
),
73-
// restrictEdit: ({ value }) => typeof value === 'object' && value !== null,
69+
restrictEdit: ({ value }) => typeof value === 'object' && value !== null,
7470
restrictDelete: ({ value }) => typeof value === 'object' && value !== null,
7571
restrictAdd: ({ value }) => !Array.isArray(value),
7672
collapse: 1,

0 commit comments

Comments
 (0)