From 59ce093b31acd015e0c7f668f268420816d5dd4f Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Fri, 10 Feb 2023 13:23:48 -0500 Subject: [PATCH] Replace @reach/portal with custom Portal --- app/soapbox/components/autosuggest-input.tsx | 3 +-- app/soapbox/components/autosuggest-textarea.tsx | 2 +- app/soapbox/components/ui/tooltip/tooltip.tsx | 3 ++- package.json | 1 - yarn.lock | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/soapbox/components/autosuggest-input.tsx b/app/soapbox/components/autosuggest-input.tsx index baa2f4b5d..5213e3585 100644 --- a/app/soapbox/components/autosuggest-input.tsx +++ b/app/soapbox/components/autosuggest-input.tsx @@ -1,4 +1,3 @@ -import { Portal } from '@reach/portal'; import clsx from 'clsx'; import { List as ImmutableList } from 'immutable'; import React from 'react'; @@ -6,7 +5,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import AutosuggestEmoji, { Emoji } from 'soapbox/components/autosuggest-emoji'; import Icon from 'soapbox/components/icon'; -import { Input } from 'soapbox/components/ui'; +import { Input, Portal } from 'soapbox/components/ui'; import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account'; import { isRtl } from 'soapbox/rtl'; import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions'; diff --git a/app/soapbox/components/autosuggest-textarea.tsx b/app/soapbox/components/autosuggest-textarea.tsx index ca20f584f..008bb9f81 100644 --- a/app/soapbox/components/autosuggest-textarea.tsx +++ b/app/soapbox/components/autosuggest-textarea.tsx @@ -1,9 +1,9 @@ -import { Portal } from '@reach/portal'; import clsx from 'clsx'; import React from 'react'; import ImmutablePureComponent from 'react-immutable-pure-component'; import Textarea from 'react-textarea-autosize'; +import { Portal } from 'soapbox/components/ui'; import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions'; import AutosuggestAccount from '../features/compose/components/autosuggest-account'; diff --git a/app/soapbox/components/ui/tooltip/tooltip.tsx b/app/soapbox/components/ui/tooltip/tooltip.tsx index 5265096b0..f5e22d195 100644 --- a/app/soapbox/components/ui/tooltip/tooltip.tsx +++ b/app/soapbox/components/ui/tooltip/tooltip.tsx @@ -1,7 +1,8 @@ -import { Portal } from '@reach/portal'; import { TooltipPopup, useTooltip } from '@reach/tooltip'; import React from 'react'; +import Portal from '../portal/portal'; + import './tooltip.css'; interface ITooltip { diff --git a/package.json b/package.json index f75bbe97a..b777ce6d4 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ "@reach/combobox": "^0.18.0", "@reach/menu-button": "^0.18.0", "@reach/popover": "^0.18.0", - "@reach/portal": "^0.18.0", "@reach/rect": "^0.18.0", "@reach/tabs": "^0.18.0", "@reach/tooltip": "^0.18.0", diff --git a/yarn.lock b/yarn.lock index 2ed4166f1..cc6850b0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2714,7 +2714,7 @@ "@reach/utils" "0.18.0" tabbable "^5.3.3" -"@reach/portal@0.18.0", "@reach/portal@^0.18.0": +"@reach/portal@0.18.0": version "0.18.0" resolved "https://registry.yarnpkg.com/@reach/portal/-/portal-0.18.0.tgz#dd466f5110689d14a0e7491b3aa8a449e8cefb40" integrity sha512-TImozRapd576ofRk30Le2L3lRTFXF1p47B182wnp5eMTdZa74JX138BtNGEPJFOyrMaVmguVF8SSwZ6a0fon1Q==