-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from celenium-io/dusk-11
Dusk 11
- Loading branch information
Showing
13 changed files
with
363 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup> | ||
import EmptyHolder from "~/components/shared/EmptyHolder.vue" | ||
import LoadingHolder from "@/components/shared/LoadingHolder.vue" | ||
import DepositsTable from "~/components/tables/DepositsTable.vue" | ||
const props = defineProps({ | ||
deposits: { | ||
type: Array, | ||
}, | ||
isLoading: { | ||
type: Boolean, | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<Flex direction="column" :class="$style.wrapper"> | ||
<LoadingHolder v-if="isLoading" title="Loading bridge deposits.." /> | ||
|
||
<DepositsTable v-if="deposits.length > 0" :isLoading="isLoading" :deposits="deposits" /> | ||
|
||
<EmptyHolder v-else-if="!isLoading" title=" This account did not receive any deposits" /> | ||
</Flex> | ||
</template> | ||
|
||
<style module> | ||
.wrapper { | ||
position: relative; | ||
border-radius: 8px; | ||
box-shadow: inset 0 0 0 1px var(--op-5); | ||
background: var(--op-3); | ||
/* padding: 8px 0 8px 0; */ | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup> | ||
import EmptyHolder from "~/components/shared/EmptyHolder.vue" | ||
import LoadingHolder from "@/components/shared/LoadingHolder.vue" | ||
import DepositsTable from "~/components/tables/DepositsTable.vue" | ||
const props = defineProps({ | ||
deposits: { | ||
type: Array, | ||
}, | ||
isLoading: { | ||
type: Boolean, | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<Flex direction="column" :class="$style.wrapper"> | ||
<LoadingHolder v-if="isLoading" title="Loading deposits.." /> | ||
|
||
<DepositsTable v-if="deposits.length > 0" :isLoading="isLoading" :deposits="deposits" /> | ||
|
||
<EmptyHolder v-else-if="!isLoading" title=" This rollup did not wire any deposits" /> | ||
</Flex> | ||
</template> | ||
|
||
<style module> | ||
.wrapper { | ||
position: relative; | ||
border-radius: 8px; | ||
box-shadow: inset 0 0 0 1px var(--op-5); | ||
background: var(--op-3); | ||
/* padding: 8px 0 8px 0; */ | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
<script setup> | ||
/** Vendor */ | ||
import { DateTime } from "luxon" | ||
/** UI */ | ||
import Tooltip from "@/components/ui/Tooltip.vue" | ||
/** Components */ | ||
import LinkToEntity from "@/components/shared/LinkToEntity.vue" | ||
/** Services */ | ||
import { capitalize, formatBytes, midHash, spaces } from "@/services/utils" | ||
import { getRollupHashSafeURL } from "~/services/utils/rollups" | ||
/** API */ | ||
import { fetchTxByHash } from "~/services/api/tx" | ||
/** Store */ | ||
import { useSidebarsStore } from "@/store/sidebars" | ||
const sidebarsStore = useSidebarsStore() | ||
const props = defineProps({ | ||
deposits: { | ||
type: Array, | ||
}, | ||
}) | ||
const handleOpenTx = async (deposit) => { | ||
const { data } = await fetchTxByHash(deposit.tx_hash) | ||
if (data.value) { | ||
sidebarsStore.open("tx", data.value) | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<Flex direction="column" :class="$style.wrapper"> | ||
<Flex | ||
v-if="deposits" | ||
v-for="d in deposits" | ||
@click="handleOpenTx(d)" | ||
justify="between" | ||
align="center" | ||
:class="[$style.row, isLoading && $style.disabled]" | ||
> | ||
<Flex direction="column" gap="8"> | ||
<Flex align="center" gap="6"> | ||
<Icon name="role" size="16" color="secondary" /> | ||
|
||
<Flex v-if="d.bridge" gap="4"> | ||
<Text size="13" weight="500" color="primary"> | ||
{{ `Wired deposit of ${spaces(d.amount)} ${(d.asset).toUpperCase()} to` }} | ||
</Text> | ||
|
||
<LinkToEntity | ||
:entity="{ title: midHash(d.bridge), type: 'account', id: d.bridge }" | ||
color="primary" | ||
size="13" | ||
:class="$style.link" | ||
/> | ||
</Flex> | ||
|
||
<Text v-else size="13" weight="500" color="primary"> | ||
{{ `Received deposit of ${spaces(d.amount)} ${(d.asset).toUpperCase()}` }} | ||
</Text> | ||
</Flex> | ||
|
||
<Flex align="center" gap="8"> | ||
<Text size="12" color="tertiary">Block</Text> | ||
|
||
<LinkToEntity :entity="{ title: spaces(d.height), type: 'block', id: d.height }" color="secondary" :class="$style.link" /> | ||
|
||
<div :class="$style.dot" /> | ||
|
||
<Text size="12" color="tertiary"> {{ DateTime.fromISO(d.time).setLocale("en").toFormat("tt, LLL d, y") }} </Text> | ||
</Flex> | ||
</Flex> | ||
|
||
<Tooltip> | ||
<!-- <Flex align="center" gap="4"> | ||
<Text size="13" weight="600" color="primary"> {{ spaces(rollup.actions_count) }} </Text> | ||
<Icon name="action" size="13" color="tertiary" /> | ||
</Flex> | ||
<template #content> | ||
<Text size="12" color="tertiary">Actions count</Text> | ||
</template> --> | ||
</Tooltip> | ||
</Flex> | ||
</Flex> | ||
</template> | ||
|
||
<style module> | ||
.wrapper { | ||
position: relative; | ||
} | ||
.loading { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translateY(-50%) translateX(-50%); | ||
} | ||
.row { | ||
height: 60px; | ||
border-top: 1px solid var(--op-5); | ||
cursor: pointer; | ||
padding: 0 16px; | ||
transition: all 0.2s ease; | ||
&:hover { | ||
background: var(--op-5); | ||
} | ||
&:first-child { | ||
border-top-left-radius: 8px; | ||
border-top-right-radius: 8px; | ||
border-top: none; | ||
} | ||
&:last-child { | ||
border-bottom-left-radius: 8px; | ||
border-bottom-right-radius: 8px; | ||
} | ||
&:active { | ||
background: var(--op-10); | ||
} | ||
&.disabled { | ||
pointer-events: none; | ||
opacity: 0.2; | ||
} | ||
} | ||
.row_general_list { | ||
height: 60px; | ||
border-top: 1px solid var(--op-5); | ||
cursor: pointer; | ||
padding: 0 16px; | ||
transition: all 0.2s ease; | ||
&:hover { | ||
background: var(--op-5); | ||
} | ||
&:last-child { | ||
border-bottom-left-radius: 8px; | ||
border-bottom-right-radius: 8px; | ||
} | ||
&:active { | ||
background: var(--op-10); | ||
} | ||
&.disabled { | ||
pointer-events: none; | ||
opacity: 0.2; | ||
} | ||
} | ||
.dot { | ||
width: 4px; | ||
height: 4px; | ||
border-radius: 50%; | ||
background: var(--op-10); | ||
} | ||
.link { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
</style> |
Oops, something went wrong.