Skip to content

Commit f4548df

Browse files
Revert "feat(packages): init renewal flow ui components (#252)" (#253)
This reverts commit 454d4e8.
1 parent 6ee7242 commit f4548df

File tree

14 files changed

+71
-526
lines changed

14 files changed

+71
-526
lines changed

.github/workflows/service-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
NEXT_PUBLIC_FF_ENABLE_LEDGER: ${{ vars.NEXT_PUBLIC_FF_ENABLE_LEDGER }}
7272
NEXT_PUBLIC_FF_PHASE_3: ${{ vars.NEXT_PUBLIC_FF_PHASE_3 }}
7373
NEXT_PUBLIC_FF_CO_STAKING: ${{ vars.NEXT_PUBLIC_FF_CO_STAKING }}
74-
NEXT_PUBLIC_FF_TIMELOCK_RENEWAL: ${{ vars.NEXT_PUBLIC_FF_TIMELOCK_RENEWAL }}
7574

7675
- name: Generate sha256sum checksum
7776
run: |

services/simple-staking/src/ui/common/components/ActivityCard/ActivityCard.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { StakeExpansionSection } from "@/ui/common/components/Activity/component
33
import { DelegationWithFP } from "@/ui/common/types/delegationsV2";
44
import FeatureFlagService from "@/ui/common/utils/FeatureFlagService";
55

6+
import { ActivityCardActionSection } from "./components/ActivityCardActionSection";
67
import { ActivityCardAmountSection } from "./components/ActivityCardAmountSection";
78
import { ActivityCardDetailsSection } from "./components/ActivityCardDetailsSection";
89

@@ -68,7 +69,6 @@ export function ActivityCard({ data, className }: ActivityCardProps) {
6869
icon={data.icon}
6970
iconAlt={data.iconAlt}
7071
primaryAction={data.primaryAction}
71-
secondaryActions={data.secondaryActions}
7272
/>
7373
<ActivityCardDetailsSection
7474
details={data.details}
@@ -83,6 +83,9 @@ export function ActivityCard({ data, className }: ActivityCardProps) {
8383
isPendingExpansion={data.isPendingExpansion}
8484
/>
8585
)}
86+
{data.secondaryActions && data.secondaryActions.length > 0 && (
87+
<ActivityCardActionSection actions={data.secondaryActions} />
88+
)}
8689
</div>
8790
);
8891
}
Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
import { Button } from "@babylonlabs-io/core-ui";
22

3-
import FeatureFlagService from "@/ui/common/utils/FeatureFlagService";
4-
5-
import {
6-
ThreeDotsMenu,
7-
ThreeDotsMenuItem,
8-
} from "../../ThreeDotsMenu/ThreeDotsMenu";
93
import { ActivityCardActionButton } from "../ActivityCard";
104

115
interface ActivityCardAmountSectionProps {
126
formattedAmount: string;
137
icon?: string | React.ReactNode;
148
iconAlt?: string;
159
primaryAction?: ActivityCardActionButton;
16-
secondaryActions?: ActivityCardActionButton[];
1710
}
1811

1912
export function ActivityCardAmountSection({
2013
formattedAmount,
2114
icon,
2215
iconAlt,
2316
primaryAction,
24-
secondaryActions,
2517
}: ActivityCardAmountSectionProps) {
2618
return (
2719
<div className="mb-4 flex items-center justify-between sm:mb-6">
@@ -41,39 +33,17 @@ export function ActivityCardAmountSection({
4133
</span>
4234
</div>
4335

44-
<div className="flex items-center gap-2">
45-
{primaryAction && (
46-
<Button
47-
variant={primaryAction.variant || "contained"}
48-
size={primaryAction.size || "small"}
49-
className={`sm:bbn-btn-medium ${primaryAction.className || ""}`}
50-
onClick={primaryAction.onClick}
51-
disabled={primaryAction.disabled}
52-
>
53-
{primaryAction.label}
54-
</Button>
55-
)}
56-
57-
{FeatureFlagService.IsTimelockRenewalEnabled &&
58-
secondaryActions &&
59-
secondaryActions.length > 0 && (
60-
<ThreeDotsMenu
61-
buttonClassName="sm:bbn-btn-medium h-9 flex items-center justify-center rounded border border-secondary-strokeLight px-2 py-1 hover:bg-secondary-highlight transition-colors"
62-
popoverClassName="min-w-48 rounded border border-secondary-strokeLight bg-surface shadow-md"
63-
>
64-
{secondaryActions.map((action, index) => (
65-
<ThreeDotsMenuItem
66-
key={index}
67-
onClick={action.onClick}
68-
disabled={action.disabled}
69-
className={action.className}
70-
>
71-
{action.label}
72-
</ThreeDotsMenuItem>
73-
))}
74-
</ThreeDotsMenu>
75-
)}
76-
</div>
36+
{primaryAction && (
37+
<Button
38+
variant={primaryAction.variant || "contained"}
39+
size={primaryAction.size || "small"}
40+
className={`sm:bbn-btn-medium ${primaryAction.className || ""}`}
41+
onClick={primaryAction.onClick}
42+
disabled={primaryAction.disabled}
43+
>
44+
{primaryAction.label}
45+
</Button>
46+
)}
7747
</div>
7848
);
7949
}

services/simple-staking/src/ui/common/components/ActivityCard/components/ContinueRenewalIcon.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

services/simple-staking/src/ui/common/components/ActivityCard/components/ContinueRenewalMessage.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

services/simple-staking/src/ui/common/components/ActivityCard/utils/actionButtonUtils.ts

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
DelegationWithFP,
66
} from "@/ui/common/types/delegationsV2";
77
import { FinalityProviderState } from "@/ui/common/types/finalityProviders";
8-
import FeatureFlagService from "@/ui/common/utils/FeatureFlagService";
98

109
import { ActivityCardActionButton } from "../ActivityCard";
1110

@@ -20,36 +19,16 @@ export const getActionButton = (
2019
// Define action mapping
2120
const actionMap: Record<
2221
string,
23-
Record<
24-
string,
25-
{
26-
action: ActionType;
27-
title: string;
28-
secondaryActions?: { action: ActionType; title: string }[];
29-
}
30-
>
22+
Record<string, { action: ActionType; title: string }>
3123
> = {
3224
[FinalityProviderState.ACTIVE]: {
3325
[DelegationV2StakingState.VERIFIED]: {
3426
action: ACTIONS.STAKE,
3527
title: "Stake",
3628
},
3729
[DelegationV2StakingState.ACTIVE]: {
38-
...(FeatureFlagService.IsTimelockRenewalEnabled
39-
? {
40-
action: ACTIONS.RENEW_TIMELOCK,
41-
title: "Renew",
42-
secondaryActions: [
43-
{
44-
action: ACTIONS.UNBOND,
45-
title: "Unbond",
46-
},
47-
],
48-
}
49-
: {
50-
action: ACTIONS.UNBOND,
51-
title: "Unbond",
52-
}),
30+
action: ACTIONS.UNBOND,
31+
title: "Unbond",
5332
},
5433
[DelegationV2StakingState.EARLY_UNBONDING_WITHDRAWABLE]: {
5534
action: ACTIONS.WITHDRAW_ON_EARLY_UNBONDING,
@@ -74,21 +53,8 @@ export const getActionButton = (
7453
title: "Stake",
7554
},
7655
[DelegationV2StakingState.ACTIVE]: {
77-
...(FeatureFlagService.IsTimelockRenewalEnabled
78-
? {
79-
action: ACTIONS.RENEW_TIMELOCK,
80-
title: "Renew",
81-
secondaryActions: [
82-
{
83-
action: ACTIONS.UNBOND,
84-
title: "Unbond",
85-
},
86-
],
87-
}
88-
: {
89-
action: ACTIONS.UNBOND,
90-
title: "Unbond",
91-
}),
56+
action: ACTIONS.UNBOND,
57+
title: "Unbond",
9258
},
9359
[DelegationV2StakingState.EARLY_UNBONDING_WITHDRAWABLE]: {
9460
action: ACTIONS.WITHDRAW_ON_EARLY_UNBONDING,
@@ -181,16 +147,3 @@ export const getActionButton = (
181147
className: isUnbondDisabled ? "opacity-50" : "",
182148
};
183149
};
184-
185-
export const getSecondaryActions = (): ActivityCardActionButton[] => {
186-
return [
187-
{
188-
label: "Unbond",
189-
onClick: () => {},
190-
variant: "outlined",
191-
size: "small",
192-
disabled: false,
193-
className: "text-accent-primary",
194-
},
195-
];
196-
};

services/simple-staking/src/ui/common/components/Modals/RenewalVerifiedModal.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

services/simple-staking/src/ui/common/components/Multistaking/ChainSelectionModal/shared/ChainButton.tsx

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { Button, FinalityProviderItem } from "@babylonlabs-io/core-ui";
22
import { twMerge } from "tailwind-merge";
33

4-
import {
5-
ThreeDotsMenu,
6-
ThreeDotsMenuItem,
7-
} from "@/ui/common/components/ThreeDotsMenu/ThreeDotsMenu";
4+
import { ThreeDotsMenu } from "@/ui/common/components/ThreeDotsMenu/ThreeDotsMenu";
85

96
import { ChainButtonProps } from "./types";
107

@@ -50,42 +47,26 @@ export const ChainButton = ({
5047
</div>
5148
{provider ? (
5249
<ThreeDotsMenu
50+
onChange={() => {
51+
if (bsnId) {
52+
onRemove?.(bsnId);
53+
}
54+
onSelectFp?.();
55+
}}
56+
onRemove={() => onRemove?.(bsnId || "")}
5357
className="rounded p-1 hover:bg-secondary-highlight"
54-
buttonClassName="p-1"
55-
>
56-
<ThreeDotsMenuItem
57-
onClick={() => {
58-
if (bsnId) {
59-
onRemove?.(bsnId);
60-
}
61-
onSelectFp?.();
62-
}}
63-
>
64-
Change FP
65-
</ThreeDotsMenuItem>
66-
<ThreeDotsMenuItem onClick={() => onRemove?.(bsnId || "")}>
67-
Remove BSN
68-
</ThreeDotsMenuItem>
69-
</ThreeDotsMenu>
58+
/>
7059
) : isExisting ? (
7160
<ThreeDotsMenu
61+
onChange={() => {
62+
if (bsnId) {
63+
onRemove?.(bsnId);
64+
}
65+
onSelectFp?.();
66+
}}
67+
onRemove={() => onRemove?.(bsnId || "")}
7268
className="rounded p-1 hover:bg-secondary-highlight"
73-
buttonClassName="p-1"
74-
>
75-
<ThreeDotsMenuItem
76-
onClick={() => {
77-
if (bsnId) {
78-
onRemove?.(bsnId);
79-
}
80-
onSelectFp?.();
81-
}}
82-
>
83-
Change FP
84-
</ThreeDotsMenuItem>
85-
<ThreeDotsMenuItem onClick={() => onRemove?.(bsnId || "")}>
86-
Remove BSN
87-
</ThreeDotsMenuItem>
88-
</ThreeDotsMenu>
69+
/>
8970
) : (
9071
<Button
9172
variant="outlined"

0 commit comments

Comments
 (0)