diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-08-31 00:24:33 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-08-31 00:24:33 +0900 |
| commit | 786b150ea75111b5f6102c256d5cfa42cb83d1fb (patch) | |
| tree | d552d0c371829d7ff027890d1036a80bb08517f7 /packages/client/src/components/MkWaitingDialog.vue | |
| parent | update deps (diff) | |
| download | misskey-786b150ea75111b5f6102c256d5cfa42cb83d1fb.tar.gz misskey-786b150ea75111b5f6102c256d5cfa42cb83d1fb.tar.bz2 misskey-786b150ea75111b5f6102c256d5cfa42cb83d1fb.zip | |
refactor(client): align filename to component name
Diffstat (limited to 'packages/client/src/components/MkWaitingDialog.vue')
| -rw-r--r-- | packages/client/src/components/MkWaitingDialog.vue | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/packages/client/src/components/MkWaitingDialog.vue b/packages/client/src/components/MkWaitingDialog.vue new file mode 100644 index 0000000000..9e631b55b1 --- /dev/null +++ b/packages/client/src/components/MkWaitingDialog.vue @@ -0,0 +1,73 @@ +<template> +<MkModal ref="modal" :prefer-type="'dialog'" :z-priority="'high'" @click="success ? done() : () => {}" @closed="emit('closed')"> + <div class="iuyakobc" :class="{ iconOnly: (text == null) || success }"> + <i v-if="success" class="fas fa-check icon success"></i> + <i v-else class="fas fa-spinner fa-pulse icon waiting"></i> + <div v-if="text && !success" class="text">{{ text }}<MkEllipsis/></div> + </div> +</MkModal> +</template> + +<script lang="ts" setup> +import { watch, ref } from 'vue'; +import MkModal from '@/components/ui/modal.vue'; + +const modal = ref<InstanceType<typeof MkModal>>(); + +const props = defineProps<{ + success: boolean; + showing: boolean; + text?: string; +}>(); + +const emit = defineEmits<{ + (ev: 'done'); + (ev: 'closed'); +}>(); + +function done() { + emit('done'); + modal.value.close(); +} + +watch(() => props.showing, () => { + if (!props.showing) done(); +}); +</script> + +<style lang="scss" scoped> +.iuyakobc { + position: relative; + padding: 32px; + box-sizing: border-box; + text-align: center; + background: var(--panel); + border-radius: var(--radius); + width: 250px; + + &.iconOnly { + padding: 0; + width: 96px; + height: 96px; + display: flex; + align-items: center; + justify-content: center; + } + + > .icon { + font-size: 32px; + + &.success { + color: var(--accent); + } + + &.waiting { + opacity: 0.7; + } + } + + > .text { + margin-top: 16px; + } +} +</style> |