Modal visible -> open

Summary: The `visible` prop is marked as deprecated in favour of `open`

Reviewed By: passy

Differential Revision: D49226821

fbshipit-source-id: 4a4a7d03a1c8ff860c4e4cd02e19071185a8554e
This commit is contained in:
Lorenzo Blasa
2023-09-13 05:19:13 -07:00
committed by Facebook GitHub Bot
parent 860af1eff7
commit e80843d433
18 changed files with 25 additions and 30 deletions

View File

@@ -59,7 +59,7 @@ export const Dialog = {
return ( return (
<Modal <Modal
title={opts.title} title={opts.title}
visible open
okText={opts.okText} okText={opts.okText}
cancelText={opts.cancelText} cancelText={opts.cancelText}
onOk={async () => { onOk={async () => {
@@ -280,7 +280,7 @@ export const Dialog = {
return ( return (
<Modal <Modal
title={title ?? 'Loading...'} title={title ?? 'Loading...'}
visible open
footer={null} footer={null}
width={width ?? defaultWidth} width={width ?? defaultWidth}
closable={false}> closable={false}>

View File

@@ -57,11 +57,7 @@ class ChangelogSheet extends Component<Props, {}> {
render() { render() {
return this.props.changelog ? ( return this.props.changelog ? (
<Modal <Modal open title="Changelog" onCancel={this.props.onHide} footer={null}>
visible
title="Changelog"
onCancel={this.props.onHide}
footer={null}>
<Markdown <Markdown
source={ source={
this.props.recent this.props.recent

View File

@@ -122,7 +122,7 @@ class PlatformSelectWizard extends Component<Props, State> {
return ( return (
<Modal <Modal
visible open
centered centered
onCancel={() => { onCancel={() => {
this.props.onHide(); this.props.onHide();

View File

@@ -101,7 +101,7 @@ class SettingsSheet extends Component<Props, State> {
) { ) {
return ( return (
<Modal <Modal
visible open
centered centered
onCancel={this.props.onHide} onCancel={this.props.onHide}
width={570} width={570}

View File

@@ -200,7 +200,7 @@ export default class ShareSheetExportFile extends Component<Props, State> {
render() { render() {
return ( return (
<Modal visible onCancel={this.cancelAndHide} footer={null}> <Modal open onCancel={this.cancelAndHide} footer={null}>
{this.renderStatus()} {this.renderStatus()}
</Modal> </Modal>
); );

View File

@@ -152,7 +152,7 @@ export default class ShareSheetExportUrl extends Component<Props, State> {
renderPending(statusUpdate: string | null) { renderPending(statusUpdate: string | null) {
return ( return (
<Modal visible onCancel={this.cancelAndHide} footer={null}> <Modal open onCancel={this.cancelAndHide} footer={null}>
<ShareSheetPendingDialog <ShareSheetPendingDialog
width={500} width={500}
statusUpdate={statusUpdate} statusUpdate={statusUpdate}
@@ -171,7 +171,7 @@ export default class ShareSheetExportUrl extends Component<Props, State> {
const {title, errorArray} = displayFetchMetadataErrors(fetchMetaDataErrors); const {title, errorArray} = displayFetchMetadataErrors(fetchMetaDataErrors);
return ( return (
<Modal visible onCancel={this.cancelAndHide} footer={null}> <Modal open onCancel={this.cancelAndHide} footer={null}>
<Layout.Container> <Layout.Container>
<> <>
<FlexColumn> <FlexColumn>

View File

@@ -15,7 +15,7 @@ import {Modal} from 'antd';
export default function (props: {onHide: () => any}) { export default function (props: {onHide: () => any}) {
return ( return (
<Modal visible centered width={800} onCancel={props.onHide} footer={null}> <Modal open centered width={800} onCancel={props.onHide} footer={null}>
<Tabs> <Tabs>
<Tab tab="Plugin Status"> <Tab tab="Plugin Status">
<PluginDebugger /> <PluginDebugger />

View File

@@ -197,7 +197,7 @@ function ExportEverythingEverywhereAllAtOnceStatusModal({
return ( return (
<Modal <Modal
visible={!!status} open={!!status}
centered centered
onCancel={() => { onCancel={() => {
setStatus(undefined); setStatus(undefined);
@@ -230,7 +230,7 @@ function NotificationButton() {
}} }}
/> />
<Modal <Modal
visible={isOpen} open={isOpen}
onCancel={() => onCancel={() =>
store.dispatch({type: 'isNotificationModalOpen', payload: false}) store.dispatch({type: 'isNotificationModalOpen', payload: false})
} }
@@ -537,7 +537,7 @@ function TroubleshootingModal() {
); );
return ( return (
<Modal <Modal
visible={isOpen} open={isOpen}
onCancel={() => store.dispatch(toggleConnectivityModal())} onCancel={() => store.dispatch(toggleConnectivityModal())}
width="100%" width="100%"
footer={null} footer={null}
@@ -561,7 +561,7 @@ function FlipperDevToolsModal({
}) { }) {
return ( return (
<Modal <Modal
visible={isOpen} open={isOpen}
onCancel={onClose} onCancel={onClose}
width="100%" width="100%"
footer={null} footer={null}

View File

@@ -276,7 +276,7 @@ export default function SetupDoctorScreen({
centered centered
width={570} width={570}
title="Setup Doctor" title="Setup Doctor"
visible={visible} open={visible}
destroyOnClose destroyOnClose
footer={ footer={
<SetupDoctorFooter <SetupDoctorFooter

View File

@@ -110,7 +110,7 @@ export default function WelcomeScreen({
<Modal <Modal
centered centered
closable={false} closable={false}
visible={visible} open={visible}
footer={ footer={
<WelcomeFooter <WelcomeFooter
onClose={onClose} onClose={onClose}

View File

@@ -60,7 +60,7 @@ function NoSDKsEnabledAlert({onClose}: {onClose: () => void}) {
return ( return (
<> <>
<Modal <Modal
visible open
centered centered
onCancel={onClose} onCancel={onClose}
title="No Mobile SDKs Enabled" title="No Mobile SDKs Enabled"
@@ -252,7 +252,7 @@ export const LaunchEmulatorDialog = withTrackingScope(
return ( return (
<Modal <Modal
visible open
centered centered
onCancel={onClose} onCancel={onClose}
title="Launch Virtual device" title="Launch Virtual device"

View File

@@ -31,7 +31,7 @@ export default function BlocklistSettingButton(props: {
/> />
<Modal <Modal
title="Notification Setting" title="Notification Setting"
visible={showModal} open={showModal}
width={650} width={650}
footer={null} footer={null}
onCancel={() => setShowModal(false)}> onCancel={() => setShowModal(false)}>

View File

@@ -34,7 +34,7 @@ export function RequiredParametersDialog(props: Props) {
useRequiredParameterFormValidator(requiredParameters); useRequiredParameterFormValidator(requiredParameters);
return ( return (
<Modal <Modal
visible open
onCancel={onHide} onCancel={onHide}
title="Provide bookmark details" title="Provide bookmark details"
footer={ footer={

View File

@@ -56,7 +56,7 @@ export function SaveBookmarkDialog(props: Props) {
return null; return null;
} else { } else {
return ( return (
<Modal visible footer={null} onCancel={onHide}> <Modal open footer={null} onCancel={onHide}>
{(onHide: () => void) => { {(onHide: () => void) => {
return ( return (
<Container> <Container>

View File

@@ -477,7 +477,7 @@ function showCustomColumnDialog(
return ( return (
<Modal <Modal
title="Add custom column" title="Add custom column"
visible open
onOk={() => { onOk={() => {
const header = form.getFieldValue('header'); const header = form.getFieldValue('header');
const type = form.getFieldValue('type'); const type = form.getFieldValue('type');
@@ -614,7 +614,7 @@ export function Component() {
} }
/> />
<Modal <Modal
visible={showMockResponseDialog} open={showMockResponseDialog}
onCancel={instance.onCloseButtonPressed} onCancel={instance.onCloseButtonPressed}
footer={null} footer={null}
title="Mock Network Responses" title="Mock Network Responses"

View File

@@ -141,7 +141,7 @@ function FrameworkEventsMonitoringModal({
return ( return (
<Modal <Modal
title="Framework event monitoring" title="Framework event monitoring"
visible={visible} open={visible}
footer={null} footer={null}
onCancel={onCancel}> onCancel={onCancel}>
<Space direction="vertical" size="large"> <Space direction="vertical" size="large">

View File

@@ -353,7 +353,7 @@ const DelayedHoveredToolTip: React.FC<{
return ( return (
<Tooltip <Tooltip
visible={isVisible} open={isVisible}
key={nodeId} key={nodeId}
placement="top" placement="top"
zIndex={100} zIndex={100}

View File

@@ -7,7 +7,7 @@
* @format * @format
*/ */
import {Button, Dropdown, Menu, Slider, Tooltip, Typography} from 'antd'; import {Button, Dropdown, Slider, Tooltip, Typography} from 'antd';
import {Layout, produce, theme, usePlugin} from 'flipper-plugin'; import {Layout, produce, theme, usePlugin} from 'flipper-plugin';
import {ClientNode, Id} from '../../ClientTypes'; import {ClientNode, Id} from '../../ClientTypes';
import {plugin} from '../../index'; import {plugin} from '../../index';
@@ -85,7 +85,6 @@ export function VisualiserControls({
{targetMode.state === 'selected' && ( {targetMode.state === 'selected' && (
<Slider <Slider
min={0} min={0}
tooltipVisible={false}
value={targetMode.sliderPosition} value={targetMode.sliderPosition}
max={targetMode.targetedNodes.length - 1} max={targetMode.targetedNodes.length - 1}
onChange={(value) => { onChange={(value) => {