Antd updates (#2194)
* Fix antd Modal.visible warning by using updated attribute name 'open'. * Update more attributes (onVisibleChange => onOpenChange, defaultVisible => defaultOpen) to fix browser console warnings. * Update ModalProps property from 'visible' to 'open' to match the change in antd. * Update variable names to match the antd change from 'visible' to 'open'. * Inline this for the linter. * One more visible => open reference.
This commit is contained in:
@@ -4,7 +4,7 @@ import React, { useState, useEffect, FC } from 'react';
|
||||
import styles from './NotifyReminderPopup.module.scss';
|
||||
|
||||
export type NotifyReminderPopupProps = {
|
||||
visible: boolean;
|
||||
open: boolean;
|
||||
children: React.ReactNode;
|
||||
notificationClicked: () => void;
|
||||
notificationClosed: () => void;
|
||||
@@ -12,16 +12,16 @@ export type NotifyReminderPopupProps = {
|
||||
|
||||
export const NotifyReminderPopup: FC<NotifyReminderPopupProps> = ({
|
||||
children,
|
||||
visible,
|
||||
open,
|
||||
notificationClicked,
|
||||
notificationClosed,
|
||||
}) => {
|
||||
const [visiblePopup, setVisiblePopup] = useState(visible);
|
||||
const [openPopup, setOpenPopup] = useState(open);
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setVisiblePopup(visible);
|
||||
}, [visible]);
|
||||
setOpenPopup(open);
|
||||
}, [open]);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
@@ -43,7 +43,7 @@ export const NotifyReminderPopup: FC<NotifyReminderPopupProps> = ({
|
||||
|
||||
const popupClosed = e => {
|
||||
e.stopPropagation();
|
||||
setVisiblePopup(false);
|
||||
setOpenPopup(false);
|
||||
notificationClosed();
|
||||
};
|
||||
|
||||
@@ -64,8 +64,8 @@ export const NotifyReminderPopup: FC<NotifyReminderPopupProps> = ({
|
||||
mounted && (
|
||||
<Popover
|
||||
placement="topLeft"
|
||||
defaultVisible={visiblePopup}
|
||||
visible={visiblePopup}
|
||||
defaultOpen={openPopup}
|
||||
open={openPopup}
|
||||
destroyTooltipOnHide
|
||||
title={title}
|
||||
content={content}
|
||||
|
||||
Reference in New Issue
Block a user