mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:06:06 +00:00
fix(acl): import SettingsCenterContext
This commit is contained in:
parent
7e9f3dfa17
commit
fe989bb71c
@ -1,7 +1,8 @@
|
||||
import { Checkbox, message, Table } from 'antd';
|
||||
import React, { createContext, useContext, useState } from 'react';
|
||||
import React, { createContext, useContext } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useAPIClient, useRequest } from '../../api-client';
|
||||
import { SettingsCenterContext } from '../../pm';
|
||||
import { useRecord } from '../../record-provider';
|
||||
import { useCompile } from '../../schema-component';
|
||||
|
||||
@ -28,19 +29,8 @@ const getChildrenKeys = (data = [], arr = []) => {
|
||||
|
||||
const SettingMenuContext = createContext(null);
|
||||
|
||||
function useGetContext() {
|
||||
const [context, setContext] = useState(null);
|
||||
import('../../pm').then(({ SettingsCenterContext }) => {
|
||||
setContext(SettingsCenterContext);
|
||||
});
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
export const SettingCenterProvider = (props) => {
|
||||
const context = useGetContext();
|
||||
const configureItems = context && useContext(context);
|
||||
|
||||
const configureItems = useContext(SettingsCenterContext);
|
||||
return <SettingMenuContext.Provider value={configureItems}>{props.children}</SettingMenuContext.Provider>;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user