-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeesun Kim
authored and
Jeesun Kim
committed
Apr 17, 2024
1 parent
684a80a
commit 1e9f7eb
Showing
7 changed files
with
109 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Alert } from "@stellar/design-system"; | ||
|
||
export const ErrorMsg = ({ | ||
onClose, | ||
isVisible, | ||
errorMsg, | ||
}: { | ||
onClose: () => void | undefined; | ||
isVisible: boolean; | ||
errorMsg: string | undefined; | ||
}) => { | ||
return isVisible ? ( | ||
<Alert | ||
placement="inline" | ||
variant="error" | ||
onClose={onClose} | ||
title={errorMsg} | ||
> | ||
{""} | ||
</Alert> | ||
) : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Alert } from "@stellar/design-system"; | ||
|
||
import { useStore } from "@/store/useStore"; | ||
|
||
import { shortenStellarAddress } from "@/helpers/shortenStellarAddress"; | ||
|
||
export const SuccessMsg = ({ | ||
onClose, | ||
isVisible, | ||
}: { | ||
onClose: () => void | undefined; | ||
isVisible: boolean; | ||
}) => { | ||
const { account, network } = useStore(); | ||
const IS_STELLAR_EXPERT_ENABLED = | ||
network.id === "testnet" || network.id === "mainnet"; | ||
|
||
return isVisible ? ( | ||
<Alert | ||
placement="inline" | ||
variant="success" | ||
actionLabel={ | ||
IS_STELLAR_EXPERT_ENABLED ? "View on stellar.expert" : undefined | ||
} | ||
actionLink={ | ||
IS_STELLAR_EXPERT_ENABLED | ||
? `https://stellar.expert/explorer/${network.id}/account/${account.publicKey}` | ||
: undefined | ||
} | ||
onClose={onClose} | ||
title={`Successfully funded ${shortenStellarAddress(account.publicKey!)} on | ||
${network.id}`} | ||
> | ||
{""} | ||
</Alert> | ||
) : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters