fix: defaultTitle invalid attribute on div (#350)

This commit is contained in:
Meier Lukas
2024-04-20 12:52:02 +02:00
committed by GitHub
parent 9615568ff3
commit 4970c3a1b2

View File

@@ -80,29 +80,33 @@ export const ModalProvider = ({ children }: PropsWithChildren) => {
return ( return (
<ModalContext.Provider value={{ openModalInner, closeModal }}> <ModalContext.Provider value={{ openModalInner, closeModal }}>
{activeModals.map((modal) => ( {activeModals.map((modal) => {
<Modal const { defaultTitle: _ignored, ...otherModalProps } =
key={modal.id} modal.reference.modalProps;
zIndex={getDefaultZIndex("modal") + 1} return (
display={modal.id === state.current?.id ? undefined : "none"} <Modal
style={{ key={modal.id}
userSelect: modal.id === state.current?.id ? undefined : "none", zIndex={getDefaultZIndex("modal") + 1}
}} display={modal.id === state.current?.id ? undefined : "none"}
styles={{ style={{
title: { userSelect: modal.id === state.current?.id ? undefined : "none",
fontSize: "1.25rem", }}
fontWeight: 500, styles={{
}, title: {
}} fontSize: "1.25rem",
trapFocus={modal.id === state.current?.id} fontWeight: 500,
{...modal.reference.modalProps} },
title={translateIfNecessary(t, modal.props.defaultTitle)} }}
opened={state.modals.length > 0} trapFocus={modal.id === state.current?.id}
onClose={handleCloseModal} {...otherModalProps}
> title={translateIfNecessary(t, modal.props.defaultTitle)}
{modal.reference.content} opened={state.modals.length > 0}
</Modal> onClose={handleCloseModal}
))} >
{modal.reference.content}
</Modal>
);
})}
{children} {children}
</ModalContext.Provider> </ModalContext.Provider>