Skip to content

Commit e1e3ac0

Browse files
committed
chore: remove redundant isDisabled prop
1 parent fc42af5 commit e1e3ac0

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

packages/app/src/systems/Home/components/HomeActions/HomeActions.stories.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,3 @@ export const Usage = () => (
1212
<HomeActions />
1313
</Box>
1414
);
15-
16-
export const Disabled = () => (
17-
<Box css={{ width: 300 }}>
18-
<HomeActions isDisabled />
19-
</Box>
20-
);

packages/app/src/systems/Home/components/HomeActions/HomeActions.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('HomeActions', () => {
2121
});
2222

2323
it("should show 'Send' and 'Receive' button disabled", async () => {
24-
render(<HomeActions isDisabled />, { wrapper: TestWrapper });
24+
render(<HomeActions />, { wrapper: TestWrapper });
2525
expect(await screen.findByLabelText('Send Button')).toHaveAttribute(
2626
'aria-disabled'
2727
);

packages/app/src/systems/Home/components/HomeActions/HomeActions.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import { Box, Button, Icon, Tooltip } from '@fuel-ui/react';
33
import { useAccounts } from '~/systems/Account';
44

55
export type HomeActionsProps = {
6-
isDisabled?: boolean;
76
receiveAction?: () => void;
87
sendAction?: () => void;
98
};
109

1110
export const HomeActions = ({
12-
isDisabled,
1311
receiveAction = () => {},
1412
sendAction = () => {},
1513
}: HomeActionsProps) => {
@@ -21,7 +19,7 @@ export const HomeActions = ({
2119
intent="primary"
2220
aria-label="Send Button"
2321
onPress={sendAction}
24-
isDisabled={isLoading || isDisabled || !hasBalance}
22+
isDisabled={isLoading || !hasBalance}
2523
css={{ ...styles.button }}
2624
>
2725
Send
@@ -37,7 +35,7 @@ export const HomeActions = ({
3735
)}
3836
<Button
3937
leftIcon={<Icon icon="Qrcode" />}
40-
isDisabled={isDisabled}
38+
isDisabled={isLoading}
4139
onPress={receiveAction}
4240
variant="ghost"
4341
css={styles.button}

packages/app/src/systems/Home/pages/Home/Home.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ export function Home() {
3535
isLoading={isLoading}
3636
onChangeVisibility={setVisibility}
3737
/>
38-
<HomeActions
39-
receiveAction={goToReceive}
40-
sendAction={sendAction}
41-
isDisabled={isLoading}
42-
/>
38+
<HomeActions receiveAction={goToReceive} sendAction={sendAction} />
4339
<Tabs defaultValue="assets" variant="link" css={styles.assets}>
4440
<Tabs.List>
4541
<Tabs.Trigger value="assets" aria-label="Assets">

0 commit comments

Comments
 (0)