Skip to content

Commit 7005bef

Browse files
committed
Added Examples
1 parent 0e9d139 commit 7005bef

File tree

2 files changed

+46
-45
lines changed

2 files changed

+46
-45
lines changed

src/App.tsx

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,26 @@ const useStyles = makeStyles((_theme) => ({
5252
}));
5353

5454
const initialData = {
55-
username: 'user4',
56-
password: 'password4',
57-
discord_login: {
58-
token: 'NTQ1MjgxODU1OTg2MDczNjEw.YWuEdw.CEjOpdgaqPYJGEn5cT4gFKBsnlrk',
59-
imgur_id: "32d4aa908e8018b",
60-
},
61-
messages: [
62-
{
63-
message: "This is First Message",
64-
image: "/home/silox/Pictures/image1.jpeg"
65-
},
66-
],
67-
channels: [
68-
{
69-
server_id: "1",
70-
channel_id: "898129644522459136",
71-
post_every: 0.5,
72-
image: true
73-
},
74-
]
55+
// username: 'johndoe',
56+
// password: 'password4',
57+
// discord_login: {
58+
// token: 'NTQ1MjgxODU1OTg2MDczNjEw.YWuEdw.CEjOpdgaqPYJGEn5cT4gFKBsnlrk',
59+
// imgur_id: "32d4aa908e8018b",
60+
// },
61+
// messages: [
62+
// {
63+
// message: "This is First Message",
64+
// image: "/home/silox/Pictures/image1.jpeg"
65+
// },
66+
// ],
67+
// channels: [
68+
// {
69+
// server_id: "1",
70+
// channel_id: "898129644522459136",
71+
// post_every: 0.5,
72+
// image: true
73+
// },
74+
// ]
7575
};
7676

7777
const renderers = [
@@ -117,13 +117,29 @@ const App = () => {
117117
spacing={1}
118118
className={classes.container}
119119
>
120-
<Grid item sm={6}>
120+
{/* <Grid item sm={12}>
121121
<Typography variant={'h3'} className={classes.title}>
122122
JSON data
123123
</Typography>
124124
<div className={classes.dataContent}>
125125
<pre id='boundData'>{displayDataAsString}</pre>
126126
</div>
127+
128+
</Grid> */}
129+
<Grid item sm={10}>
130+
<Typography variant={'h3'} className={classes.title}>
131+
Config Generator
132+
</Typography>
133+
<div className={classes.demoform}>
134+
<JsonForms
135+
schema={schema}
136+
uischema={uischema}
137+
data={jsonformsData}
138+
renderers={renderers}
139+
cells={materialCells}
140+
onChange={({ errors, data }) => setJsonformsData(data)}
141+
/>
142+
</div>
127143
<div className={classes.button}>
128144
<Button
129145
className={classes.resetButton}
@@ -143,21 +159,6 @@ const App = () => {
143159
</Button>
144160
</div>
145161
</Grid>
146-
<Grid item sm={6}>
147-
<Typography variant={'h3'} className={classes.title}>
148-
Rendered form
149-
</Typography>
150-
<div className={classes.demoform}>
151-
<JsonForms
152-
schema={schema}
153-
uischema={uischema}
154-
data={jsonformsData}
155-
renderers={renderers}
156-
cells={materialCells}
157-
onChange={({ errors, data }) => setJsonformsData(data)}
158-
/>
159-
</div>
160-
</Grid>
161162
</Grid>
162163
</Fragment>
163164
);

src/schema.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"$id": "#/properties/username",
5858
"type": "string",
5959
"title": "Your discord-bot username",
60-
"description": "Enter your username.",
60+
"description": "Enter your username. (eg. john)",
6161
"default": "",
6262
"examples": [
6363
"user4"
@@ -67,7 +67,7 @@
6767
"$id": "#/properties/password",
6868
"type": "string",
6969
"title": "Your discord-bot password",
70-
"description": "Enter your password",
70+
"description": "Enter your password. (eg. johnjohn1)",
7171
"default": "",
7272
"examples": [
7373
"password4"
@@ -94,7 +94,7 @@
9494
"$id": "#/properties/discord_login/properties/token",
9595
"type": "string",
9696
"title": "Discord token",
97-
"description": "Can be found in the Local Storage of chrome dev tools",
97+
"description": "Can be found in the Local Storage of chrome dev tools (eg. NTQ1MjgxODU1OTg2MDczNjEw.YWuEdw.test2099)",
9898
"default": "",
9999
"examples": [
100100
"NTQ1MjgxODU1OTg2MDczNjEw.YWuEdw.test2099"
@@ -104,7 +104,7 @@
104104
"$id": "#/properties/discord_login/properties/imgur_id",
105105
"type": "string",
106106
"title": "Imgur token",
107-
"description": "Enter you Imgur client id",
107+
"description": "Enter you Imgur client id (eg. 32d4aa908e8019b)",
108108
"default": "",
109109
"examples": [
110110
"32d4aa908e8019b"
@@ -156,7 +156,7 @@
156156
"$id": "#/properties/messages/items/anyOf/0/properties/message",
157157
"type": "string",
158158
"title": "Message",
159-
"description": "",
159+
"description": "Enter your message here (eg. This is a Message)",
160160
"default": "",
161161
"examples": [
162162
"This is First Message"
@@ -166,7 +166,7 @@
166166
"$id": "#/properties/messages/items/anyOf/0/properties/image",
167167
"type": "string",
168168
"title": "Path to image",
169-
"description": "Enter full path",
169+
"description": "Enter full path (eg. C:\\home\\silox\\Pictures\\image1.jpeg)",
170170
"default": "",
171171
"examples": [
172172
"/home/silox/Pictures/image1.jpeg"
@@ -229,7 +229,7 @@
229229
"$id": "#/properties/channels/items/anyOf/0/properties/server_id",
230230
"type": "string",
231231
"title": "server_id",
232-
"description": "Server id of the channel belongs to",
232+
"description": "Enter server ID (eg. 1)",
233233
"default": "",
234234
"examples": [
235235
""
@@ -239,7 +239,7 @@
239239
"$id": "#/properties/channels/items/anyOf/0/properties/channel_id",
240240
"type": "string",
241241
"title": "channel_id",
242-
"description": "Id of channel to post to",
242+
"description": "Enter channel ID (eg. 898129644522459136)",
243243
"default": "",
244244
"examples": [
245245
"898129644522459136"
@@ -249,7 +249,7 @@
249249
"$id": "#/properties/channels/items/anyOf/0/properties/post_every",
250250
"type": "number",
251251
"title": "Time between 2 messages",
252-
"description": "Enter time in minutes",
252+
"description": "Enter time in minutes (eg. 5.0)",
253253
"default": 5.0,
254254
"examples": [
255255
0.5

0 commit comments

Comments
 (0)