ci: Prettier纳入两层防御体系 (#520)
CI Build & Deploy Pipeline / Staging E2E Tests (push) Failing after 2m50s
CI Build & Deploy Pipeline / Production Browser E2E (push) Failing after 1437h19m24s
CI Build & Deploy Pipeline / Build Production Web Image (push) Failing after 1437h19m26s
CI Build & Deploy Pipeline / Deploy Production (push) Failing after 1437h19m25s
CI Build & Deploy Pipeline / Build Production API Image (push) Failing after 1437h19m26s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1437h21m16s
CI Build & Deploy Pipeline / Build Staging API Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (push) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (push) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (push) Failing after 1437h51m29s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Unit Tests (push) Has been skipped
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (push) Failing after 2m50s
CI Build & Deploy Pipeline / Production Browser E2E (push) Failing after 1437h19m24s
CI Build & Deploy Pipeline / Build Production Web Image (push) Failing after 1437h19m26s
CI Build & Deploy Pipeline / Deploy Production (push) Failing after 1437h19m25s
CI Build & Deploy Pipeline / Build Production API Image (push) Failing after 1437h19m26s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1437h21m16s
CI Build & Deploy Pipeline / Build Staging API Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (push) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (push) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (push) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (push) Failing after 1437h51m29s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Unit Tests (push) Has been skipped
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
This commit was merged in pull request #520.
This commit is contained in:
@@ -2,74 +2,69 @@
|
||||
* V21 Modal 对话框
|
||||
* 封装 Ant Design Modal,应用 V21 设计系统样式
|
||||
*/
|
||||
import React from "react";
|
||||
import { Modal as AntModal } from "antd";
|
||||
import type { ModalProps as AntModalProps } from "antd";
|
||||
import type { ModalFuncProps } from "antd/es/modal";
|
||||
import classNames from "classnames";
|
||||
import "./ui.css";
|
||||
import React from "react"
|
||||
import { Modal as AntModal } from "antd"
|
||||
import type { ModalProps as AntModalProps } from "antd"
|
||||
import type { ModalFuncProps } from "antd/es/modal"
|
||||
import classNames from "classnames"
|
||||
import "./ui.css"
|
||||
|
||||
export interface ModalProps extends AntModalProps {
|
||||
/** 使用 V21 样式 */
|
||||
v21?: boolean;
|
||||
v21?: boolean
|
||||
}
|
||||
|
||||
interface ModalComponent extends React.FC<ModalProps> {
|
||||
confirm: (config: ModalFuncProps) => ReturnType<typeof AntModal.confirm>;
|
||||
info: (config: ModalFuncProps) => ReturnType<typeof AntModal.info>;
|
||||
success: (config: ModalFuncProps) => ReturnType<typeof AntModal.success>;
|
||||
error: (config: ModalFuncProps) => ReturnType<typeof AntModal.error>;
|
||||
warning: (config: ModalFuncProps) => ReturnType<typeof AntModal.warning>;
|
||||
confirm: (config: ModalFuncProps) => ReturnType<typeof AntModal.confirm>
|
||||
info: (config: ModalFuncProps) => ReturnType<typeof AntModal.info>
|
||||
success: (config: ModalFuncProps) => ReturnType<typeof AntModal.success>
|
||||
error: (config: ModalFuncProps) => ReturnType<typeof AntModal.error>
|
||||
warning: (config: ModalFuncProps) => ReturnType<typeof AntModal.warning>
|
||||
}
|
||||
|
||||
const Modal: ModalComponent = ({
|
||||
className,
|
||||
v21 = true,
|
||||
children,
|
||||
...rest
|
||||
}) => {
|
||||
const v21Class = classNames(v21 && "xx-modal", className);
|
||||
const Modal: ModalComponent = ({ className, v21 = true, children, ...rest }) => {
|
||||
const v21Class = classNames(v21 && "xx-modal", className)
|
||||
return (
|
||||
<AntModal className={v21Class} {...rest}>
|
||||
{children}
|
||||
</AntModal>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
/** 确认对话框快捷方法 */
|
||||
Modal.confirm = (config: ModalFuncProps) => {
|
||||
return AntModal.confirm({
|
||||
...config,
|
||||
className: classNames("xx-modal-confirm", config.className),
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
Modal.info = (config: ModalFuncProps) => {
|
||||
return AntModal.info({
|
||||
...config,
|
||||
className: classNames("xx-modal-confirm", config.className),
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
Modal.success = (config: ModalFuncProps) => {
|
||||
return AntModal.success({
|
||||
...config,
|
||||
className: classNames("xx-modal-confirm", config.className),
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
Modal.error = (config: ModalFuncProps) => {
|
||||
return AntModal.error({
|
||||
...config,
|
||||
className: classNames("xx-modal-confirm", config.className),
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
Modal.warning = (config: ModalFuncProps) => {
|
||||
return AntModal.warning({
|
||||
...config,
|
||||
className: classNames("xx-modal-confirm", config.className),
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export default Modal;
|
||||
export default Modal
|
||||
|
||||
Reference in New Issue
Block a user