Skip to content

Commit 9eb162c

Browse files
fix: Replace deprecated Tooltip and Popover components with Tooltip2 … (#1667)
1 parent 73dc55e commit 9eb162c

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

src/renderer/components/commands-action-button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import {
66
IToastProps,
77
Menu,
88
MenuItem,
9-
Popover,
109
Position,
1110
Toaster,
1211
} from '@blueprintjs/core';
12+
import { Popover2 } from '@blueprintjs/popover2';
1313
import { when } from 'mobx';
1414
import { observer } from 'mobx-react';
1515

@@ -396,9 +396,9 @@ export const GistActionButton = observer(
396396
);
397397

398398
return (
399-
<Popover content={menu} position={Position.BOTTOM}>
399+
<Popover2 content={menu} position={Position.BOTTOM}>
400400
<Button icon="wrench" />
401-
</Popover>
401+
</Popover2>
402402
);
403403
};
404404

@@ -429,9 +429,9 @@ export const GistActionButton = observer(
429429
);
430430

431431
return (
432-
<Popover content={privacyMenu} position={Position.BOTTOM}>
432+
<Popover2 content={privacyMenu} position={Position.BOTTOM}>
433433
<Button icon={privacyIcon} />
434-
</Popover>
434+
</Popover2>
435435
);
436436
};
437437

src/renderer/components/settings-electron.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
Icon,
1313
IconName,
1414
Spinner,
15-
Tooltip,
1615
} from '@blueprintjs/core';
16+
import { Tooltip2 } from '@blueprintjs/popover2';
1717
import { observer } from 'mobx-react';
1818

1919
import {
@@ -238,7 +238,7 @@ export const ElectronSettings = observer(
238238
return (
239239
<FormGroup label="Channels:">
240240
{Object.values(channels).map((channel) => (
241-
<Tooltip
241+
<Tooltip2
242242
content={`Can't disable channel of selected version (${appState.version})`}
243243
disabled={!getIsCurrentVersionReleaseChannel(channel)}
244244
position="bottom"
@@ -253,9 +253,9 @@ export const ElectronSettings = observer(
253253
disabled={getIsCurrentVersionReleaseChannel(channel)}
254254
inline={true}
255255
/>
256-
</Tooltip>
256+
</Tooltip2>
257257
))}
258-
<Tooltip
258+
<Tooltip2
259259
content={`Include versions that have reached end-of-life (older than ${window.ElectronFiddle.getOldestSupportedMajor()}.0.0)`}
260260
position="bottom"
261261
intent="primary"
@@ -267,7 +267,7 @@ export const ElectronSettings = observer(
267267
label="Obsolete"
268268
onChange={this.handleShowObsoleteChange}
269269
/>
270-
</Tooltip>
270+
</Tooltip2>
271271
</FormGroup>
272272
);
273273
}
@@ -371,7 +371,7 @@ export const ElectronSettings = observer(
371371

372372
if (version === appState.currentElectronVersion.version) {
373373
return (
374-
<Tooltip
374+
<Tooltip2
375375
position="auto"
376376
intent="primary"
377377
content={`Can't remove currently active Electron version (${version})`}
@@ -382,11 +382,11 @@ export const ElectronSettings = observer(
382382
text={buttonProps.text}
383383
icon={buttonProps.icon}
384384
/>
385-
</Tooltip>
385+
</Tooltip2>
386386
);
387387
} else if (disableDownload(version)) {
388388
return (
389-
<Tooltip
389+
<Tooltip2
390390
position="auto"
391391
intent="primary"
392392
content={`Version is not available on your current OS`}
@@ -397,7 +397,7 @@ export const ElectronSettings = observer(
397397
text={buttonProps.text}
398398
icon={buttonProps.icon}
399399
/>
400-
</Tooltip>
400+
</Tooltip2>
401401
);
402402
}
403403

src/renderer/components/version-select.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
Intent,
99
Menu,
1010
MenuItem,
11-
Tooltip,
1211
} from '@blueprintjs/core';
12+
import { Tooltip2 } from '@blueprintjs/popover2';
1313
import {
1414
ItemListPredicate,
1515
ItemListRenderer,
@@ -178,7 +178,7 @@ export const renderItem: ItemRenderer<RunnableVersion> = (
178178

179179
if (disableDownload(item.version)) {
180180
return (
181-
<Tooltip
181+
<Tooltip2
182182
className="disabled-menu-tooltip"
183183
modifiers={{
184184
flip: { enabled: false },
@@ -197,7 +197,7 @@ export const renderItem: ItemRenderer<RunnableVersion> = (
197197
label={getItemLabel(item)}
198198
icon={getItemIcon(item)}
199199
/>
200-
</Tooltip>
200+
</Tooltip2>
201201
);
202202
}
203203

tests/renderer/components/__snapshots__/settings-electron-spec.tsx.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports[`ElectronSettings component renders 1`] = `
1111
<Blueprint3.FormGroup
1212
label="Channels:"
1313
>
14-
<Blueprint3.Tooltip
14+
<Blueprint3.Tooltip2
1515
content="Can't disable channel of selected version (2.0.1)"
1616
disabled={false}
1717
hoverCloseDelay={0}
@@ -30,8 +30,8 @@ exports[`ElectronSettings component renders 1`] = `
3030
label="Stable"
3131
onChange={[Function]}
3232
/>
33-
</Blueprint3.Tooltip>
34-
<Blueprint3.Tooltip
33+
</Blueprint3.Tooltip2>
34+
<Blueprint3.Tooltip2
3535
content="Can't disable channel of selected version (2.0.1)"
3636
disabled={true}
3737
hoverCloseDelay={0}
@@ -50,8 +50,8 @@ exports[`ElectronSettings component renders 1`] = `
5050
label="Beta"
5151
onChange={[Function]}
5252
/>
53-
</Blueprint3.Tooltip>
54-
<Blueprint3.Tooltip
53+
</Blueprint3.Tooltip2>
54+
<Blueprint3.Tooltip2
5555
content="Can't disable channel of selected version (2.0.1)"
5656
disabled={true}
5757
hoverCloseDelay={0}
@@ -70,8 +70,8 @@ exports[`ElectronSettings component renders 1`] = `
7070
label="Nightly"
7171
onChange={[Function]}
7272
/>
73-
</Blueprint3.Tooltip>
74-
<Blueprint3.Tooltip
73+
</Blueprint3.Tooltip2>
74+
<Blueprint3.Tooltip2
7575
content="Include versions that have reached end-of-life (older than 9.0.0)"
7676
hoverCloseDelay={0}
7777
hoverOpenDelay={100}
@@ -87,7 +87,7 @@ exports[`ElectronSettings component renders 1`] = `
8787
label="Obsolete"
8888
onChange={[Function]}
8989
/>
90-
</Blueprint3.Tooltip>
90+
</Blueprint3.Tooltip2>
9191
</Blueprint3.FormGroup>
9292
</Blueprint3.Callout>
9393
<br />
@@ -281,7 +281,7 @@ exports[`ElectronSettings component renders 1`] = `
281281
<td
282282
className="action"
283283
>
284-
<Blueprint3.Tooltip
284+
<Blueprint3.Tooltip2
285285
content="Can't remove currently active Electron version (2.0.1)"
286286
hoverCloseDelay={0}
287287
hoverOpenDelay={100}
@@ -296,7 +296,7 @@ exports[`ElectronSettings component renders 1`] = `
296296
icon="cloud-download"
297297
text="Download"
298298
/>
299-
</Blueprint3.Tooltip>
299+
</Blueprint3.Tooltip2>
300300
</td>
301301
</tr>
302302
<tr

0 commit comments

Comments
 (0)