Skip to content

Commit

Permalink
fix: update ui in galaxy fold
Browse files Browse the repository at this point in the history
  • Loading branch information
DinhTran committed Feb 29, 2024
1 parent 3cc5426 commit 09a3f44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/commons/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export const getShortHash = (address = "", firstpart?: number, lastPart?: number
: "";
};

export const getShortHashXs = (address = "", firstpart?: number, lastPart?: number) => {
if (address?.length <= 18) return address;
return address ? `${address.slice(0, firstpart ? firstpart : 7)}...${address.slice(-(lastPart ? lastPart : 5))}` : "";
};

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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useTranslation } from "react-i18next";

import CustomTooltip from "src/components/commons/CustomTooltip";
import { details } from "src/commons/routers";
import { formatADAFull, getShortHash } from "src/commons/utils/helper";
import { formatADAFull, getShortHash, getShortHashXs } from "src/commons/utils/helper";
import useFetch from "src/commons/hooks/useFetch";
import { API } from "src/commons/utils/api";
import CustomModal from "src/components/commons/CustomModal";
Expand Down Expand Up @@ -39,6 +39,7 @@ const OperatorReward = () => {
const { data } = useFetch<PoolInfo>(API.SPO_LIFECYCLE.SPO_POOL_INFO(poolId));
const SPOHolderRef = useRef(null);
const cardanoBlockchainRef = useRef(null);
const { isGalaxyFoldSmall } = useScreen();

const paths = useMemo((): LineArrowItem[] => {
return [
Expand All @@ -62,7 +63,7 @@ const OperatorReward = () => {
<HoldBoxTitle>{t("common.rewardAccount")}</HoldBoxTitle>
<SPOHolderBox
data={{
poolName: getShortHash(data?.poolName),
poolName: isGalaxyFoldSmall ? getShortHashXs(data?.poolName) : getShortHash(data?.poolName),
poolView: data?.poolView,
stakeKeys: data?.rewardAccounts
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/commons/CustomModal/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const WrapTitle = styled(Box)(({ theme }) => ({
position: "relative",
zIndex: 2,
[theme.breakpoints.down("sm")]: {
maxWidth: " 100% - 40px)",
maxWidth: "calc(100% - 40px)",
fontSize: 20,
lineHeight: "23px"
}
Expand Down

0 comments on commit 09a3f44

Please sign in to comment.