@meddleware/access-gate-ui 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@meddleware/access-gate-ui",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
+ "homepage": "https://docs.meddleware.co.uk/blockchain/sui/access-gate/",
4
5
  "description": "Operator console for creating and managing on-chain Sui access gates — create gates, configure settings, airdrop NFTs, and freeze gates via a wallet-connected SPA.",
5
6
  "author": "Meddleware <dev@meddleware.co.uk>",
6
7
  "license": "0BSD",
@@ -38,7 +39,7 @@
38
39
  },
39
40
  "dependencies": {
40
41
  "@meddleware/design-tokens": "^0.1.2",
41
- "@meddleware/ui": "^0.1.10",
42
+ "@meddleware/ui": "^0.1.11",
42
43
  "@meddleware/nft-gate-client": "^0.0.6",
43
44
  "@meddleware/wallet-adapter": "^0.0.5",
44
45
  "@mysten/sui": "^2.30.0",
package/src/App.vue CHANGED
@@ -10,6 +10,7 @@ import { NETWORK } from './config.js'
10
10
  import AccessGateView from './components/AccessGateView.vue'
11
11
 
12
12
  const { mode, set } = useColorMode('dark')
13
+ const DOCS_URL = import.meta.env.VITE_DOCS_URL || 'https://docs.meddleware.co.uk/blockchain/sui/access-gate/'
13
14
  const { wallets, account, connect, disconnect } = useWallet()
14
15
 
15
16
  async function onConnect(): Promise<void> {
@@ -42,7 +43,7 @@ async function onConnect(): Promise<void> {
42
43
 
43
44
  <AccessGateView />
44
45
 
45
- <AppFooter />
46
+ <AppFooter :docs-url="DOCS_URL" />
46
47
  </div>
47
48
  </template>
48
49
 
@@ -7,7 +7,7 @@
7
7
  // Gate loading is driven by watching the connected account, so it works whether the connection
8
8
  // is made from this app's own header (standalone) or the dashboard's shared control (embedded).
9
9
  import { ref, watch } from 'vue'
10
- import { UiNotice } from '@meddleware/ui'
10
+ import { AppTabNav, UiNotice, type AppTab } from '@meddleware/ui'
11
11
  import { WalletGuard } from '@meddleware/wallet-adapter'
12
12
  import type { OwnedGate } from '@meddleware/nft-gate-client'
13
13
  import { NETWORK } from '../config.js'
@@ -16,8 +16,16 @@ import { useWallet } from '../wallet.js'
16
16
  import CreateGateForm from './CreateGateForm.vue'
17
17
  import GateList from './GateList.vue'
18
18
 
19
- type Tab = 'create' | 'gates'
20
- const activeTab = ref<Tab>('gates')
19
+ const TABS: AppTab[] = [
20
+ { id: 'gates', label: 'My gates' },
21
+ { id: 'create', label: 'Create gate' },
22
+ ]
23
+ const activeTab = ref<string>('gates')
24
+
25
+ function onTabChange(id: string): void {
26
+ activeTab.value = id
27
+ if (id === 'gates') void reloadGates()
28
+ }
21
29
 
22
30
  const { account } = useWallet()
23
31
 
@@ -66,14 +74,7 @@ function onCreated(): void {
66
74
  </UiNotice>
67
75
 
68
76
  <WalletGuard v-else message="Connect a Sui wallet to create and manage your access gates.">
69
- <nav class="tabs" aria-label="Sections">
70
- <button type="button" class="tab" :class="{ active: activeTab === 'gates' }" @click="activeTab = 'gates'; reloadGates()">
71
- My gates
72
- </button>
73
- <button type="button" class="tab" :class="{ active: activeTab === 'create' }" @click="activeTab = 'create'">
74
- Create gate
75
- </button>
76
- </nav>
77
+ <AppTabNav :tabs="TABS" :model-value="activeTab" aria-label="Sections" style="margin: 0 0 1rem" @update:model-value="onTabChange" />
77
78
 
78
79
  <UiNotice v-if="loadError" type="error">{{ loadError }}</UiNotice>
79
80
 
@@ -100,27 +101,4 @@ function onCreated(): void {
100
101
  margin: 0.25rem 0 1.25rem;
101
102
  }
102
103
 
103
- .tabs {
104
- display: flex;
105
- gap: 0.25rem;
106
- margin: 0 0 1rem;
107
- border-bottom: 2px solid var(--border);
108
- }
109
-
110
- .tab {
111
- background: none;
112
- border: none;
113
- border-bottom: 2px solid transparent;
114
- padding: 0.5rem 1rem;
115
- margin-bottom: -2px;
116
- cursor: pointer;
117
- font-size: 0.95rem;
118
- color: var(--muted);
119
- }
120
-
121
- .tab.active {
122
- border-bottom-color: var(--accent);
123
- color: var(--text);
124
- font-weight: 600;
125
- }
126
104
  </style>