Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
web/satellite/vuetify-poc: add STORJ token from billing
This change allows to add STORJ tokens from the billing page. It reuses the token step of the account upgrade dialog. Issue: #6494 Change-Id: Ic521b8ab5113124634b8489f0fb92ab680d9f3df
- Loading branch information
1 parent
ad2d897
commit 6925f87
Showing
6 changed files
with
171 additions
and
18 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
88 changes: 88 additions & 0 deletions
88
web/satellite/vuetify-poc/src/components/dialogs/AddTokensDialog.vue
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,88 @@ | ||
// Copyright (C) 2023 Storj Labs, Inc. | ||
// See LICENSE for copying information. | ||
|
||
<template> | ||
<v-dialog | ||
v-model="model" | ||
scrollable | ||
width="720px" | ||
transition="fade-transition" | ||
:persistent="loading" | ||
> | ||
<v-card ref="content" rounded="xlg"> | ||
<v-card-item class="pa-5 pl-7"> | ||
<v-card-title class="font-weight-bold"> Add Tokens </v-card-title> | ||
<template #append> | ||
<v-btn | ||
icon="$close" | ||
variant="text" | ||
size="small" | ||
color="default" | ||
@click="model = false" | ||
/> | ||
</template> | ||
</v-card-item> | ||
|
||
<v-divider /> | ||
|
||
<v-card-item class="py-4"> | ||
<v-window v-model="step"> | ||
<v-window-item :value="AddTokensDialogStep.AddTokens"> | ||
<AddTokensStep | ||
is-root | ||
@success="() => setStep(AddTokensDialogStep.Success)" | ||
/> | ||
</v-window-item> | ||
|
||
<v-window-item :value="AddTokensDialogStep.Success"> | ||
<SuccessStep @continue="model = false" /> | ||
</v-window-item> | ||
</v-window> | ||
</v-card-item> | ||
</v-card> | ||
</v-dialog> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed, ref, watch } from 'vue'; | ||
import { VBtn, VCard, VCardItem, VCardTitle, VDialog, VDivider, VWindow, VWindowItem } from 'vuetify/components'; | ||
import AddTokensStep from '@poc/components/dialogs/upgradeAccountFlow/AddTokensStep.vue'; | ||
import SuccessStep from '@poc/components/dialogs/upgradeAccountFlow/SuccessStep.vue'; | ||
enum AddTokensDialogStep { | ||
AddTokens, | ||
Success, | ||
} | ||
const step = ref(AddTokensDialogStep.AddTokens); | ||
const loading = ref<boolean>(false); | ||
const content = ref<HTMLElement | null>(null); | ||
const props = defineProps<{ | ||
modelValue: boolean, | ||
}>(); | ||
const emit = defineEmits<{ | ||
'update:modelValue': [value: boolean]; | ||
}>(); | ||
const model = computed<boolean>({ | ||
get: () => props.modelValue, | ||
set: value => emit('update:modelValue', value), | ||
}); | ||
/** | ||
* Sets specific flow step. | ||
*/ | ||
function setStep(s: AddTokensDialogStep) { | ||
step.value = s; | ||
} | ||
watch(content, (value) => { | ||
if (!value) { | ||
setStep(AddTokensDialogStep.AddTokens); | ||
return; | ||
} | ||
}); | ||
</script> |
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