Skip to content

Commit 540f37d

Browse files
committed
extract button for submit tx
1 parent dc44dc0 commit 540f37d

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Button, ButtonProps } from "@mui/material";
2+
import { useDefaultGateway, useOnBoarding } from "../../hooks/index.ts";
3+
import { isUndefined } from "@xylabs/typeof";
4+
5+
export const SubmitTransactionButton: React.FC<ButtonProps> = (props) => {
6+
const { gateway } = useDefaultGateway()
7+
const { showSubmitTransaction } = useOnBoarding()
8+
9+
return showSubmitTransaction ? <Button variant="contained" disabled={isUndefined(gateway)} sx={{ alignSelf: 'start' }} {...props}>Submit Transaction</Button> : null
10+
}

src/components/buttons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './SubmitTransactionButton.tsx'

src/components/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './alerts/index.ts'
22
export * from './Onboarding.tsx'
3-
export * from './WelcomeStack.tsx'
3+
export * from './WelcomeStack.tsx'
4+
export * from './buttons/index.ts'

0 commit comments

Comments
 (0)