From e415cf452e46e692e51d1efb270509752095b7e7 Mon Sep 17 00:00:00 2001 From: dinhtran Date: Mon, 4 Mar 2024 15:00:13 +0700 Subject: [PATCH 1/5] fix: fix display protocol data --- .../TransactionMetadata/ProtocolUpdate/styles.ts | 7 ++++++- src/pages/ProtocolParameter/index.tsx | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/TransactionDetail/TransactionMetadata/ProtocolUpdate/styles.ts b/src/components/TransactionDetail/TransactionMetadata/ProtocolUpdate/styles.ts index 2020d44642..909d280633 100644 --- a/src/components/TransactionDetail/TransactionMetadata/ProtocolUpdate/styles.ts +++ b/src/components/TransactionDetail/TransactionMetadata/ProtocolUpdate/styles.ts @@ -37,7 +37,12 @@ export const UpdatedValue = styled(Box)(() => ({ export const Wrapper = styled(Box)(({ theme }) => ({ border: `1px solid ${theme.isDark ? theme.palette.secondary[700] : theme.palette.primary[200]}`, borderRadius: theme.spacing(2), - overflow: "hidden" + overflow: "hidden", + "& .table-wrapper": { + [theme.breakpoints.down("sm")]: { + paddingBottom: "8px" + } + } })); export const LimitCell = styled(Box)` diff --git a/src/pages/ProtocolParameter/index.tsx b/src/pages/ProtocolParameter/index.tsx index d8151efe57..4669e39ffc 100644 --- a/src/pages/ProtocolParameter/index.tsx +++ b/src/pages/ProtocolParameter/index.tsx @@ -28,7 +28,7 @@ import InfoSolidIcon from "src/components/commons/InfoSolidIcon"; import { details, lists } from "src/commons/routers"; import { API } from "src/commons/utils/api"; import { PROTOCOL_TYPE } from "src/commons/utils/constants"; -import { formatDateTimeLocal } from "src/commons/utils/helper"; +import { formatDateTimeLocal, getShortValue } from "src/commons/utils/helper"; import ParseScriptModal from "src/components/ParseScriptModal"; import Card from "src/components/commons/Card"; import DateRangeModal from "src/components/commons/CustomFilter/DateRangeModal"; @@ -233,7 +233,7 @@ const ProtocolParameter: React.FC = () => { textOverflow={"ellipsis"} color={({ palette }) => (isModalType ? palette.primary.main : "unset")} > - {r.value} + {getShortValue(r.value)} ); From cc38f04c08975859fa8d2fffd9cbfce153bf3e21 Mon Sep 17 00:00:00 2001 From: dinhtran Date: Mon, 4 Mar 2024 16:00:42 +0700 Subject: [PATCH 2/5] fix: add to string for value --- src/pages/ProtocolParameter/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ProtocolParameter/index.tsx b/src/pages/ProtocolParameter/index.tsx index 4669e39ffc..7cde75666e 100644 --- a/src/pages/ProtocolParameter/index.tsx +++ b/src/pages/ProtocolParameter/index.tsx @@ -233,7 +233,7 @@ const ProtocolParameter: React.FC = () => { textOverflow={"ellipsis"} color={({ palette }) => (isModalType ? palette.primary.main : "unset")} > - {getShortValue(r.value)} + {getShortValue(r.value?.toString())} ); From aca5d00dc6d8cb6b9b89badc51cf64c2928f07f4 Mon Sep 17 00:00:00 2001 From: dinhtran Date: Mon, 4 Mar 2024 16:44:33 +0700 Subject: [PATCH 3/5] fix: display data histories on ios --- src/pages/ProtocolParameter/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ProtocolParameter/index.tsx b/src/pages/ProtocolParameter/index.tsx index 7cde75666e..0b74e18524 100644 --- a/src/pages/ProtocolParameter/index.tsx +++ b/src/pages/ProtocolParameter/index.tsx @@ -100,7 +100,7 @@ const ProtocolParameter: React.FC = () => { >; return { name, - value: name === "costModel" ? JSON.stringify(valueObject) : convertedObj?.value, + value: name === "costModel" ? getShortValue(JSON.stringify(valueObject)) : convertedObj?.value, epochNo: convertedObj?.epochNo, time: convertedObj?.time }; From b7d12a806994781b5d04b97225cfcee58d16b4ba Mon Sep 17 00:00:00 2001 From: dinhtran Date: Mon, 4 Mar 2024 17:07:01 +0700 Subject: [PATCH 4/5] fix: display data histories on ios --- src/pages/ProtocolParameter/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ProtocolParameter/index.tsx b/src/pages/ProtocolParameter/index.tsx index 0b74e18524..1818f75834 100644 --- a/src/pages/ProtocolParameter/index.tsx +++ b/src/pages/ProtocolParameter/index.tsx @@ -171,7 +171,7 @@ const ProtocolParameter: React.FC = () => { textOverflow={"ellipsis"} color={({ palette }) => (isModalType ? palette.primary.main : "unset")} > - {r.value} + {getShortValue(r.value?.toString())} ); From 2385a21171ade8f6787307908ca4d900cbec479e Mon Sep 17 00:00:00 2001 From: DinhTran Date: Tue, 5 Mar 2024 14:20:55 +0700 Subject: [PATCH 5/5] fix: fix display protocol parameter updates --- src/pages/ProtocolParameter/index.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/ProtocolParameter/index.tsx b/src/pages/ProtocolParameter/index.tsx index 1818f75834..ec1925bf1f 100644 --- a/src/pages/ProtocolParameter/index.tsx +++ b/src/pages/ProtocolParameter/index.tsx @@ -499,9 +499,19 @@ export const ProtocolParameterHistory = () => { } }, [JSON.stringify(dataHistory)]); + const newCostModel = dataHistory?.costModel.map((item): TProtocolItem => { + return { + ...item, + value: getShortValue(item.value?.toString() || "") + }; + }) as TProtocolItem[]; + useUpdateEffect(() => { - if (columnTitle) { - getDataColumn(dataHistory); + if (columnTitle && dataHistory) { + getDataColumn({ + ...dataHistory, + costModel: newCostModel + }); setColumnsTable([...columnsFull]); } }, [JSON.stringify(columnTitle), JSON.stringify(dataHistory)]);