suanmei
5 years ago
committed by
拾邑
23 changed files with 350 additions and 149 deletions
@ -1,11 +0,0 @@ |
|||
# `builder` |
|||
|
|||
> TODO: description |
|||
|
|||
## Usage |
|||
|
|||
``` |
|||
const builder = require('builder'); |
|||
|
|||
// TODO: DEMONSTRATE API |
|||
``` |
@ -1,30 +0,0 @@ |
|||
import * as React from 'react'; |
|||
import { Form, Input } from 'antd'; |
|||
import schemaEditor from 'json-schema-editor-visual'; |
|||
|
|||
const SchemaEditor = schemaEditor({}); |
|||
|
|||
const { Item } = Form; |
|||
|
|||
const Builder: React.FC<{}> = () => { |
|||
const labelCol = { span: 7 }; |
|||
|
|||
return ( |
|||
<div> |
|||
<Form labelCol={labelCol}> |
|||
<Item label="元件名称" name="name"> |
|||
<Input /> |
|||
</Item> |
|||
<Item label="元件描述" name="name"> |
|||
<Input /> |
|||
</Item> |
|||
<Item label="元件描述" name="name"> |
|||
<Input /> |
|||
</Item> |
|||
{/* <SchemaEditor /> */} |
|||
</Form> |
|||
</div> |
|||
); |
|||
}; |
|||
|
|||
export default Builder; |
@ -1 +0,0 @@ |
|||
declare module 'json-schema-editor-visual'; |
@ -0,0 +1,11 @@ |
|||
# `json-schema-editor` |
|||
|
|||
> TODO: description |
|||
|
|||
## Usage |
|||
|
|||
``` |
|||
const schemaEditor = require('@imove/json-schema-editor'); |
|||
|
|||
// TODO: DEMONSTRATE API |
|||
``` |
File diff suppressed because it is too large
@ -0,0 +1,20 @@ |
|||
import i18n from 'i18next'; |
|||
import { initReactI18next } from 'react-i18next'; |
|||
import * as en from './translations/en.json'; |
|||
import * as zh from './translations/zh.json'; |
|||
|
|||
i18n |
|||
.use(initReactI18next) // passes i18n down to react-i18next
|
|||
.init({ |
|||
fallbackLng: 'en', |
|||
resources: { |
|||
en, |
|||
zh, |
|||
}, |
|||
keySeparator: false, // we do not use keys in form messages.welcome
|
|||
interpolation: { |
|||
escapeValue: false, // react already safes from xss
|
|||
}, |
|||
}); |
|||
|
|||
export default i18n; |
@ -0,0 +1,3 @@ |
|||
{ |
|||
"home": "home" |
|||
} |
@ -0,0 +1,3 @@ |
|||
{ |
|||
"home": "首页" |
|||
} |
@ -0,0 +1,18 @@ |
|||
/** @jsx jsx */ |
|||
import { jsx } from '@emotion/core'; |
|||
import { Button } from 'antd'; |
|||
import { useTranslation } from 'react-i18next'; |
|||
import i18n from './i18n'; |
|||
|
|||
i18n.changeLanguage('en'); |
|||
|
|||
function JsonSchemaEditor(): JSX.Element { |
|||
const { t } = useTranslation(); |
|||
return ( |
|||
<div> |
|||
<Button>{t('home')}</Button> |
|||
</div> |
|||
); |
|||
} |
|||
|
|||
export default JsonSchemaEditor; |
Loading…
Reference in new issue