Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

feat: adds header - #1246

Closed
jonybur wants to merge 7 commits into
mainfrom
jb-1201
Closed

feat: adds header#1246
jonybur wants to merge 7 commits into
mainfrom
jb-1201

Conversation

@jonybur

@jonybur jonybur commented Jul 13, 2025

Copy link
Copy Markdown

@jonybur jonybur changed the title Jb 1201 feat: adds header Jul 13, 2025
@jonybur
jonybur changed the base branch from feat/baby-staking-logic-new to jb-integrate-baby July 13, 2025 22:07
Comment on lines +24 to +47
<nav className="flex gap-6 justify-center items-center">
<Link
to="/btc"
className={twJoin(
"w-32 h-10 text-center whitespace-nowrap flex items-center justify-center",
pathname.startsWith("/btc")
? "text-accent-primary"
: "text-accent-secondary",
)}
>
BTC Staking
</Link>
<Link
to="/baby"
className={twJoin(
"w-32 h-10 text-center whitespace-nowrap flex items-center justify-center",
pathname.startsWith("/baby")
? "text-accent-primary"
: "text-accent-secondary",
)}
>
BABY Staking
</Link>
</nav>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move it to separate component:

<Nav>
  <NavItem title="BTC Staking" to="/btc" />
  <NavItem title="BABY Staking" to="/baby"  />
</Nav>

Comment on lines +36 to +46
<Link
to="/baby"
className={twJoin(
"w-32 h-10 text-center whitespace-nowrap flex items-center justify-center",
pathname.startsWith("/baby")
? "text-accent-primary"
: "text-accent-secondary",
)}
>
BABY Staking
</Link>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use NavLink instead:

<NavLink
  to="/messages"
  className={({ isActive, isPending, isTransitioning }) =>
    [
      isPending ? "pending" : "",
      isActive ? "active" : "",
      isTransitioning ? "transitioning" : "",
    ].join(" ")
  }
>
  Messages
</NavLink>

Docs: https://reactrouter.com/start/framework/navigating

@0xDazzer
0xDazzer changed the base branch from jb-integrate-baby to main July 14, 2025 09:58
Comment thread src/ui/baby/index.tsx
export default function BabyStaking() {
const cosmosWallet = useCosmosWallet();
const { bech32Address, connected } = cosmosWallet;
console.log({ cosmosWallet });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to remove?

Comment thread src/ui/baby/index.tsx
Comment thread src/ui/baby/index.tsx
}, 0);
};

const totalStaked = delegations.reduce((total, delegation) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add anything does not fit into the MVP. The more code we have, the more issues/bug we may discover which delay the delivery.
Keep it simply and lean is the best option for now

Comment thread src/ui/baby/index.tsx
try {
await claimRewards(bech32Address, validatorAddress);
await delegationRewardsQuery.refetch();
alert("Rewards claimed successfully!");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to have alert for successful event?

Comment thread src/ui/baby/index.tsx
<p className="text-lg font-bold">{validators.length}</p>
</div>
</div>
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we have a dedicated tab for rewards? In that case we don't need this stats tab for MVP.
User can refer to their wallet for balance and rewards tab for the rewards amount

Comment thread src/ui/baby/index.tsx
const stakedAmount = ubbnToBaby(
parseFloat(delegation.balance?.amount || "0"),
);
const rewardsAmount = getRewardsForValidator(validatorAddress);

@jrwbabylonlab jrwbabylonlab Jul 14, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, not fully understanding what we showing here. are you plan to show rewards per delegation? i could not find this in the design file.
We should have a single button to claim all rewards instead

const BBN_REWARDS_KEY = "BBN_REWARDS";
const BBN_DELEGATIONS_KEY = "BBN_DELEGATIONS";
const BBN_DELEGATION_REWARDS_KEY = "BBN_DELEGATION_REWARDS";
const BBN_VALIDATORS_KEY = "BBN_VALIDATORS";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should start seperating the BTC and BABY here.
For example BBN_REWARDS_KEY is actual BBN_BTC_STAKING_REWARDS_KEY.

/**
* [BABY Staking] Gets all delegations of the user's account.
*/
const delegationsQuery = useClientQuery({

@jrwbabylonlab jrwbabylonlab Jul 14, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about name it properly as babyStakingDelegationQuery etc so that we not confused with btc staking.
Of course, the old btc ones should be renamed too

@jonybur jonybur closed this Jul 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants