Skip to content

Commit dc06ccc

Browse files
committed
🚸 Hide user setting and commission if stripe not connected
1 parent a151bcf commit dc06ccc

File tree

1 file changed

+101
-99
lines changed

1 file changed

+101
-99
lines changed

‎pages/nft-book-store/user/index.vue

+101-99
Original file line numberDiff line numberDiff line change
@@ -129,111 +129,113 @@
129129
</template>
130130
</UCard>
131131

132-
<UCard
133-
:ui="{
134-
header: { base: 'flex justify-between items-center' },
135-
body: { padding: '' },
136-
footer: { base: 'text-center' },
137-
}"
138-
>
139-
<template #header>
140-
<h1 class="text-center font-bold font-mono">
141-
User Setting
142-
</h1>
143-
</template>
144-
145-
<UFormGroup label="Liker ID Email">
146-
<UInput
147-
:value="bookUser?.notificationEmail"
148-
label="Liker ID Email"
149-
disabled
150-
:ui="{ base: 'font-mono' }"
151-
/>
152-
</UFormGroup>
153-
<UFormGroup label="Is Liker ID Email verified">
154-
<UCheckbox
155-
:value="bookUser?.isEmailVerified"
156-
:checked="bookUser?.notificationEmail"
157-
label="Is Liker ID Email verified"
158-
disabled
159-
:ui="{ base: 'font-mono' }"
160-
/>
161-
</UFormGroup>
162-
<UFormGroup label="Email Notification Settings">
163-
<UAlert
164-
v-if="!(bookUser?.notificationEmail && bookUser?.isEmailVerified)"
165-
icon="i-heroicons-exclamation-circle"
166-
color="orange"
167-
variant="soft"
168-
title="Please setup email in Liker ID."
169-
description="To enable email notifications, setup and verify your Liker ID email"
170-
/>
132+
<template v-if="connectStatus?.isReady">
133+
<UCard
134+
:ui="{
135+
header: { base: 'flex justify-between items-center' },
136+
body: { padding: '' },
137+
footer: { base: 'text-center' },
138+
}"
139+
>
140+
<template #header>
141+
<h1 class="text-center font-bold font-mono">
142+
User Setting
143+
</h1>
144+
</template>
171145

172-
<UCheckbox
173-
v-model="isEnableNotificationEmails"
174-
name="isEnalbeNotificationEmails"
175-
label="Enable email notifications about commissions"
176-
:disabled="!(bookUser?.notificationEmail && bookUser?.isEmailVerified)"
177-
/>
178-
</UFormGroup>
179-
<template #footer>
180-
<UButton
181-
label="Update"
182-
color="gray"
183-
@click="updateUserProfile"
184-
/>
185-
</template>
186-
</UCard>
187-
<UCard
188-
:ui="{
189-
header: { base: 'flex justify-between items-center' },
190-
body: { padding: '' },
191-
footer: { base: 'text-center' },
192-
}"
193-
>
194-
<template #header>
195-
<h1 class="text-center font-bold font-mono">
196-
Book Sales Commission History
197-
</h1>
146+
<UFormGroup label="Liker ID Email">
147+
<UInput
148+
:value="bookUser?.notificationEmail"
149+
label="Liker ID Email"
150+
disabled
151+
:ui="{ base: 'font-mono' }"
152+
/>
153+
</UFormGroup>
154+
<UFormGroup label="Is Liker ID Email verified">
155+
<UCheckbox
156+
:value="bookUser?.isEmailVerified"
157+
:checked="bookUser?.notificationEmail"
158+
label="Is Liker ID Email verified"
159+
disabled
160+
:ui="{ base: 'font-mono' }"
161+
/>
162+
</UFormGroup>
163+
<UFormGroup label="Email Notification Settings">
164+
<UAlert
165+
v-if="!(bookUser?.notificationEmail && bookUser?.isEmailVerified)"
166+
icon="i-heroicons-exclamation-circle"
167+
color="orange"
168+
variant="soft"
169+
title="Please setup email in Liker ID."
170+
description="To enable email notifications, setup and verify your Liker ID email"
171+
/>
198172

199-
<UTooltip
200-
text="Refresh Status"
201-
:popper="{ placement: 'left' }"
202-
>
173+
<UCheckbox
174+
v-model="isEnableNotificationEmails"
175+
name="isEnalbeNotificationEmails"
176+
label="Enable email notifications about commissions"
177+
:disabled="!(bookUser?.notificationEmail && bookUser?.isEmailVerified)"
178+
/>
179+
</UFormGroup>
180+
<template #footer>
203181
<UButton
204-
icon="i-heroicons-arrow-path"
205-
variant="outline"
206-
:disabled="isLoading"
207-
@click="loadCommissionHistory"
182+
label="Update"
183+
color="gray"
184+
@click="updateUserProfile"
208185
/>
209-
</UTooltip>
210-
</template>
211-
212-
<UTable
213-
:columns="[
214-
{ key: 'timestamp', label: 'Timestamp' },
215-
{ key: 'type', label: 'Commission Type' },
216-
{ key: 'amount', label: 'Commission' },
217-
{ key: 'classId', label: 'Book Id' },
218-
{ key: 'collectionId', label: 'Book Collection Id' },
219-
{ key: 'currency', label: 'Currency' },
220-
{ key: 'amountTotal', label: 'Sale Amount' },
221-
]"
222-
:rows="commissionHistoryRows"
223-
:ui="{ th: { base: 'text-center' }, td: { base: 'text-center' } }"
224-
>
225-
<template #classId-data="{ row }">
226-
<a :href="`${LIKER_LAND_URL}/nft/class/${row.classId}`" target="_blank">
227-
{{ nftStore.getClassMetadataById(row.classId)?.name }}
228-
</a>
229186
</template>
230-
<template #collectionId-data="{ row }">
231-
<a :href="`${LIKER_LAND_URL}/nft/collection/${row.collectionId}`" target="_blank">
232-
{{ collectionStore.getCollectionById(row.collectionId)?.name }}
233-
</a>
187+
</UCard>
188+
<UCard
189+
:ui="{
190+
header: { base: 'flex justify-between items-center' },
191+
body: { padding: '' },
192+
footer: { base: 'text-center' },
193+
}"
194+
>
195+
<template #header>
196+
<h1 class="text-center font-bold font-mono">
197+
Book Sales Commission History
198+
</h1>
199+
200+
<UTooltip
201+
text="Refresh Status"
202+
:popper="{ placement: 'left' }"
203+
>
204+
<UButton
205+
icon="i-heroicons-arrow-path"
206+
variant="outline"
207+
:disabled="isLoading"
208+
@click="loadCommissionHistory"
209+
/>
210+
</UTooltip>
234211
</template>
235-
</UTable>
236-
</UCard>
212+
213+
<UTable
214+
:columns="[
215+
{ key: 'timestamp', label: 'Timestamp' },
216+
{ key: 'type', label: 'Commission Type' },
217+
{ key: 'amount', label: 'Commission' },
218+
{ key: 'classId', label: 'Book Id' },
219+
{ key: 'collectionId', label: 'Book Collection Id' },
220+
{ key: 'currency', label: 'Currency' },
221+
{ key: 'amountTotal', label: 'Sale Amount' },
222+
]"
223+
:rows="commissionHistoryRows"
224+
:ui="{ th: { base: 'text-center' }, td: { base: 'text-center' } }"
225+
>
226+
<template #classId-data="{ row }">
227+
<a :href="`${LIKER_LAND_URL}/nft/class/${row.classId}`" target="_blank">
228+
{{ nftStore.getClassMetadataById(row.classId)?.name }}
229+
</a>
230+
</template>
231+
<template #collectionId-data="{ row }">
232+
<a :href="`${LIKER_LAND_URL}/nft/collection/${row.collectionId}`" target="_blank">
233+
{{ collectionStore.getCollectionById(row.collectionId)?.name }}
234+
</a>
235+
</template>
236+
</UTable>
237+
</UCard>
238+
</template>
237239
</template>
238240
</main>
239241
</template>

0 commit comments

Comments
 (0)