Skip to content

Commit bd8abcf

Browse files
Merge pull request #1475 from Chia-Network/flowbite1
Fix flowbite styling to for new flowbite version
2 parents fbdb87f + b625f6e commit bd8abcf

File tree

15 files changed

+1183
-919
lines changed

15 files changed

+1183
-919
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,8 @@ The "subject" of the commit follows. It should be a short indication of the chan
133133
### Commit linting
134134

135135
Each time you commit the message will be checked against these standards in a pre-commit hook. Additionally all the commits in a PR branch will be linted before it can be merged to master.
136+
137+
## Attribution
138+
139+
* [Document Object Model](https://www.w3.org/TR/DOM-Requirements/) by [W3C](https://www.w3.org/) licensed under [CC BY 4.0](http://creativecommons.org/licenses/by/4.0/)
140+
* [caniuselite](https://github.com/browserslist/caniuse-lite) by [Browserlist](https://browsersl.ist/) licensed under [CC BY 4.0](http://creativecommons.org/licenses/by/4.0/)

package-lock.json

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

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cadt-ui",
33
"private": true,
4-
"version": "2.0.5",
4+
"version": "2.0.6",
55
"type": "module",
66
"main": "build/main.js",
77
"engineStrict": true,
@@ -39,14 +39,15 @@
3939
"diff": "^7.0.0",
4040
"express": "^4.21.2",
4141
"flowbite": "^3.1.2",
42-
"flowbite-react": "^0.10.2",
42+
"flowbite-react": "^0.12.8",
4343
"flowbite-typography": "^1.0.5",
4444
"formik": "^2.4.6",
4545
"lodash": "^4.17.21",
4646
"qrcode.react": "^3.2.0",
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/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ function App() {
5757
if (!configFileLoading) setTimeout(() => setAppLoading(false), 400);
5858
}, [configFileLoading]);
5959

60+
// Initialize theme mode on app startup
61+
useEffect(() => {
62+
// Ensure the body class matches the initial theme state
63+
document.body.classList.toggle('dark', appStore.isDarkTheme);
64+
}, [appStore.isDarkTheme]);
65+
6066
if (!translationTokens || configFileLoading || themeColorsFileLoading || appLoading) {
6167
return <ComponentCenteredSpinner />;
6268
}

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;

0 commit comments

Comments
 (0)