Skip to content

feat: add BSNs to delegationList #1155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: jb-implement-chain-selection
Choose a base branch
from

Conversation

jeremy-babylonlabs
Copy link
Collaborator

No description provided.

@jeremy-babylonlabs jeremy-babylonlabs changed the base branch from main to jb-implement-chain-selection June 23, 2025 05:02
@jeremy-babylonlabs jeremy-babylonlabs force-pushed the feat/delegation-list-bsn-support branch from 8e81bb6 to 1702ccc Compare June 23, 2025 08:18
@jeremy-babylonlabs jeremy-babylonlabs marked this pull request as ready for review June 24, 2025 03:57
return (
<AuthGuard>
<Section title="Activity">
<Delegations />
<DelegationList />
{renderDelegationList()}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{renderDelegationList()}
{FeatureFlagService.IsPhase3Enabled ?
<FinalityProviderBsnState>
<DelegationList />
</FinalityProviderBsnState>
: <DelegationList />}

Comment on lines +11 to +14
if (lowerCaseBsnName in chainLogos) {
return chainLogos[lowerCaseBsnName as BsnLogoKey];
}
return chainLogos.placeholder;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (lowerCaseBsnName in chainLogos) {
return chainLogos[lowerCaseBsnName as BsnLogoKey];
}
return chainLogos.placeholder;
return return chainLogos[lowerCaseBsnName as BsnLogoKey] ?? chainLogos.placeholder;

Comment on lines +177 to +193
const { getFinalityProvidersBsns } = useFinalityProviderBsnState();

const handleBsnClick = (delegation: DelegationWithFP) => {
setBsnPreviewModal({ delegation });
};

const closeBsnPreviewModal = () => {
setBsnPreviewModal(null);
};

const columnOrder = FeatureFlagService.IsPhase3Enabled
? phase3ColumnOrder
: defaultColumnOrder;

const tableColumns = columnOrder
.map((key) => columnDefinitions.get(key))
.filter(Boolean) as TableColumn<DelegationWithFP, TableParams>[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just use a separate config for phase-3 table. You don't need change any logic here. Just reuse GridTable component with different configurations

},
],
[
"stakingTxHashHex",
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't need this

Comment on lines +99 to +104
if (FeatureFlagService.IsPhase3Enabled) {
return {
...delegationWithFP,
fps: allFinalityProviders,
};
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it's allowed to use FF on this level (actually we should use it only once in our code)

export const SelectedBsnPreviewModal = ({
onClose,
bsnList,
finalityProviders,
Copy link
Collaborator

Choose a reason for hiding this comment

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

you only need FP here, cause you can always restore BSN from FP (FP has a BSN id)

Comment on lines +34 to +36
{Array.from({
length: Math.max(bsnList.length, finalityProviders.length),
}).map((_, index) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

the comment from above would help you simplify this

Comment on lines +69 to +92
<div className="w-8 h-8 rounded-lg bg-primary flex items-center justify-center flex-shrink-0">
{fp.logo_url ? (
<img
src={fp.logo_url}
alt={
fp.description?.moniker || "Finality Provider"
}
className="w-6 h-6 rounded"
/>
) : (
<div className="w-6 h-6 bg-accent-secondary rounded flex items-center justify-center">
<span className="text-xs text-white">
{(fp.description?.moniker || "FP")
.charAt(0)
.toUpperCase()}
</span>
</div>
)}
</div>
<span className="text-accent-primary text-sm">
{fp.description?.moniker ||
"Unknown Finality Provider"}
</span>
</>
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use avatar here

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll review this one later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants