Skip to content

Commit

Permalink
Merge pull request #3396 from cardano-foundation/fix/MET-2103-disable…
Browse files Browse the repository at this point in the history
…-stake-key-not-found

fix: MET-2103 disable stake key not found
  • Loading branch information
Sotatek-TaiTruong committed May 3, 2024
2 parents 65c8fd3 + f6b14b7 commit 993cb8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/AddressDetail/AddressHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ const AddressHeader: React.FC<Props> = ({ data, loading, adaHanldeData }) => {
const {
data: dataStake,
loading: loadingStake,
lastUpdated
lastUpdated,
error
} = useFetch<WalletStake>(stakeKey ? `${API.STAKE.DETAIL}/${stakeKey}` : "", undefined, false, blockKey);

const theme = useTheme();
const { isMobile } = useScreen();
const history = useHistory();
Expand Down Expand Up @@ -202,6 +204,7 @@ const AddressHeader: React.FC<Props> = ({ data, loading, adaHanldeData }) => {
type="right"
address={data?.stakeAddress || ""}
item={itemRight}
error={error}
loading={loading || loadingStake}
addressDestination={details.stake(data?.stakeAddress)}
/>
Expand Down
11 changes: 9 additions & 2 deletions src/components/share/CardAddress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ export interface DetailCardProps {
type: "left" | "right";
loading: boolean;
addressDestination?: string;
error?: string | null;
}
const CardAddress: React.FC<DetailCardProps> = ({ title, address, item, type, loading, addressDestination }) => {
const CardAddress: React.FC<DetailCardProps> = ({ title, address, item, type, loading, addressDestination, error }) => {
if (loading) {
return (
<CardItemStyled padding={0}>
Expand All @@ -49,7 +50,13 @@ const CardAddress: React.FC<DetailCardProps> = ({ title, address, item, type, lo
{type === "left" ? (
<TokenAddress>{address}</TokenAddress>
) : (
<AddressLink to={addressDestination || details.address(address)}>{address}</AddressLink>
<Box
component={error !== null ? TokenAddress : AddressLink}
to={addressDestination || details.address(address)}
color={({ palette }) => (error !== null ? `${palette.secondary[600]} !important` : "inherit")}
>
{address}
</Box>
)}
<CopyButton text={address} />
</AddressGroup>
Expand Down

0 comments on commit 993cb8d

Please sign in to comment.