Prompt 的 form 主题保持一致
This commit is contained in:
parent
b4819a7a5a
commit
9744ff5ba6
|
@ -201,7 +201,8 @@ export class Alert extends React.Component<AlertProps, AlertState> {
|
|||
title,
|
||||
confirmBtnLevel,
|
||||
alertBtnLevel,
|
||||
classnames: cx
|
||||
classnames: cx,
|
||||
theme
|
||||
} = this.props;
|
||||
const __ = this.props.translate;
|
||||
const finalTitle = __(this.state.title ?? title);
|
||||
|
@ -226,7 +227,8 @@ export class Alert extends React.Component<AlertProps, AlertState> {
|
|||
this.state.controls,
|
||||
this.state.value,
|
||||
this.handleFormSubmit,
|
||||
this.scopeRef
|
||||
this.scopeRef,
|
||||
theme
|
||||
)
|
||||
) : (
|
||||
<Html html={this.state.content} />
|
||||
|
@ -258,7 +260,8 @@ function renderForm(
|
|||
controls: Array<any>,
|
||||
value: PlainObject = {},
|
||||
callback?: (values: PlainObject) => void,
|
||||
scopeRef?: (value: any) => void
|
||||
scopeRef?: (value: any) => void,
|
||||
theme?: string
|
||||
) {
|
||||
return renderSchema(
|
||||
{
|
||||
|
@ -271,7 +274,8 @@ function renderForm(
|
|||
{
|
||||
data: value,
|
||||
onFinished: callback,
|
||||
scopeRef
|
||||
scopeRef,
|
||||
theme
|
||||
},
|
||||
{
|
||||
session: 'prompt'
|
||||
|
|
|
@ -120,10 +120,11 @@ export interface ThemeProps {
|
|||
className?: string;
|
||||
classPrefix: string;
|
||||
classnames: ClassNamesFn;
|
||||
theme?: string;
|
||||
}
|
||||
|
||||
export const ThemeContext = React.createContext('theme');
|
||||
export let defaultTheme: string = 'default';
|
||||
export const ThemeContext = React.createContext(undefined);
|
||||
|
||||
export function themeable<
|
||||
T extends React.ComponentType<React.ComponentProps<T> & ThemeProps> & {
|
||||
|
@ -156,9 +157,11 @@ export function themeable<
|
|||
const injectedProps: {
|
||||
classPrefix: string;
|
||||
classnames: ClassNamesFn;
|
||||
theme: string;
|
||||
} = {
|
||||
classPrefix: config.classPrefix as string,
|
||||
classnames: config.classnames
|
||||
classnames: config.classnames,
|
||||
theme
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue