Skip to content

Commit

Permalink
Merge pull request #719 from smartxworks/feat/modal
Browse files Browse the repository at this point in the history
feat(Modal): add hideFooter property
  • Loading branch information
tanbowensg committed Aug 30, 2023
2 parents 59d5e6a + b67e15c commit 8e6be11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/arco-lib/src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const exampleProperties: Static<typeof ModalPropsSpec> = {
confirmLoading: false,
defaultOpen: true,
unmountOnExit: true,
hideFooter: false,
};
export const Modal = implementRuntimeComponent({
version: 'arco/v1',
Expand Down Expand Up @@ -48,7 +49,7 @@ export const Modal = implementRuntimeComponent({
},
})(props => {
const { getElement, subscribeMethods, slotsElements, customStyle, callbackMap } = props;
const { title, defaultOpen, ...cProps } = getComponentProps(props);
const { title, defaultOpen, hideFooter, ...cProps } = getComponentProps(props);
const [visible, setVisible] = useState(defaultOpen);
const contentRef = useRef<HTMLDivElement | null>(null);

Expand Down Expand Up @@ -90,7 +91,7 @@ export const Modal = implementRuntimeComponent({
}}
afterClose={afterClose}
afterOpen={afterOpen}
footer={slotsElements.footer ? slotsElements.footer({}) : undefined}
footer={hideFooter ? null : slotsElements?.footer?.({})}
className={css(customStyle?.content)}
mountOnEnter={true}
{...cProps}
Expand Down
4 changes: 4 additions & 0 deletions packages/arco-lib/src/generated/types/Modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ export const ModalPropsSpec = {
title: 'Destroy On Hide',
category: Category.Behavior,
}),
hideFooter: Type.Boolean({
title: 'Hide Footer',
category: Category.Behavior,
}),
};

0 comments on commit 8e6be11

Please sign in to comment.