Skip to content

Commit 9cf1279

Browse files
authored
Merge pull request #11319 from hassnian/issue-11116
feat: Collection Atomic Swaps support
2 parents 048b651 + 8d9d01a commit 9cf1279

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1360
-481
lines changed

components/collection/CollectionSwaps.vue components/collection/CollectionTrades.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919

2020
<script setup lang="ts">
2121
import { type TradeTableQuery } from '@/components/trade/TradeActivityTable.vue'
22+
import type { TradeType } from '@/components/trade/types'
2223
23-
const tradeType = TradeType.SWAP
24+
defineProps<{
25+
tradeType: TradeType
26+
}>()
2427
2528
const route = useRoute()
2629
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<template>
2+
<div class="w-full h-[50px]">
3+
<div class="flex justify-between">
4+
<div class="flex">
5+
<div>
6+
<NeoSkeleton
7+
no-margin
8+
height="48px"
9+
width="48px"
10+
:rounded="false"
11+
/>
12+
</div>
13+
14+
<div class="flex flex-col justify-between ml-4 w-[100px] md:w-[170px]">
15+
<NeoSkeleton
16+
no-margin
17+
:rounded="false"
18+
width="130px"
19+
/>
20+
21+
<NeoSkeleton
22+
no-margin
23+
:rounded="false"
24+
width="90px"
25+
/>
26+
</div>
27+
</div>
28+
29+
<div class="flex items-end">
30+
<NeoSkeleton
31+
no-margin
32+
:rounded="false"
33+
width="60px"
34+
/>
35+
</div>
36+
</div>
37+
</div>
38+
</template>
39+
40+
<script setup lang="ts">
41+
import { NeoSkeleton } from '@kodadot1/brick'
42+
</script>

components/common/ConnectWallet/WalletAsset.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,30 @@
77
<MultipleBalances />
88
</div>
99

10-
<WalletAssetMenu />
10+
<div class="h-full flex flex-col justify-end gap-5">
11+
<WalletAssetTrades v-if="tradeVisible(urlPrefix) && vm === walletVm" />
12+
<WalletAssetMenu />
13+
</div>
1114
</div>
1215
</template>
1316

1417
<script lang="ts" setup>
1518
import WalletAssetIdentity from './WalletAssetIdentity.vue'
1619
import WalletAssetNfts from './WalletAssetNfts.vue'
1720
import WalletAssetMenu from './WalletAssetMenu.vue'
21+
import WalletAssetTrades from './WalletAssetTrades.vue'
1822
import { useIdentityStore } from '@/stores/identity'
23+
import { tradeVisible } from '@/utils/config/permission.config'
1924
2025
const MultipleBalances = defineAsyncComponent(
2126
() => import('@/components/balance/MultipleBalances.vue'),
2227
)
2328
2429
const identityStore = useIdentityStore()
2530
const { $consola } = useNuxtApp()
31+
const { urlPrefix } = usePrefix()
32+
const { vm } = useChain()
33+
const { getWalletVM: walletVm } = storeToRefs(useWalletStore())
2634
2735
if (identityStore.getAuthAddress) {
2836
$consola.log('fetching balance...')

components/common/ConnectWallet/WalletAssetMenu.vue

+71-73
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,77 @@
11
<template>
2-
<div class="h-full flex flex-col justify-end">
3-
<div
4-
:class="{ 'border-t': filteredMenus.length }"
5-
class="wallet-asset-container flex flex-col"
6-
data-testid="sidebar-wallet-container"
7-
>
8-
<div>
9-
<a
10-
v-for="menu in filteredMenus"
11-
:key="menu.label"
12-
v-safe-href="menu.to"
13-
class="wallet-asset-menu"
14-
>
15-
<span>{{ menu.label }}</span>
16-
<NeoIcon
17-
icon="angle-right"
18-
size="medium"
19-
class="text-k-grey"
20-
/>
21-
</a>
22-
</div>
23-
<div class="wallet-asset-footer flex py-5 text-xs text-k-grey">
24-
<!-- light/dark mode -->
25-
<ColorModeSwitch />
26-
27-
<!-- language -->
28-
<div
29-
data-testid="sidebar-language"
30-
class="language-selector"
2+
<div
3+
:class="{ 'border-t': filteredMenus.length }"
4+
class="wallet-asset-container flex flex-col"
5+
data-testid="sidebar-wallet-container"
6+
>
7+
<div>
8+
<a
9+
v-for="menu in filteredMenus"
10+
:key="menu.label"
11+
v-safe-href="menu.to"
12+
class="wallet-asset-menu"
13+
>
14+
<span>{{ menu.label }}</span>
15+
<NeoIcon
16+
icon="angle-right"
17+
size="medium"
18+
class="text-k-grey"
19+
/>
20+
</a>
21+
</div>
22+
<div class="wallet-asset-footer flex py-5 text-xs text-k-grey">
23+
<!-- light/dark mode -->
24+
<ColorModeSwitch />
25+
26+
<!-- language -->
27+
<div
28+
data-testid="sidebar-language"
29+
class="language-selector"
30+
>
31+
<NeoDropdown
32+
position="top-left"
33+
aria-role="menu"
34+
mobile-modal
3135
>
32-
<NeoDropdown
33-
position="top-left"
34-
aria-role="menu"
35-
mobile-modal
36+
<template #trigger>
37+
<div class="flex items-center">
38+
<NeoIcon
39+
icon="globe"
40+
size="medium"
41+
/>
42+
<span class="is-hidden-mobile ml-1">
43+
{{ $t('profileMenu.language') }}
44+
</span>
45+
</div>
46+
</template>
47+
48+
<NeoDropdownItem
49+
v-for="lang in langsFlags"
50+
:key="lang.value"
51+
aria-role="listitem"
52+
:data-testid="`sidebar-language-${lang.value}`"
53+
:value="lang.value"
54+
:class="{ 'is-active': $i18n.locale === lang.value }"
55+
@click="usePreferencesStore().setUserLocale(lang.value)"
3656
>
37-
<template #trigger>
38-
<div class="flex items-center">
39-
<NeoIcon
40-
icon="globe"
41-
size="medium"
42-
/>
43-
<span class="is-hidden-mobile ml-1">
44-
{{ $t('profileMenu.language') }}
45-
</span>
46-
</div>
47-
</template>
48-
49-
<NeoDropdownItem
50-
v-for="lang in langsFlags"
51-
:key="lang.value"
52-
aria-role="listitem"
53-
:data-testid="`sidebar-language-${lang.value}`"
54-
:value="lang.value"
55-
:class="{ 'is-active': $i18n.locale === lang.value }"
56-
@click="usePreferencesStore().setUserLocale(lang.value)"
57-
>
58-
<span>{{ lang.flag }} {{ lang.label }}</span>
59-
</NeoDropdownItem>
60-
</NeoDropdown>
61-
</div>
62-
63-
<!-- settings -->
64-
<nuxt-link
65-
to="/settings"
66-
class="text-k-grey items-center"
67-
data-testid="sidebar-link-settings"
68-
@click="closeModal"
69-
>
70-
<NeoIcon
71-
icon="gear"
72-
size="medium"
73-
/>
74-
<span class="is-hidden-mobile">{{ $t('settings') }}</span>
75-
</nuxt-link>
57+
<span>{{ lang.flag }} {{ lang.label }}</span>
58+
</NeoDropdownItem>
59+
</NeoDropdown>
7660
</div>
61+
62+
<!-- settings -->
63+
<nuxt-link
64+
to="/settings"
65+
class="text-k-grey items-center"
66+
data-testid="sidebar-link-settings"
67+
@click="closeModal"
68+
>
69+
<NeoIcon
70+
icon="gear"
71+
size="medium"
72+
/>
73+
<span class="is-hidden-mobile">{{ $t('settings') }}</span>
74+
</nuxt-link>
7775
</div>
7876
</div>
7977
</template>
@@ -99,7 +97,7 @@ const menus = ref<{ label: string, to: string, check: (v: Prefix) => boolean }[]
9997
check: teleportVisible,
10098
},
10199
{
102-
label: $i18n.t('swap.swap'),
100+
label: $i18n.t('swap.createSwap'),
103101
to: `/${urlPrefix.value}/swap`,
104102
check: swapVisible,
105103
},

0 commit comments

Comments
 (0)