forked from JackHamer09/zksync-plus
-
Notifications
You must be signed in to change notification settings - Fork 56
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
1 parent
4467973
commit 746cb8e
Showing
10 changed files
with
191 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
WALLET_CONNECT_PROJECT_ID=373a8744ceaac00934aec708a3fceea6 | ||
ANKR_TOKEN= | ||
ANKR_TOKEN=d39966271ddadd0313304908744721c7c9c0c83e2785d73602990c8b46267f83 |
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,88 @@ | ||
<template> | ||
<div class="w-max" ref="el"> | ||
<CommonButton | ||
v-if="!explorerUrl" | ||
size="xs" | ||
variant="light" | ||
:disabled="!transactionHash" | ||
class="transaction-hash-button" | ||
@click="copy()" | ||
> | ||
Copy hash | ||
<CommonSpinner v-if="!transactionHash" class="transaction-hash-button-icon" aria-hidden="true" /> | ||
<DocumentDuplicateIcon v-else class="transaction-hash-button-icon" aria-hidden="true" /> | ||
</CommonButton> | ||
<template v-else> | ||
<CommonButton | ||
v-if="!transactionHash" | ||
size="xs" | ||
variant="light" | ||
target="_blank" | ||
disabled | ||
class="transaction-hash-button" | ||
> | ||
Explorer | ||
<CommonSpinner class="transaction-hash-button-icon" aria-hidden="true" /> | ||
</CommonButton> | ||
<CommonButton | ||
v-else | ||
size="xs" | ||
variant="light" | ||
as="a" | ||
:href="`${explorerUrl}/tx/${transactionHash}`" | ||
target="_blank" | ||
class="transaction-hash-button" | ||
> | ||
Explorer | ||
<ArrowTopRightOnSquareIcon class="transaction-hash-button-icon" aria-hidden="true" /> | ||
</CommonButton> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, ref, watch } from "vue"; | ||
import { useTippy } from "vue-tippy"; | ||
import { ArrowTopRightOnSquareIcon, DocumentDuplicateIcon } from "@heroicons/vue/24/outline"; | ||
import useCopy from "@/composables/useCopy"; | ||
const props = defineProps({ | ||
explorerUrl: { | ||
type: String, | ||
}, | ||
transactionHash: { | ||
type: String, | ||
}, | ||
}); | ||
const { copy, copied } = useCopy(computed(() => props.transactionHash || "")); | ||
const el = ref<HTMLButtonElement | undefined>(); | ||
const a = useTippy(el, { | ||
content: "Transaction hash copied!", | ||
trigger: "manual", | ||
hideOnClick: false, | ||
}); | ||
watch( | ||
copied, | ||
(copied) => { | ||
if (copied) { | ||
a.show(); | ||
} else { | ||
a.hide(); | ||
} | ||
}, | ||
{ immediate: true } | ||
); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.transaction-hash-button { | ||
@apply w-max; | ||
.transaction-hash-button-icon { | ||
@apply -mr-1 ml-2 h-6 w-6; | ||
} | ||
} | ||
</style> |
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
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
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