2019-01-31 12:38:48 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2019-04-11 02:27:55 +01:00
|
|
|
<template src="./registrationSuccessPopup.html"></template>
|
2019-01-31 12:38:48 +00:00
|
|
|
|
|
|
|
<script lang="ts">
|
2019-07-08 14:45:25 +01:00
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import Button from '@/components/common/Button.vue';
|
|
|
|
import { APP_STATE_ACTIONS } from '@/utils/constants/actionNames';
|
|
|
|
import ROUTES from '@/utils/constants/routerConstants';
|
|
|
|
import { resendEmailRequest } from '../../api/users';
|
|
|
|
import { getUserID } from '@/utils/consoleLocalStorage';
|
2019-05-15 09:28:36 +01:00
|
|
|
|
2019-01-31 12:38:48 +00:00
|
|
|
|
2019-07-08 14:45:25 +01:00
|
|
|
@Component({
|
2019-05-15 09:28:36 +01:00
|
|
|
beforeDestroy: function() {
|
|
|
|
if (this.$data.intervalID) {
|
|
|
|
clearInterval(this.$data.intervalID);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
isResendEmailButtonDisabled: true,
|
|
|
|
timeToEnableResendEmailButton: '00:30',
|
|
|
|
intervalID: null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isPopupShown: function () {
|
|
|
|
return this.$store.state.appStateModule.appState.isSuccessfulRegistrationPopupShown;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2019-07-08 14:45:25 +01:00
|
|
|
onResendEmailButtonClick: async function (): void {
|
2019-05-15 09:28:36 +01:00
|
|
|
this.$data.isResendEmailButtonDisabled = true;
|
|
|
|
|
|
|
|
let userID = getUserID();
|
|
|
|
if (!userID) {
|
|
|
|
return;
|
2019-02-20 13:33:56 +00:00
|
|
|
}
|
2019-05-15 09:28:36 +01:00
|
|
|
|
|
|
|
let response = await resendEmailRequest(userID);
|
|
|
|
if (response.isSuccess) {
|
|
|
|
(this as any).startResendEmailCountdown();
|
2019-02-20 13:33:56 +00:00
|
|
|
}
|
2019-02-07 07:12:20 +00:00
|
|
|
},
|
2019-07-08 14:45:25 +01:00
|
|
|
onCloseClick: function (): void {
|
2019-05-15 09:28:36 +01:00
|
|
|
this.$store.dispatch(APP_STATE_ACTIONS.CLOSE_POPUPS);
|
|
|
|
this.$router.push(ROUTES.LOGIN.path);
|
2019-02-07 07:12:20 +00:00
|
|
|
},
|
2019-05-15 09:28:36 +01:00
|
|
|
startResendEmailCountdown: function () {
|
|
|
|
let countdown = 30;
|
|
|
|
let self = this;
|
2019-07-08 14:45:25 +01:00
|
|
|
|
2019-05-15 09:28:36 +01:00
|
|
|
this.$data.intervalID = setInterval(function () {
|
|
|
|
countdown--;
|
|
|
|
|
|
|
|
let secondsLeft = countdown > 9 ? countdown : `0${countdown}`;
|
|
|
|
self.$data.timeToEnableResendEmailButton = `00:${secondsLeft}`;
|
2019-01-31 12:38:48 +00:00
|
|
|
|
2019-05-15 09:28:36 +01:00
|
|
|
if (countdown <= 0) {
|
|
|
|
clearInterval(self.$data.intervalID);
|
|
|
|
self.$data.isResendEmailButtonDisabled = false;
|
|
|
|
}
|
|
|
|
}.bind(this), 1000);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
2019-07-08 14:45:25 +01:00
|
|
|
Button,
|
2019-05-15 09:28:36 +01:00
|
|
|
},
|
2019-07-08 14:45:25 +01:00
|
|
|
})
|
2019-05-15 09:28:36 +01:00
|
|
|
|
2019-07-08 14:45:25 +01:00
|
|
|
export default class RegistrationSuccessPopup extends Vue {}
|
2019-01-31 12:38:48 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
p {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_medium';
|
2019-01-31 12:38:48 +00:00
|
|
|
font-size: 16px;
|
|
|
|
line-height: 21px;
|
|
|
|
color: #354049;
|
2019-02-07 14:13:12 +00:00
|
|
|
padding: 27px 0 0 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
2019-05-15 09:28:36 +01:00
|
|
|
h3 {
|
|
|
|
font-family: 'font_medium';
|
|
|
|
font-size: 12px;
|
|
|
|
line-height: 16px;
|
|
|
|
color: #354049;
|
|
|
|
padding: 27px 0 0 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
b {
|
|
|
|
color: #2683FF;
|
|
|
|
}
|
|
|
|
|
2019-02-07 14:13:12 +00:00
|
|
|
a {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_bold';
|
2019-02-07 14:13:12 +00:00
|
|
|
color: #2683ff;
|
2019-01-31 12:38:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.register-success-popup-container {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
background-color: rgba(134, 134, 148, 0.4);
|
|
|
|
z-index: 1000;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2019-05-15 09:28:36 +01:00
|
|
|
|
2019-01-31 12:38:48 +00:00
|
|
|
.register-success-popup {
|
|
|
|
width: 100%;
|
|
|
|
max-width: 845px;
|
|
|
|
background-color: #FFFFFF;
|
|
|
|
border-radius: 6px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: flex-start;
|
|
|
|
position: relative;
|
|
|
|
justify-content: center;
|
|
|
|
padding: 80px 100px 80px 50px;
|
|
|
|
|
|
|
|
&__info-panel-container {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: center;
|
|
|
|
margin-right: 100px;
|
|
|
|
margin-top: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__form-container {
|
|
|
|
width: 100%;
|
|
|
|
max-width: 440px;
|
|
|
|
margin-top: 10px;
|
|
|
|
|
|
|
|
&__main-label-text {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_bold';
|
2019-01-31 12:38:48 +00:00
|
|
|
font-size: 32px;
|
|
|
|
line-height: 39px;
|
|
|
|
color: #384B65;
|
2019-02-07 14:13:12 +00:00
|
|
|
margin: 0;
|
2019-01-31 12:38:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__button-container {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
2019-02-07 14:13:12 +00:00
|
|
|
margin-top: 15px;
|
2019-01-31 12:38:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__close-cross-container {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
position: absolute;
|
|
|
|
right: 30px;
|
|
|
|
top: 40px;
|
|
|
|
height: 24px;
|
|
|
|
width: 24px;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover svg path {
|
|
|
|
fill: #2683FF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: 720px) {
|
|
|
|
.register-success-popup {
|
|
|
|
|
|
|
|
&__info-panel-container {
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
&__form-container {
|
|
|
|
|
|
|
|
&__button-container {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|