Skip to content

Commit

Permalink
fix unstake on delegations with no bond details
Browse files Browse the repository at this point in the history
  • Loading branch information
fmtabbara committed Jan 2, 2025
1 parent 7ba3f39 commit fb0c462
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions explorer-nextjs/src/components/staking/StakeActions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MoreVert } from "@mui/icons-material";
import { IconButton, Menu, MenuItem } from "@mui/material";
import { IconButton, Menu, MenuItem, Typography } from "@mui/material";
import { useState } from "react";

type StakeAction = "unstake";
Expand Down Expand Up @@ -72,7 +72,7 @@ const StakeAction = ({
onSelect();
}}
>
{actionName}
<Typography variant="h5">{actionName}</Typography>
</MenuItem>
);
};
Expand Down
9 changes: 3 additions & 6 deletions explorer-nextjs/src/components/staking/StakeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const StakeTable = ({ nodes }: { nodes: MappedNymNodes }) => {
Cell: ({ row }) => (
<Stack spacing={1}>
<Typography variant="body4">
{row.original.node?.bondInformation.node_id || "-"}
{row.original.delegation?.node_id || "-"}
</Typography>
<Typography variant="body5">
{row.original.node?.bondInformation.node.identity_key || "-"}
Expand Down Expand Up @@ -215,12 +215,9 @@ const StakeTable = ({ nodes }: { nodes: MappedNymNodes }) => {
Header: <ColumnHeading>Action</ColumnHeading>,
Cell: ({ row }) => (
<StakeActions
nodeId={row.original.node?.bondInformation.node_id}
nodeId={row.original.delegation?.node_id}
onActionSelect={(action) => {
handleActionSelect(
action,
row.original.node?.bondInformation.node_id,
);
handleActionSelect(action, row.original.delegation?.node_id);
}}
/>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useNymClient } from "@/hooks/useNymClient";
import { Button, Stack } from "@mui/material";
import { Link } from "../muiLink";

const SubHeaderRowActions = () => {
const { address } = useNymClient();
Expand All @@ -13,7 +14,9 @@ const SubHeaderRowActions = () => {
return (
<Stack direction="row" spacing={3} justifyContent={"end"}>
<Button variant="outlined">Redeem all rewards</Button>
<Button variant="contained">Stake NYM</Button>
<Link href="/explorer">
<Button variant="contained">Stake NYM</Button>
</Link>
</Stack>
);
};
Expand Down

0 comments on commit fb0c462

Please sign in to comment.