fix(gui): simplify wallet seedphrase dialog open button

This commit is contained in:
Binarybaron 2025-10-05 23:02:58 +02:00
parent 65a46a4205
commit 706aaf1fe7
2 changed files with 65 additions and 73 deletions

View file

@ -19,35 +19,25 @@ export default function SeedPhraseButton({
onMenuClose,
onSeedPhraseSuccess,
}: SeedPhraseButtonProps) {
const handleSeedPhraseSuccess = (
response: [GetMoneroSeedResponse, GetRestoreHeightResponse],
) => {
onSeedPhraseSuccess(response);
onMenuClose();
};
return (
<MenuItem component="div">
<PromiseInvokeButton
onInvoke={getMoneroSeedAndRestoreHeight}
onSuccess={handleSeedPhraseSuccess}
onSuccess={onSeedPhraseSuccess}
displayErrorSnackbar={true}
variant="text"
contextRequirement={isContextWithMoneroWallet}
component={MenuItem}
disableRipple={false}
sx={{
justifyContent: "flex-start",
textTransform: "none",
padding: 0,
minHeight: "auto",
width: "100%",
color: "text.primary",
borderRadius: "0px",
}}
color="inherit"
>
<ListItemIcon>
<KeyIcon />
</ListItemIcon>
<Typography>Seedphrase</Typography>
</PromiseInvokeButton>
</MenuItem>
);
}

View file

@ -72,12 +72,12 @@ export default function WalletActionButtons({
open={sendDialogOpen}
onClose={() => setSendDialogOpen(false)}
/>
<Box sx={{ display: "flex", justifyContent: "space-between" }}>
<Box
sx={{
display: "flex",
flexWrap: "wrap",
gap: 1,
mb: 2,
alignItems: "center",
}}
>
@ -96,7 +96,8 @@ export default function WalletActionButtons({
clickable
/>
<DfxButton />
</Box>
<Box>
<IconButton onClick={handleMenuClick}>
<MoreHorizIcon />
</IconButton>
@ -118,6 +119,7 @@ export default function WalletActionButtons({
/>
</Menu>
</Box>
</Box>
</>
);
}