Skip to content

Commit

Permalink
fix: signup notification looks terrible 🙈 (#122)
Browse files Browse the repository at this point in the history
Fixes #110
  • Loading branch information
akdasa authored Feb 3, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 648ebb6 commit 612d351
Showing 2 changed files with 21 additions and 19 deletions.
22 changes: 20 additions & 2 deletions src/app/settings/components/account/AccountPage.vue
Original file line number Diff line number Diff line change
@@ -10,6 +10,13 @@
</ion-header>

<ion-content class="ion-padding">
<div
v-if="showVerifyEmail"
class="ion-padding alert"
>
{{ $t('account.confirmEmail') }}
</div>

<h1 v-if="isAuthenticated">
{{ $t('account.welcomeBack') }}
</h1>
@@ -98,7 +105,7 @@ import {
IonIcon, modalController
} from '@ionic/vue'
import { mail } from 'ionicons/icons'
import { ref } from 'vue'
import { computed, ref } from 'vue'
import { storeToRefs } from 'pinia'
import { useAccountStore } from '@/app/settings'
import { couchDB } from '@/app/Application'
@@ -110,9 +117,10 @@ import SignUpViaEmailPage from './email/SignUpViaEmailPage.vue'
const inProgress = ref(false)
const account = useAccountStore()
const { isAuthenticated, syncHost, token, syncTime } = storeToRefs(account)
const { isAuthenticated, syncHost, token, syncTime, email } = storeToRefs(account)
const { logOut } = account
const showVerifyEmail = computed(() => email.value && !token.value)
async function openModal(component: any) {
const modal = await modalController.create({ component })
@@ -138,3 +146,13 @@ async function onRefreshToken() {
token.value.expires = (await service.refreshToken(token.value)).expires
}
</script>


<style scoped>
.alert {
color: var(--ion-color-warning-contrast);
background-color: var(--ion-color-warning);
border: 1px solid var(--ion-color-warning-shade);
border-radius: 10px;
}
</style>
18 changes: 1 addition & 17 deletions src/app/settings/components/account/email/SignUpViaEmailPage.vue
Original file line number Diff line number Diff line change
@@ -15,13 +15,6 @@
</ion-header>

<ion-content class="ion-padding">
<div
v-if="showVerifyEmail"
class="ion-padding alert"
>
{{ $t('account.confirmEmail') }}
</div>

<ion-list>
<!-- Name -->
<ion-item class="ion-no-padding">
@@ -92,26 +85,17 @@ const account = useAccountStore()
const { name, email, password } = storeToRefs(account)
const inProgress = ref(false)
const showVerifyEmail = ref(false)
async function onSignUp() {
inProgress.value = true
await new AuthService(AUTH_HOST).signUp(
name.value, email.value, password.value,
)
modalController.dismiss(null, 'ok')
inProgress.value = false
showVerifyEmail.value = true
}
function cancel() {
return modalController.dismiss(null, 'cancel')
}
</script>

<style scoped>
.alert {
background-color: var(--ion-color-warning);
border: 1px solid var(--ion-color-warning-shade);
border-radius: 10px;
}
</style>

0 comments on commit 612d351

Please sign in to comment.