Skip to content

Commit

Permalink
fix: MET-1953 update filter governance
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-TaiTruong committed Apr 3, 2024
1 parent 95f278a commit e2b6e36
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/components/GovernanceVotes/index.tsx
Expand Up @@ -1260,7 +1260,9 @@ const FilterGovernanceVotes: React.FC<FilterGovernanceVotes> = ({ query, setQuer
<FormControlLabel
key={i.value}
value={i.value}
checked={i.value === params?.actionType}
checked={
params?.actionType ? i.value === params?.actionType : POOLS_ACTION_TYPE.ALL === i.value
}
control={
<Radio
sx={{
Expand Down Expand Up @@ -1316,7 +1318,9 @@ const FilterGovernanceVotes: React.FC<FilterGovernanceVotes> = ({ query, setQuer
<FormControlLabel
key={i.value}
value={i.value}
checked={i.value === params?.currentStatus}
checked={
params?.currentStatus ? i.value === params?.currentStatus : STATUS_VOTE.ANY === i.value
}
control={
<Radio
sx={{
Expand Down Expand Up @@ -1372,7 +1376,7 @@ const FilterGovernanceVotes: React.FC<FilterGovernanceVotes> = ({ query, setQuer
<FormControlLabel
key={i.value}
value={i.value}
checked={i.value === params?.vote}
checked={params?.vote ? i.value === params?.vote : STATUS_VOTE.ANY === i.value}
control={
<Radio
sx={{
Expand Down
4 changes: 3 additions & 1 deletion src/components/commons/DetailHeader/index.tsx
Expand Up @@ -209,7 +209,9 @@ const DetailHeader: React.FC<DetailHeaderProps> = (props) => {
? t("status.active")
: stakeKeyStatus === "INACTIVE"
? t("status.inActive")
: t("status.deActivated")}
: stakeKeyStatus === "DEACTIVATED"
? t("status.deActivated")
: t("status.retired")}
</StakeKeyStatus>
)}
{redirectAction && <Box marginLeft={"auto"}>{redirectAction}</Box>}
Expand Down
4 changes: 4 additions & 0 deletions src/components/commons/DetailHeader/styles.ts
Expand Up @@ -123,6 +123,8 @@ export const StakeKeyStatus = styled("small")<{ status?: StakeStatus }>`
switch (status) {
case "ACTIVE":
return theme.palette.success[800];
case "RETIRED":
return theme.palette.error[800];
default:
return theme.isDark ? theme.palette.warning[100] : theme.palette.secondary.light;
}
Expand All @@ -131,6 +133,8 @@ export const StakeKeyStatus = styled("small")<{ status?: StakeStatus }>`
switch (status) {
case "ACTIVE":
return theme.palette.success[100];
case "RETIRED":
return theme.palette.error[100];
default:
return theme.isDark ? theme.palette.warning[800] : alpha(theme.palette.secondary.light, 0.2);
}
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Expand Up @@ -343,6 +343,7 @@
"drawer.status": "Status",
"status.active": "ACTIVE",
"status.deactivated": "DEACTIVATED",
"status.retired": "RETIRED",
"drawer.rewardAvailable": "Reward available",
"drawer.withDrawn": "Reward withdrawn",
"drawer.delegatedTo": "Delegated to",
Expand Down
2 changes: 1 addition & 1 deletion src/types/drep.d.ts
Expand Up @@ -7,7 +7,7 @@ interface DrepOverview {
drepHash: string;
drepId: string;
liveStake: number;
status: "ACTIVE" | "INACTIVE";
status: "ACTIVE" | "INACTIVE" | "RETIRED";
votingParticipation: number;
type: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/stakeKey.d.ts
Expand Up @@ -10,7 +10,7 @@ interface IStakeKey {
poolNames: string[];
}

type StakeStatus = "ACTIVE" | "DEACTIVATED" | "INACTIVE";
type StakeStatus = "ACTIVE" | "DEACTIVATED" | "INACTIVE" | "RETIRED";

interface IStakeKeyDetail {
status: StakeStatus;
Expand Down

0 comments on commit e2b6e36

Please sign in to comment.