+
{children}
diff --git a/src/renderer/shared/ui-kit/Skeleton/Skeleton.tsx b/src/renderer/shared/ui-kit/Skeleton/Skeleton.tsx
index 93b90522a2..e736088209 100644
--- a/src/renderer/shared/ui-kit/Skeleton/Skeleton.tsx
+++ b/src/renderer/shared/ui-kit/Skeleton/Skeleton.tsx
@@ -25,12 +25,20 @@ export const Skeleton = ({ width, height, circle, fullWidth, minWidth, active, c
const formattedWidth = isNumber(width) ? `${gridSpaceConverter(width)}px` : width;
const formattedHeight = isNumber(height) ? `${gridSpaceConverter(height)}px` : height;
- if (children) {
- if (!active) {
- // eslint-disable-next-line react/jsx-no-useless-fragment
- return <>{children}>;
- }
+ if (!children) {
+ return (
+
+ );
+ }
+ if (active) {
return (
*]:invisible', {
@@ -39,18 +47,11 @@ export const Skeleton = ({ width, height, circle, fullWidth, minWidth, active, c
})}
style={{ minWidth: formattedMinWidth }}
>
- {Children.map(children, (child) => {
- return isString(child) ? {child} : child;
- })}
+ {Children.map(children, (child) => (isString(child) ? {child} : child))}
);
}
- return (
-
- );
+ // eslint-disable-next-line react/jsx-no-useless-fragment
+ return <>{children}>;
};
diff --git a/src/renderer/shared/ui-kit/_helpers/gridSpaceConverter.ts b/src/renderer/shared/ui-kit/_helpers/gridSpaceConverter.ts
index 125164610d..5a4337bd5b 100644
--- a/src/renderer/shared/ui-kit/_helpers/gridSpaceConverter.ts
+++ b/src/renderer/shared/ui-kit/_helpers/gridSpaceConverter.ts
@@ -1,4 +1,4 @@
-export const gridSpaceConverter = (value: number) => {
+export const gridSpaceConverter = (value: number): number => {
// We assume that default font size is 16px.
// Grid step - 0.25em
return (16 / 4) * value;
diff --git a/src/renderer/shared/ui-kit/index.ts b/src/renderer/shared/ui-kit/index.ts
index ebfe076c42..834f242fe7 100644
--- a/src/renderer/shared/ui-kit/index.ts
+++ b/src/renderer/shared/ui-kit/index.ts
@@ -3,6 +3,7 @@ export { useTheme } from './Theme/useTheme';
export { ThemeProvider } from './Theme/ThemeProvider';
export { ScrollArea } from './ScrollArea/ScrollArea';
+export { Checkbox } from './Checkbox/Checkbox';
export { Dropdown } from './Dropdown/Dropdown';
export { Skeleton } from './Skeleton/Skeleton';
export { Carousel } from './Carousel/Carousel';
@@ -13,4 +14,3 @@ export { Slider } from './Slider/Slider';
export { Label } from './Label/Label';
export { Modal } from './Modal/Modal';
export { Box } from './Box/Box';
-export { Checkbox } from './Checkbox/Checkbox';
diff --git a/src/renderer/shared/ui/Buttons/Button/Button.tsx b/src/renderer/shared/ui/Buttons/Button/Button.tsx
index 1edaa738ca..56f20a4cd1 100644
--- a/src/renderer/shared/ui/Buttons/Button/Button.tsx
+++ b/src/renderer/shared/ui/Buttons/Button/Button.tsx
@@ -43,6 +43,7 @@ export const Button = forwardRef
>(
onPointerMove,
onPointerLeave,
testId = 'Button',
+ ...rest
},
ref,
) => (
@@ -66,6 +67,7 @@ export const Button = forwardRef>(
onPointerDown={(e) => !isLoading && onPointerDown(e)}
onPointerMove={onPointerMove}
onPointerLeave={onPointerLeave}
+ {...rest}
>
{isLoading && }
{prefixElement && {prefixElement}
}
diff --git a/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.stories.tsx b/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.stories.tsx
deleted file mode 100644
index b7a1555b58..0000000000
--- a/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.stories.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { type Meta, type StoryFn } from '@storybook/react';
-
-import { type ButtonDropdownOption } from '../common/types';
-
-import { DropdownButton } from './DropdownButton';
-
-export default {
- title: 'v1/ui/Dropdown Button',
- component: DropdownButton,
- parameters: { actions: { argTypesRegex: '^on.*' } },
- decorators: [
- (Story) => (
-
-
-
- ),
- ],
-} as Meta;
-
-const Template: StoryFn = (args) => ;
-
-const options: ButtonDropdownOption[] = [
- { id: 'button1', title: 'Button Option 1', icon: 'globe', onClick: () => alert('click1') },
- { id: 'button2', title: 'Button Option 2', icon: 'up', onClick: () => alert('click2') },
-];
-
-export const Primary = Template.bind({});
-Primary.args = {
- title: 'v1/ui/Action Dropdown',
- options,
-};
-
-export const Disabled = Template.bind({});
-Disabled.args = {
- title: 'v1/ui/Action Dropdown',
- options,
- disabled: true,
-};
diff --git a/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.test.tsx b/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.test.tsx
deleted file mode 100644
index cd9399ec63..0000000000
--- a/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.test.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { act, render, screen, within } from '@testing-library/react';
-import noop from 'lodash/noop';
-
-import { type ButtonDropdownOption } from '../common/types';
-
-import { DropdownButton } from './DropdownButton';
-
-describe('ui/Dropdowns/DropdownButton', () => {
- const options: ButtonDropdownOption[] = [
- { id: '0', title: 'label_0', icon: 'globe', onClick: noop },
- { id: '1', title: 'label_1', icon: 'globe', onClick: noop },
- ];
-
- test('should render component', () => {
- render();
-
- const button = screen.getByRole('button');
- expect(button).toBeInTheDocument();
- });
-
- test('should call onSelected', async () => {
- const spySelected = jest.fn();
- const optionsExtended: ButtonDropdownOption[] = [
- ...options,
- { id: '2', title: 'label_2', icon: 'globe', onClick: spySelected },
- ];
-
- render();
-
- const button = screen.getByRole('button');
- await act(() => button.click());
-
- const option = screen.getAllByRole('menuitem')[2];
- const optionButton = within(option).getByRole('button');
-
- await act(() => optionButton.click());
-
- expect(spySelected).toHaveBeenCalled();
- });
-});
diff --git a/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.tsx b/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.tsx
deleted file mode 100644
index dc2794d937..0000000000
--- a/src/renderer/shared/ui/Dropdowns/DropdownButton/DropdownButton.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import { Menu } from '@headlessui/react';
-import { type ComponentProps } from 'react';
-import { Link } from 'react-router-dom';
-
-import { cnTw } from '@/shared/lib/utils';
-import { Button } from '../../Buttons';
-import { Icon } from '../../Icon/Icon';
-import { type IconNames } from '../../Icon/data';
-import { FootnoteText } from '../../Typography';
-import { type ButtonDropdownOption } from '../common/types';
-
-type ButtonProps = ComponentProps;
-
-type Props = {
- title: string;
- options: ButtonDropdownOption[];
-} & Omit;
-
-export const DropdownButton = ({ options, title, disabled, className, ...buttonProps }: Props) => {
- const { ref, ...restProps } = buttonProps;
-
- return (
-
- );
-};
diff --git a/src/renderer/shared/ui/Dropdowns/index.ts b/src/renderer/shared/ui/Dropdowns/index.ts
index 4598e79e00..5716e1a287 100644
--- a/src/renderer/shared/ui/Dropdowns/index.ts
+++ b/src/renderer/shared/ui/Dropdowns/index.ts
@@ -1,5 +1,4 @@
export { Select } from './Select/Select';
export { Combobox } from './Combobox/Combobox';
export { MultiSelect } from './MultiSelect/MultiSelect';
-export { DropdownButton } from './DropdownButton/DropdownButton';
export { DropdownIconButton } from './DropdownIconButton/DropdownIconButton';
diff --git a/src/renderer/shared/ui/Layouts/MainLayout/MainLayout.test.tsx b/src/renderer/shared/ui/Layouts/MainLayout/MainLayout.test.tsx
deleted file mode 100644
index 0addb188f3..0000000000
--- a/src/renderer/shared/ui/Layouts/MainLayout/MainLayout.test.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { render, screen } from '@testing-library/react';
-
-import { MainLayout } from './MainLayout';
-
-jest.mock('react-router-dom', () => ({ Outlet: () => 'outlet' }));
-
-describe('shared/ui/Layouts/MainLayout', () => {
- test('should render component', () => {
- render(children);
-
- const children = screen.getByText('children');
- const outletComponent = screen.getByText('outlet');
- expect(children).toBeInTheDocument();
- expect(outletComponent).toBeInTheDocument();
- });
-});
diff --git a/src/renderer/shared/ui/Layouts/MainLayout/MainLayout.tsx b/src/renderer/shared/ui/Layouts/MainLayout/MainLayout.tsx
deleted file mode 100644
index 4360c46f69..0000000000
--- a/src/renderer/shared/ui/Layouts/MainLayout/MainLayout.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { type PropsWithChildren } from 'react';
-import { Outlet } from 'react-router-dom';
-
-export const MainLayout = ({ children }: PropsWithChildren) => (
-
- {children}
-
-
-
-
-);
diff --git a/src/renderer/shared/ui/index.ts b/src/renderer/shared/ui/index.ts
index ca0a63e3b5..5df7343d31 100644
--- a/src/renderer/shared/ui/index.ts
+++ b/src/renderer/shared/ui/index.ts
@@ -2,7 +2,7 @@ export { Button, ButtonCard, ButtonLink, ButtonWebLink, IconButton } from './But
export { BaseModal, ConfirmModal, StatusModal } from './Modals';
-export { Select, Combobox, MultiSelect, DropdownButton, DropdownIconButton } from './Dropdowns';
+export { Select, Combobox, MultiSelect, DropdownIconButton } from './Dropdowns';
export { Popover, Tooltip, MenuPopover, useParentScrollLock } from './Popovers';
@@ -45,7 +45,6 @@ export { Header } from './Header/Header';
export { ExplorerLink } from './ExplorerLink/ExplorerLink';
export { ContextMenu } from './ContextMenu/ContextMenu';
export { LabelHelpBox } from './LabelHelpbox/LabelHelpBox';
-export { MainLayout } from './Layouts/MainLayout/MainLayout';
export { Truncate } from './Truncate/Truncate';
export { Countdown } from './Countdown/Countdown';
export { Tabs } from './Tabs/Tabs';
diff --git a/src/renderer/widgets/Layout/index.ts b/src/renderer/widgets/Layout/index.ts
deleted file mode 100644
index 905e368804..0000000000
--- a/src/renderer/widgets/Layout/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { MainLayout } from './ui/MainLayout';
diff --git a/src/renderer/widgets/Layout/ui/MainLayout.tsx b/src/renderer/widgets/Layout/ui/MainLayout.tsx
deleted file mode 100644
index e60a979355..0000000000
--- a/src/renderer/widgets/Layout/ui/MainLayout.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Outlet } from 'react-router-dom';
-
-import { Navigation } from '@/features/navigation';
-import { SelectWalletPairing, WalletSelect } from '@/features/wallets';
-
-export const MainLayout = () => (
-
-);