Skip to content

Commit b45dc50

Browse files
committed
fix: update many flowbite issues with new version
1 parent 60544af commit b45dc50

File tree

12 files changed

+360
-70
lines changed

12 files changed

+360
-70
lines changed

package-lock.json

Lines changed: 313 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"react": "^18.3.1",
4848
"react-content-loader": "^7.0.2",
4949
"react-dom": "^18.3.1",
50+
"react-icons": "^5.5.0",
5051
"react-intl": "^7.1.5",
5152
"react-redux": "^9.2.0",
5253
"react-router-dom": "^6.28.2",

src/renderer/components/blocks/modals/CommitTransferErrorModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Modal } from 'flowbite-react';
2+
import { Modal } from '@/components';
33
import { FormattedMessage } from 'react-intl';
44

55
interface Props {

src/renderer/components/blocks/modals/CommitTransferSuccessModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Modal } from 'flowbite-react';
2+
import { Modal } from '@/components';
33
import { FormattedMessage } from 'react-intl';
44

55
interface Props {

src/renderer/components/blocks/modals/StagedProjectSuccessModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Modal } from 'flowbite-react';
2+
import { Modal } from '@/components';
33
import { FormattedMessage } from 'react-intl';
44

55
interface StagedProjectSuccessModalProps {

src/renderer/components/blocks/modals/StagedUnitSuccessModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Modal } from 'flowbite-react';
2+
import { Modal } from '@/components';
33
import { FormattedMessage } from 'react-intl';
44

55
interface StagedUnitSuccessModalProps {

src/renderer/components/proxy/Button.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
import { Button as FlowbiteButton, ButtonGroupProps, ButtonProps } from 'flowbite-react';
1+
import {
2+
Button as FlowbiteButton,
3+
ButtonGroup as FlowbiteButtonGroup,
4+
ButtonGroupProps,
5+
ButtonProps,
6+
Spinner,
7+
} from 'flowbite-react';
28

3-
function Button({ children, ...props }: ButtonProps) {
4-
return <FlowbiteButton {...props}>{children}</FlowbiteButton>;
9+
interface CustomButtonProps extends ButtonProps {
10+
isProcessing?: boolean;
11+
}
12+
13+
function Button({ children, isProcessing, disabled, ...props }: CustomButtonProps) {
14+
return (
15+
<FlowbiteButton disabled={disabled || isProcessing} {...props}>
16+
{isProcessing && <Spinner size="sm" className="mr-2" />}
17+
{children}
18+
</FlowbiteButton>
19+
);
520
}
621

722
function Group({ children, ...props }: ButtonGroupProps) {
8-
return <FlowbiteButton.Group {...props}>{children}</FlowbiteButton.Group>;
23+
return <FlowbiteButtonGroup {...props}>{children}</FlowbiteButtonGroup>;
924
}
1025

1126
Button.Group = Group;

src/renderer/components/proxy/Dropdown.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import { Dropdown as FlowbiteDropDown, DropdownItemProps, DropdownProps } from 'flowbite-react';
1+
import {
2+
Dropdown as FlowbiteDropDown,
3+
DropdownItem as FlowbiteDropdownItem,
4+
DropdownItemProps,
5+
DropdownProps,
6+
} from 'flowbite-react';
27

38
function Dropdown({ children, ...props }: DropdownProps) {
49
return <FlowbiteDropDown {...props}>{children}</FlowbiteDropDown>;
510
}
611

712
function Item({ children, ...props }: DropdownItemProps) {
8-
return <FlowbiteDropDown.Item {...props}>{children}</FlowbiteDropDown.Item>;
13+
return <FlowbiteDropdownItem {...props}>{children}</FlowbiteDropdownItem>;
914
}
1015

1116
Dropdown.Item = Item;

src/renderer/components/proxy/Modal.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import {
22
Modal as FlowbiteModal,
3+
ModalBody as FlowbiteModalBody,
4+
ModalFooter as FlowbiteModalFooter,
5+
ModalHeader as FlowbiteModalHeader,
36
ModalBodyProps,
47
ModalFooterProps,
58
ModalHeaderProps,
@@ -19,15 +22,15 @@ function Modal({ children, show = true, ...props }: ModalProps) {
1922
}
2023

2124
function Body({ children, ...props }: ModalBodyProps) {
22-
return <FlowbiteModal.Body {...props}>{children}</FlowbiteModal.Body>;
25+
return <FlowbiteModalBody {...props}>{children}</FlowbiteModalBody>;
2326
}
2427

2528
function Header({ children, ...props }: ModalHeaderProps) {
26-
return <FlowbiteModal.Header {...props}>{children}</FlowbiteModal.Header>;
29+
return <FlowbiteModalHeader {...props}>{children}</FlowbiteModalHeader>;
2730
}
2831

2932
function Footer({ children, ...props }: ModalFooterProps) {
30-
return <FlowbiteModal.Footer {...props}>{children}</FlowbiteModal.Footer>;
33+
return <FlowbiteModalFooter {...props}>{children}</FlowbiteModalFooter>;
3134
}
3235

3336
Modal.Body = Body;

src/renderer/components/proxy/Sidebar.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import {
22
Sidebar as FlowbiteSidebar,
3+
SidebarItem as FlowbiteSidebarItem,
4+
SidebarItemGroup as FlowbiteSidebarItemGroup,
5+
SidebarItems as FlowbiteSidebarItems,
36
SidebarItemGroupProps,
47
SidebarItemProps,
58
SidebarItemsProps,
@@ -26,15 +29,15 @@ function Sidebar({ children, ...props }: SidebarProps) {
2629
}
2730

2831
function Items({ children, ...props }: SidebarItemsProps) {
29-
return <FlowbiteSidebar.Items {...props}>{children}</FlowbiteSidebar.Items>;
32+
return <FlowbiteSidebarItems {...props}>{children}</FlowbiteSidebarItems>;
3033
}
3134

3235
function ItemGroup({ children, ...props }: SidebarItemGroupProps) {
33-
return <FlowbiteSidebar.ItemGroup {...props}>{children}</FlowbiteSidebar.ItemGroup>;
36+
return <FlowbiteSidebarItemGroup {...props}>{children}</FlowbiteSidebarItemGroup>;
3437
}
3538

3639
function Item({ children, ...props }: SidebarItemProps) {
37-
return <FlowbiteSidebar.Item {...props}>{children}</FlowbiteSidebar.Item>;
40+
return <FlowbiteSidebarItem {...props}>{children}</FlowbiteSidebarItem>;
3841
}
3942

4043
Sidebar.Item = Item;

0 commit comments

Comments
 (0)