2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 07:31:52 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2023-01-06 01:41:14 +01:00
|
|
|
<MkModalWindow
|
2022-07-20 15:24:26 +02:00
|
|
|
ref="dialog"
|
2023-04-19 14:24:31 +02:00
|
|
|
:width="500"
|
|
|
|
:height="600"
|
2024-01-30 11:53:53 +01:00
|
|
|
@close="dialog?.close()"
|
2020-10-17 13:12:00 +02:00
|
|
|
@closed="$emit('closed')"
|
|
|
|
>
|
2022-07-20 15:24:26 +02:00
|
|
|
<template #header>{{ i18n.ts.signup }}</template>
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2023-04-19 14:24:31 +02:00
|
|
|
<div style="overflow-x: clip;">
|
|
|
|
<Transition
|
|
|
|
mode="out-in"
|
2023-05-19 06:58:09 +02:00
|
|
|
:enterActiveClass="$style.transition_x_enterActive"
|
|
|
|
:leaveActiveClass="$style.transition_x_leaveActive"
|
|
|
|
:enterFromClass="$style.transition_x_enterFrom"
|
|
|
|
:leaveToClass="$style.transition_x_leaveTo"
|
2023-04-19 14:24:31 +02:00
|
|
|
>
|
|
|
|
<template v-if="!isAcceptedServerRule">
|
2024-01-30 11:53:53 +01:00
|
|
|
<XServerRules @done="isAcceptedServerRule = true" @cancel="dialog?.close()"/>
|
2023-04-19 14:24:31 +02:00
|
|
|
</template>
|
|
|
|
<template v-else>
|
2023-10-18 02:41:36 +02:00
|
|
|
<XSignup :autoSet="autoSet" @signup="onSignup" @signupEmailPending="onSignupEmailPending" @approvalPending="onApprovalPending"/>
|
2023-04-19 14:24:31 +02:00
|
|
|
</template>
|
|
|
|
</Transition>
|
|
|
|
</div>
|
2023-01-06 01:41:14 +01:00
|
|
|
</MkModalWindow>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 06:42:09 +01:00
|
|
|
import { shallowRef, ref } from 'vue';
|
2024-01-30 11:53:53 +01:00
|
|
|
import * as Misskey from 'misskey-js';
|
2023-04-19 14:24:31 +02:00
|
|
|
import XSignup from '@/components/MkSignupDialog.form.vue';
|
|
|
|
import XServerRules from '@/components/MkSignupDialog.rules.vue';
|
2023-01-06 01:41:14 +01:00
|
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { i18n } from '@/i18n.js';
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
autoSet?: boolean;
|
|
|
|
}>(), {
|
|
|
|
autoSet: false,
|
|
|
|
});
|
2020-02-14 17:33:09 +01:00
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
const emit = defineEmits<{
|
2024-01-30 11:53:53 +01:00
|
|
|
(ev: 'done', res: Misskey.entities.SigninResponse): void;
|
2022-05-26 15:53:09 +02:00
|
|
|
(ev: 'closed'): void;
|
2022-01-15 22:59:35 +01:00
|
|
|
}>();
|
2020-02-14 17:33:09 +01:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const isAcceptedServerRule = ref(false);
|
2023-04-19 14:24:31 +02:00
|
|
|
|
2024-01-30 11:53:53 +01:00
|
|
|
function onSignup(res: Misskey.entities.SigninResponse) {
|
2022-01-15 22:59:35 +01:00
|
|
|
emit('done', res);
|
2024-01-30 11:53:53 +01:00
|
|
|
dialog.value?.close();
|
2022-01-15 22:59:35 +01:00
|
|
|
}
|
2021-10-08 06:37:02 +02:00
|
|
|
|
2022-01-15 22:59:35 +01:00
|
|
|
function onSignupEmailPending() {
|
2024-01-30 11:53:53 +01:00
|
|
|
dialog.value?.close();
|
2022-01-15 22:59:35 +01:00
|
|
|
}
|
2023-10-31 19:57:52 +01:00
|
|
|
|
2023-10-18 02:41:36 +02:00
|
|
|
function onApprovalPending() {
|
2023-12-23 04:26:23 +01:00
|
|
|
dialog.value.close();
|
2023-10-18 02:41:36 +02:00
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
</script>
|
2023-04-19 14:24:31 +02:00
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.transition_x_enterActive,
|
|
|
|
.transition_x_leaveActive {
|
|
|
|
transition: opacity 0.3s cubic-bezier(0,0,.35,1), transform 0.3s cubic-bezier(0,0,.35,1);
|
|
|
|
}
|
|
|
|
.transition_x_enterFrom {
|
|
|
|
opacity: 0;
|
|
|
|
transform: translateX(50px);
|
|
|
|
}
|
|
|
|
.transition_x_leaveTo {
|
|
|
|
opacity: 0;
|
|
|
|
transform: translateX(-50px);
|
|
|
|
}
|
|
|
|
</style>
|