Skip to content

Commit 4af84b5

Browse files
committed
inlog gefixed
1 parent 4e8aecf commit 4af84b5

File tree

11 files changed

+404
-46
lines changed

11 files changed

+404
-46
lines changed

Diff for: app/app.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const client = based(basedConfig)
88

99
const App = () => {
1010
const { data: counter, loading } = useQuery('counter')
11+
1112
return (
1213
<div
1314
style={{

Diff for: cms/App.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ export const App = () => {
3030
$id: authState.userId,
3131
profileImg: true,
3232
})
33-
if (!authState.userId) return <Login />
33+
34+
// if (!authState.userId) return <Login />
3435

3536
const { data: schema, loading: loadingSchema } = useQuery('db:schema')
3637

3738
const [selectedLang, setSelectedLang] = useState(schema?.languages[0])
3839

39-
// console.log(schema, 'Schema')
40-
41-
return (
40+
return !authState.userId ? (
41+
<Login />
42+
) : (
4243
<styled.div
4344
style={{
4445
display: 'flex',

Diff for: cms/Docs/SchemaDocs/Descriptions.tsx

+51
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,55 @@ export const Description = ({ field }) => {
99
</Text>
1010
)
1111
}
12+
13+
if (field === 'Text') {
14+
return <></>
15+
}
16+
if (field === 'Rich Text') {
17+
return <>xx</>
18+
}
19+
if (field === 'Number') {
20+
return (
21+
<Text>
22+
Primitive data type: number which can be storad as floating point
23+
numbers. Use if you need decimals.
24+
</Text>
25+
)
26+
}
27+
if (field === 'Int') {
28+
return <></>
29+
}
30+
if (field === 'Enum') {
31+
return <></>
32+
}
33+
if (field === 'Boolean') {
34+
return <></>
35+
}
36+
if (field === 'Timestamp') {
37+
return <></>
38+
}
39+
if (field === 'Array') {
40+
return <></>
41+
}
42+
if (field === 'Object') {
43+
return <></>
44+
}
45+
if (field === 'Record') {
46+
return <></>
47+
}
48+
if (field === 'Set') {
49+
return <></>
50+
}
51+
if (field === 'JSON') {
52+
return <></>
53+
}
54+
if (field === 'Reference') {
55+
return <></>
56+
}
57+
if (field === 'References') {
58+
return <></>
59+
}
60+
if (field === 'Cardinality') {
61+
return <></>
62+
}
1263
}

Diff for: cms/Docs/SchemaDocs/FieldOptions.tsx

+116-24
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,53 @@ const StyledTable = styled('table', {
2020
fontWeight: '600',
2121
minWidth: '164px',
2222
},
23+
'& tr td:last-child': {
24+
color: color('content', 'default', 'secondary'),
25+
},
26+
2327
'& td': {
2428
padding: '8px 12px',
2529
},
2630
})
2731

32+
const SharedOptions = () => {
33+
return (
34+
<>
35+
{' '}
36+
<tr>
37+
<td>name</td>
38+
<td>api field name used in the sdk and clients</td>
39+
</tr>
40+
<tr>
41+
<td>Display name</td>
42+
<td>cms display name</td>
43+
</tr>
44+
<tr>
45+
<td>Description</td>
46+
<td>description for in the cms</td>
47+
</tr>
48+
<tr>
49+
<td>Is Required</td>
50+
<td>this field can'be empty</td>
51+
</tr>
52+
<tr>
53+
<td>Read only</td>
54+
<td></td>
55+
</tr>
56+
<tr>
57+
<td>Write only</td>
58+
<td></td>
59+
</tr>
60+
</>
61+
)
62+
}
63+
2864
export const FieldOptions = ({ field }) => {
2965
if (field === 'String') {
3066
return (
3167
<>
3268
<StyledTable>
33-
<tr>
34-
<td>name</td>
35-
<td>api field name used in the sdk and clients</td>
36-
</tr>
37-
<tr>
38-
<td>Display name</td>
39-
<td>cms display name</td>
40-
</tr>
41-
<tr>
42-
<td>Description</td>
43-
<td>description for in the cms</td>
44-
</tr>
45-
<tr>
46-
<td>Is Required</td>
47-
<td>this field can'be empty</td>
48-
</tr>
49-
<tr>
50-
<td>Read only</td>
51-
<td></td>
52-
</tr>
53-
<tr>
54-
<td>Write only</td>
55-
<td></td>
56-
</tr>
69+
<SharedOptions />
5770
<tr>
5871
<td>Format</td>
5972
<td>
@@ -110,4 +123,83 @@ export const FieldOptions = ({ field }) => {
110123
</>
111124
)
112125
}
126+
127+
if (field === 'Text') {
128+
return <></>
129+
}
130+
if (field === 'Rich Text') {
131+
return <>xx</>
132+
}
133+
if (field === 'Number') {
134+
return (
135+
<>
136+
<StyledTable>
137+
<SharedOptions />
138+
<tr>
139+
<td>Minimum</td>
140+
<td>Minimum required value</td>
141+
</tr>
142+
<tr>
143+
<td>Maximum</td>
144+
<td>Maximum required value</td>
145+
</tr>
146+
<tr>
147+
<td>Multiple of</td>
148+
<td>Value must be a multiple of a certain number</td>
149+
</tr>
150+
<tr>
151+
<td>Exclusive Maximum</td>
152+
<td></td>
153+
</tr>
154+
<tr>
155+
<td>Exclusive Minimum</td>
156+
<td></td>
157+
</tr>
158+
<tr>
159+
<td>Display Format</td>
160+
<td>
161+
short | human | ratio | bytes | euro | dollar | pound |
162+
round-number
163+
</td>
164+
</tr>
165+
</StyledTable>
166+
</>
167+
)
168+
}
169+
if (field === 'Int') {
170+
return <></>
171+
}
172+
if (field === 'Enum') {
173+
return <></>
174+
}
175+
if (field === 'Boolean') {
176+
return <></>
177+
}
178+
if (field === 'Timestamp') {
179+
return <></>
180+
}
181+
if (field === 'Array') {
182+
return <></>
183+
}
184+
if (field === 'Object') {
185+
return <></>
186+
}
187+
if (field === 'Record') {
188+
return <></>
189+
}
190+
if (field === 'Set') {
191+
return <></>
192+
}
193+
if (field === 'JSON') {
194+
return <></>
195+
}
196+
if (field === 'Reference') {
197+
return <></>
198+
}
199+
if (field === 'References') {
200+
return <></>
201+
}
202+
if (field === 'Cardinality') {
203+
return <></>
204+
}
113205
}

Diff for: cms/Docs/SchemaDocs/FieldTemplate.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@ export const FieldTemplate = ({ field }) => {
3535
{field}
3636
</Text>
3737
</Row>
38-
<div style={{ marginBottom: 36 }}>
38+
<div style={{ marginBottom: 46 }}>
3939
<Text size={20} weight="strong" style={{ marginBottom: 12 }}>
4040
Description
4141
</Text>
4242
<Description field={field} />
4343
</div>
4444

45-
<div style={{ marginBottom: 36 }}>
45+
<div style={{ marginBottom: 46 }}>
4646
<Text size={20} weight="strong" style={{ marginBottom: 12 }}>
4747
Screenshots
4848
</Text>
4949
<Screenshots field={field} />
5050
</div>
5151

52-
<div style={{ marginBottom: 36 }}>
52+
<div style={{ marginBottom: 46 }}>
5353
<Text size={20} weight="strong" style={{ marginBottom: 12 }}>
5454
Field Options
5555
</Text>
5656
<FieldOptions field={field} />
5757
</div>
5858

59-
<div style={{ marginBottom: 36 }}>
59+
<div style={{ marginBottom: 46 }}>
6060
<Text size={20} weight="strong" style={{ marginBottom: 12 }}>
6161
Set and Get your field
6262
</Text>

Diff for: cms/Docs/SchemaDocs/Screenshots.tsx

+54
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import { styled } from 'inlines'
33
import { color, Text } from '@based/ui'
44
import string_screen from '../assets/img/string_screen.png'
5+
import number_screen from '../assets/img/number_screen.png'
56

67
const StyledImg = styled('img', {
78
maxWidth: 767,
@@ -21,4 +22,57 @@ export const Screenshots = ({ field }) => {
2122
</>
2223
)
2324
}
25+
26+
if (field === 'Text') {
27+
return <></>
28+
}
29+
if (field === 'Rich Text') {
30+
return <>xx</>
31+
}
32+
if (field === 'Number') {
33+
return (
34+
<>
35+
<StyledImg src={number_screen} />
36+
<Text>
37+
<i>SchemaType contains a field of type 'number'.</i>
38+
</Text>
39+
</>
40+
)
41+
}
42+
if (field === 'Int') {
43+
return <></>
44+
}
45+
if (field === 'Enum') {
46+
return <></>
47+
}
48+
if (field === 'Boolean') {
49+
return <></>
50+
}
51+
if (field === 'Timestamp') {
52+
return <></>
53+
}
54+
if (field === 'Array') {
55+
return <></>
56+
}
57+
if (field === 'Object') {
58+
return <></>
59+
}
60+
if (field === 'Record') {
61+
return <></>
62+
}
63+
if (field === 'Set') {
64+
return <></>
65+
}
66+
if (field === 'JSON') {
67+
return <></>
68+
}
69+
if (field === 'Reference') {
70+
return <></>
71+
}
72+
if (field === 'References') {
73+
return <></>
74+
}
75+
if (field === 'Cardinality') {
76+
return <></>
77+
}
2478
}

0 commit comments

Comments
 (0)