- {/* @ts-expect-error React 18 type compatibility */}
-
diff --git a/pezkuwi-sdk-ui/packages/react-components/src/AccountSidebar/SidebarEditableSection.tsx b/pezkuwi-sdk-ui/packages/react-components/src/AccountSidebar/SidebarEditableSection.tsx
index 0c48b2eb..e95f39c0 100644
--- a/pezkuwi-sdk-ui/packages/react-components/src/AccountSidebar/SidebarEditableSection.tsx
+++ b/pezkuwi-sdk-ui/packages/react-components/src/AccountSidebar/SidebarEditableSection.tsx
@@ -16,7 +16,7 @@ interface Props {
address: string;
isBeingEdited: (arg: boolean) => void;
onUpdateName?: (() => void) | null;
- sidebarRef: React.RefObject;
+ sidebarRef: React.RefObject;
}
function SidebarEditableSection ({ accountIndex, address, isBeingEdited, onUpdateName, sidebarRef }: Props): React.ReactElement {
diff --git a/pezkuwi-sdk-ui/packages/react-components/src/CopyButton.tsx b/pezkuwi-sdk-ui/packages/react-components/src/CopyButton.tsx
index e6112599..ec486ea3 100644
--- a/pezkuwi-sdk-ui/packages/react-components/src/CopyButton.tsx
+++ b/pezkuwi-sdk-ui/packages/react-components/src/CopyButton.tsx
@@ -46,7 +46,6 @@ function CopyButton ({ children, className = '', icon = 'copy', label, type, val
return (
- {/* @ts-expect-error React 18 type compatibility */}
{
+function ModalBase ({ children, className = '', header, onClose, size = 'medium', testId = 'modal' }: Props): React.ReactPortal {
const { themeClassName } = useTheme();
const listenKeyboard = useCallback((event: KeyboardEvent) => {
diff --git a/pezkuwi-sdk-ui/packages/react-components/src/Popup/PopupWindow.tsx b/pezkuwi-sdk-ui/packages/react-components/src/Popup/PopupWindow.tsx
index 7d5018b4..63ade467 100644
--- a/pezkuwi-sdk-ui/packages/react-components/src/Popup/PopupWindow.tsx
+++ b/pezkuwi-sdk-ui/packages/react-components/src/Popup/PopupWindow.tsx
@@ -10,14 +10,14 @@ import { usePopupWindow } from '@pezkuwi/react-hooks/usePopupWindow';
import { styled } from '../styled.js';
-function PopupWindow ({ children, className = '', position, triggerRef, windowRef }: Props): React.ReactElement {
+function PopupWindow ({ children, className = '', position, triggerRef, windowRef }: Props): React.ReactPortal {
const { pointerStyle, renderCoords: { x, y } } = usePopupWindow(windowRef, triggerRef, position);
return createPortal(
}
style={
(x && y && {
transform: `translate3d(${x}px, ${y}px, 0)`,
diff --git a/pezkuwi-sdk-ui/packages/react-components/src/Popup/types.ts b/pezkuwi-sdk-ui/packages/react-components/src/Popup/types.ts
index 3298f72c..32db09c2 100644
--- a/pezkuwi-sdk-ui/packages/react-components/src/Popup/types.ts
+++ b/pezkuwi-sdk-ui/packages/react-components/src/Popup/types.ts
@@ -17,8 +17,8 @@ export type VerticalPosition = 'top' | 'bottom'
export interface PopupWindowProps {
className?: string;
children?: React.ReactNode;
- windowRef: React.RefObject;
- triggerRef: React.RefObject;
+ windowRef: React.RefObject;
+ triggerRef: React.RefObject;
position: HorizontalPosition;
}
diff --git a/pezkuwi-sdk-ui/packages/react-components/src/Sidebar.tsx b/pezkuwi-sdk-ui/packages/react-components/src/Sidebar.tsx
index 2060b267..09f5d031 100644
--- a/pezkuwi-sdk-ui/packages/react-components/src/Sidebar.tsx
+++ b/pezkuwi-sdk-ui/packages/react-components/src/Sidebar.tsx
@@ -14,7 +14,7 @@ interface Props {
offset?: number | string;
onClose?: () => void;
position: 'left' | 'right';
- sidebarRef: React.RefObject;
+ sidebarRef: React.RefObject;
}
function Sidebar ({ buttons, children, className = '', dataTestId = '', onClose, position, sidebarRef }: Props): React.ReactElement {
@@ -22,7 +22,7 @@ function Sidebar ({ buttons, children, className = '', dataTestId = '', onClose,
}
>
{buttons}
diff --git a/pezkuwi-sdk-ui/packages/react-components/src/Tooltip.tsx b/pezkuwi-sdk-ui/packages/react-components/src/Tooltip.tsx
index 75179313..d6e926ce 100644
--- a/pezkuwi-sdk-ui/packages/react-components/src/Tooltip.tsx
+++ b/pezkuwi-sdk-ui/packages/react-components/src/Tooltip.tsx
@@ -22,7 +22,7 @@ interface Props {
trigger: string;
}
-function Tooltip ({ children, className = '', isClickable = false, place, text, trigger }: Props): React.ReactElement | null {
+function Tooltip ({ children, className = '', isClickable = false, place, text, trigger }: Props): React.ReactPortal {
const [tooltipContainer] = useState(
typeof document === 'undefined'
? {} as HTMLElement // This hack is required for server side rendering
diff --git a/pezkuwi-sdk-ui/packages/react-hooks/src/useOutsideClick.ts b/pezkuwi-sdk-ui/packages/react-hooks/src/useOutsideClick.ts
index c756fad6..994bbb91 100644
--- a/pezkuwi-sdk-ui/packages/react-hooks/src/useOutsideClick.ts
+++ b/pezkuwi-sdk-ui/packages/react-hooks/src/useOutsideClick.ts
@@ -7,14 +7,14 @@ import { useCallback, useEffect } from 'react';
import { createNamedHook } from './createNamedHook.js';
-function isRefClicked (refs: React.RefObject[], e: MouseEvent): boolean {
+function isRefClicked (refs: React.RefObject[], e: MouseEvent): boolean {
return refs.some((r) =>
r.current &&
r.current.contains(e.target as HTMLElement)
);
}
-function useOutsideClickImpl (refs: React.RefObject[], callback: () => void): void {
+function useOutsideClickImpl (refs: React.RefObject[], callback: () => void): void {
const handleClick = useCallback(
(e: MouseEvent): void => {
if (refs.length && !isRefClicked(refs, e)) {
diff --git a/pezkuwi-sdk-ui/packages/react-hooks/src/usePopupWindow.ts b/pezkuwi-sdk-ui/packages/react-hooks/src/usePopupWindow.ts
index f20e73e0..29045523 100644
--- a/pezkuwi-sdk-ui/packages/react-hooks/src/usePopupWindow.ts
+++ b/pezkuwi-sdk-ui/packages/react-hooks/src/usePopupWindow.ts
@@ -25,7 +25,7 @@ interface Result {
const COORD_0: Coord = { x: 0, y: 0 };
-function usePopupWindowImpl (windowRef: React.RefObject, triggerRef: React.RefObject, position: HorizontalPosition): Result {
+function usePopupWindowImpl (windowRef: React.RefObject, triggerRef: React.RefObject, position: HorizontalPosition): Result {
const [renderCoords, setRenderCoords] = useState(COORD_0);
const [pointerStyle, setPointerStyle] = useState('top');
const windowCoords = useElementPosition(windowRef);