Skip to content

Commit

Permalink
Merge pull request #3721 from cardano-foundation/fix/popup-adress-sc-…
Browse files Browse the repository at this point in the history
…detail

fix: popup address sc detail
  • Loading branch information
Sotatek-TaiTruong authored Jul 17, 2024
2 parents 73b6d3e + 3219dcf commit f53a5f3
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions src/pages/SmartContractDetail/ViewAddressesModal.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useTranslation } from "react-i18next";
import { Box, CircularProgress } from "@mui/material";
import { useTranslation } from "react-i18next";

import useFetch from "src/commons/hooks/useFetch";
import { details } from "src/commons/routers";
import { API } from "src/commons/utils/api";
import DynamicEllipsisText from "src/components/DynamicEllipsisText";
import CustomModal from "src/components/commons/CustomModal";
import { API } from "src/commons/utils/api";
import { details } from "src/commons/routers";
import { EmptyRecord } from "src/components/commons/Table";

import { ContentModal, StyledAddressModal, StyledLink, SubTitleModal, TitleModal } from "./styles";

Expand All @@ -27,18 +28,24 @@ const ViewAddressesModal: React.FC<TViewAddressesModalProps> = ({ open, onClose,
<CircularProgress />
</Box>
)}
{!loading && data?.length && (
<ContentModal>
<SubTitleModal>{t("glossary.address")}:</SubTitleModal>
<StyledAddressModal>
{data &&
data.map((add: string) => (
<StyledLink to={add.startsWith("stake") ? details.stake(add) : details.address(add)} key={add}>
<DynamicEllipsisText value={add} isTooltip sxFirstPart={{ maxWidth: "calc(100% - 80px)" }} />
</StyledLink>
))}
</StyledAddressModal>
</ContentModal>
{!loading ? (
data?.length ? (
<ContentModal>
<SubTitleModal>{t("glossary.address")}:</SubTitleModal>
<StyledAddressModal>
{data &&
data.map((add: string) => (
<StyledLink to={add.startsWith("stake") ? details.stake(add) : details.address(add)} key={add}>
<DynamicEllipsisText value={add} isTooltip sxFirstPart={{ maxWidth: "calc(100% - 80px)" }} />
</StyledLink>
))}
</StyledAddressModal>
</ContentModal>
) : (
<EmptyRecord />
)
) : (
<></>
)}
</CustomModal>
);
Expand Down

0 comments on commit f53a5f3

Please sign in to comment.