mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
ui: better config page layout
This commit is contained in:
27 files changed
+748
-377
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import React from 'react';
|
||||
import { ToastContainer } from 'react-toastify';
|
||||
|
||||
interface C {
|
||||
i18n: (key: string, ...args: any[]) => string;
|
||||
theme: 'light' | 'dark';
|
||||
codeFontFamily: string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line
|
||||
export const ComponentsContext = React.createContext<C>({
|
||||
i18n: (key) => key,
|
||||
theme: 'light',
|
||||
codeFontFamily: 'monospace',
|
||||
});
|
||||
|
||||
export default function ComponentsProvider(props: { children: React.ReactNode } & C) {
|
||||
return <ComponentsContext.Provider value={props}>
|
||||
<ToastContainer
|
||||
position="bottom-left"
|
||||
autoClose={5000}
|
||||
hideProgressBar={false}
|
||||
newestOnTop={false}
|
||||
closeOnClick={false}
|
||||
rtl={false}
|
||||
pauseOnFocusLoss
|
||||
draggable
|
||||
pauseOnHover
|
||||
theme={props.theme}
|
||||
/>
|
||||
{props.children}
|
||||
</ComponentsContext.Provider>;
|
||||
}
|
||||
Reference in new issue
Block a user