Skip to content

Commit

Permalink
Merge pull request #3205 from cardano-foundation/feat/MET-1957-pools-…
Browse files Browse the repository at this point in the history
…details-views

Feat/met 1957 pool details views
  • Loading branch information
Sotatek-TaiTruong committed Mar 29, 2024
2 parents 6c2fce6 + 9d2df79 commit a92c3f6
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 37 deletions.
1 change: 1 addition & 0 deletions src/commons/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const API = {
POOL: "pools",
POOL_CERTIFICATE: {
POOL: "gov-actions",
POOL_CHART: "gov-actions/voting-chart",
POOL_DETAIL: (poolId: string) => `gov-actions/${poolId}/voting-procedure-detail`
},
POOL_CERTIFICATES_HISTORY: "pools/certificates-history",
Expand Down
5 changes: 4 additions & 1 deletion src/commons/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ export enum POOLS_ACTION_TYPE {
UPDATE_COMMITTEE = "UPDATE_COMMITTEE",
HARD_FORK_INITIATION_ACTION = "HARD_FORK_INITIATION_ACTION",
NO_CONFIDENCE = "NO_CONFIDENCE",
INFO_ACTION = "INFO_ACTION"
INFO_ACTION = "INFO_ACTION",
NEW_CONSTITUTION = "NEW_CONSTITUTION",
TREASURY_WITHDRAWALS_ACTION = "TREASURY_WITHDRAWALS_ACTION",
PARAMETER_CHANGE_ACTION = "PARAMETER_CHANGE_ACTION"
}

export enum VOTE_TYPE {
Expand Down
8 changes: 8 additions & 0 deletions src/commons/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export const getShortValue = (address = "", length = 50) => {
return address.slice(0, length);
};

export const getShortNumber = (number = 0, length = 3) => {
return Number(number.toFixed(length));
};

export const LARGE_NUMBER_ABBREVIATIONS = ["", "K", "M", "B", "T", "q", "Q", "s", "S"];

export const formatPrice = (value?: string | number, abbreviations: string[] = LARGE_NUMBER_ABBREVIATIONS): string => {
Expand Down Expand Up @@ -200,6 +204,10 @@ export const formatDateTimeLocal = (date: string) => {
return moment(moment(`${date} GMT+0000`).local(true)).format("MM/DD/YYYY HH:mm:ss");
};

export const formatDate = (date: string) => {
return moment(date).format("DD/MM/YYYY");
};

export const getEpochSlotNo = (data: IDataEpoch) => {
if (data.status === "FINISHED") {
return MAX_SLOT_EPOCH;
Expand Down

0 comments on commit a92c3f6

Please sign in to comment.