mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 15:26:02 +00:00
fix: hello sample
This commit is contained in:
parent
85d8c3ecaf
commit
3e30699581
@ -1,5 +1,10 @@
|
|||||||
import { TableOutlined } from '@ant-design/icons';
|
import { TableOutlined } from '@ant-design/icons';
|
||||||
import { SchemaComponentOptions, SchemaInitializer, SchemaInitializerContext } from '@nocobase/client';
|
import {
|
||||||
|
SchemaComponentOptions,
|
||||||
|
SchemaInitializer,
|
||||||
|
SchemaInitializerContext, SettingsCenterProvider
|
||||||
|
} from '@nocobase/client';
|
||||||
|
import { Card } from 'antd';
|
||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { HelloDesigner } from './HelloDesigner';
|
import { HelloDesigner } from './HelloDesigner';
|
||||||
@ -40,8 +45,23 @@ export default React.memo((props) => {
|
|||||||
component: 'HelloBlockInitializer',
|
component: 'HelloBlockInitializer',
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
|
<SettingsCenterProvider
|
||||||
|
settings={{
|
||||||
|
'sample-hello': {
|
||||||
|
title: 'Hello',
|
||||||
|
icon: 'ApiOutlined',
|
||||||
|
tabs: {
|
||||||
|
tab1: {
|
||||||
|
title: 'Hello tab',
|
||||||
|
component: () => <Card bordered={false}>Hello Settings</Card>,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<SchemaComponentOptions components={{ HelloDesigner, HelloBlockInitializer }}>
|
<SchemaComponentOptions components={{ HelloDesigner, HelloBlockInitializer }}>
|
||||||
<SchemaInitializerContext.Provider value={items}>{props.children}</SchemaInitializerContext.Provider>
|
<SchemaInitializerContext.Provider value={items}>{props.children}</SchemaInitializerContext.Provider>
|
||||||
</SchemaComponentOptions>
|
</SchemaComponentOptions>
|
||||||
|
</SettingsCenterProvider>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user