Skip to content

Commit

Permalink
Merge pull request #210 from proximax-foundry/develop
Browse files Browse the repository at this point in the history
Release-v1.3.0
  • Loading branch information
shinneng authored May 23, 2023
2 parents dfd40da + 6c31a2d commit 9a46f29
Show file tree
Hide file tree
Showing 16 changed files with 273 additions and 134 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<link rel="icon" href="/ProximaX-Favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ProximaX Sirius Explorer</title>
<title>Sirius Explorer</title>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorer-vite",
"version": "1.2.2",
"version": "1.3.0",
"private": true,
"scripts": {
"dev": "vite ",
Expand Down
2 changes: 1 addition & 1 deletion src/components/footerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
<div>
<div class="text-xxs sm:text-xs text-white mb-5">
Copyright 2022 ProximaX. All rights reserved.
Copyright © 2023. All Rights Reserved.
</div>
<div>
<p class="media-link">
Expand Down
141 changes: 94 additions & 47 deletions src/modules/account/components/MultisigComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,49 +92,20 @@
<div class="gray-line my-8"></div>
<div class="text-xs font-semibold">Cosignatory of</div>
<div class="border p-4 mt-3">
<div class="flex flex-col gap-2">
<div
v-for="(multisig, index) in multisigAccountsList"
:key="index"
<div v-if="multisigLength" class="w-full">
<button
class="mr-5 w-32 blue-btn px-3 py-3 disabled:opacity-50 disabled:cursor-auto"
@click="expandTree()"
>
<div class="border w-full rounded-md p-3">
<div class="flex items-center">
<div
:id="`multisigAddress${index}`"
:copyValue="multisig"
copySubject="Address"
class="text-txs font-bold mt-1"
>
<router-link
:to="{
name: 'ViewAccount',
params: { accountParam: multisig },
}"
class="hover:text-blue-primary hover:underline"
>
{{ multisig }}
</router-link>
</div>
<img
src="@/assets/img/icon-copy.svg"
@click="copy(`multisigAddress${index}`)"
class="ml-2 w-4 h-4 cursor-pointer"
/>
<router-link
:to="{
name: 'ViewAccount',
params: { accountParam: multisig },
}"
class="hover:bg-gray-200 w-7 h-7 ml-auto flex justify-center items-center rounded-full duration-300 transition-all cursor-pointer"
>
<img
src="@/assets/img/chevron_right.svg"
class="w-5 h-5"
/>
</router-link>
</div>
</div>
</div>
Expand All
</button>
<button
class="w-32 blue-btn px-3 py-3 disabled:opacity-50 disabled:cursor-auto"
@click="collapseTree()"
>
Collapse All
</button>
<Tree v-model:expandedKeys="expandedKeys" :value="multisigAccountsList" :filter="true" filterMode="strict" @node-select="onNodeSelect" selectionMode="single" class="pt-1.5"></Tree>
</div>
<div
v-if="!multisigLength"
Expand Down Expand Up @@ -168,14 +139,21 @@ import SchemeComponent from "@/modules/account/components/SchemeComponent.vue";
import { useToast } from "primevue/usetoast";
import { copyToClipboard } from "@/util/functions";
import { Helper } from "@/util/typeHelper";
import { useRouter } from "vue-router";
import Tree from 'primevue/tree';
import type { TreeNode, TreeExpandedKeys } from "primevue/tree";
interface multisig {
key: string, label: string, selectable: boolean, children: { key: string, label: string, data:string, selectable: boolean }[]
}
const props = defineProps({
cosignatories: {
type: Array<string>,
required: true,
},
multisig: {
type: Array<string>,
type: Array<multisig>,
required: true,
},
address: {
Expand All @@ -186,8 +164,13 @@ const props = defineProps({
type: String,
required: true,
},
multisigLength: {
type: Number,
required: true,
},
});
const router = useRouter();
const currentComponent = ref("multisig");
const toast = useToast();
const prettyAddress = computed(() => {
Expand All @@ -198,10 +181,6 @@ const cosignerLength = computed(() => {
return props.cosignatories.length;
});
const multisigLength = computed(() => {
return props.multisig.length;
});
const multisigAccountsList = computed(() => {
return props.multisig;
});
Expand All @@ -226,8 +205,76 @@ const copy = (id: string) => {
}
}
};
const onNodeSelect = (node:TreeNode) => {
router.push({
name: "ViewAccount",
params: { accountParam: node.data},
});
}
const setCurrentComponent = (page: string) => {
currentComponent.value = page;
};
const expandedKeys = ref<TreeExpandedKeys>({});
const expandTree = () => {
for (let node of multisigAccountsList.value) {
expandNode(node);
}
expandedKeys.value = { ...expandedKeys.value };
};
const collapseTree = () => {
expandedKeys.value = {};
};
const expandNode = (node:TreeNode) => {
if (node.children && node.children.length) {
expandedKeys.value[node.key as string] = true;
}
};
expandTree()
</script>

<style scoped lang="scss">
.p-tree:deep{
.p-tree {
border: 1px solid #495057;
background: #ffffff;
color: #495057;
padding: 1.25rem;
border-radius: 6px;
}
.p-link {
margin-top: 0px;
}
.p-treenode-children {
padding: 0 0 0 1rem;
}
.p-tree-container .p-treenode .p-treenode-content {
border-radius: 6px;
transition: box-shadow 0.2s;
padding: 0.5rem;
}
.p-treenode-label{
border: 1px solid rgb(231, 231, 234);
border-radius: 6px;
padding: 20px 12px;
width: 100%;
font-size: 10px;
line-height: 12px;
font-weight: 700;
}
.p-tree-filter-container{
width: 99%;
border: 1px solid rgb(231, 231, 234);
border-radius: 6px;
padding: 6px 10px;
margin: 6px 0px
}
.p-tree-filter{
width: 98%;
outline: none;
height: 40px;
}
}
</style>
24 changes: 8 additions & 16 deletions src/modules/account/components/NamespaceComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,15 @@
namespace.expiringRelativeTime == 'undefined NaN undefined NaN'
"
v-tooltip.bottom="
'<tiptitle>End Block: ' +
namespace.endHeight +
'</tiptitle><tiptext>No expiry</tiptext>'
{ value: `<tiptitle>End Block:${namespace.endHeight}</tiptitle>` +
`<tiptext>No expiry</tiptext>`, escape: true }
"
>{{ namespace.endHeight }}</span
><span
v-else
v-tooltip.bottom="
'<tiptitle>End Block: ' +
namespace.endHeight +
'</tiptitle><tiptext>Estimated expiring on ' +
namespace.expiringRelativeTime +
'</tiptext>'
{ value: `<tiptitle>End Block:${namespace.endHeight}</tiptitle>` +
`<tiptext>Estimated expiring on ${namespace.expiringRelativeTime} </tiptext>`, escape: true }
"
>{{ namespace.endHeight }}</span
>
Expand Down Expand Up @@ -139,19 +135,15 @@
namespace.expiringRelativeTime == 'undefined NaN undefined NaN'
"
v-tooltip.bottom="
'<tiptitle>End Block: ' +
namespace.endHeight +
'</tiptitle><tiptext>No expiry</tiptext>'
{ value: `<tiptitle>End Block:${namespace.endHeight}</tiptitle>` +
`<tiptext>No expiry</tiptext>`, escape: true }
"
>{{ namespace.endHeight }}</span
><span
v-else
v-tooltip.bottom="
'<tiptitle>End Block: ' +
namespace.endHeight +
'</tiptitle><tiptext>Estimated expiring on ' +
namespace.expiringRelativeTime +
'</tiptext>'
{ value: `<tiptitle>End Block:${namespace.endHeight}</tiptitle>` +
`<tiptext>Estimated expiring on ${namespace.expiringRelativeTime} </tiptext>`, escape: true }
"
>{{ namespace.endHeight }}</span
>
Expand Down
Loading

0 comments on commit 9a46f29

Please sign in to comment.