1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import type { ModalProps, PopconfirmProps } from 'naive-ui'
- export function useComponentModifier() {
- function getModalModifier(props?: ModalProps): ModalProps {
- const negativeButtonProps: ModalProps['negativeButtonProps'] = {
- ghost: false,
- secondary: true,
- type: 'tertiary',
- }
- const positiveButtonProps: ModalProps['positiveButtonProps'] = {
- ghost: false,
- secondary: true,
- }
- const themeOverrides: ModalProps['themeOverrides'] = {
- peers: {
- Dialog: {
- iconSize: '26px',
- titleFontSize: '16px',
- },
- },
- }
- return {
- negativeButtonProps,
- positiveButtonProps,
- themeOverrides,
- ...props,
- }
- }
- function getPopconfirmModifier(props?: PopconfirmProps): PopconfirmProps {
- const negativeButtonProps: PopconfirmProps['negativeButtonProps'] = {
- ghost: false,
- secondary: true,
- size: 'small',
- }
- const positiveButtonProps: PopconfirmProps['positiveButtonProps'] = {
- ghost: false,
- type: 'info',
- size: 'small',
- }
- return {
- negativeButtonProps,
- positiveButtonProps,
- ...props,
- }
- }
- return {
- getModalModifier,
- getPopconfirmModifier,
- }
- }
|