Skip to content

Commit

Permalink
feat: move username detail (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi authored and kelsos committed Nov 19, 2024
1 parent a2c52b3 commit b555759
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
46 changes: 43 additions & 3 deletions components/account/home/AccountDetails.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { get } from '@vueuse/core';
import { useMainStore } from '~/store';
const store = useMainStore();
const { account } = storeToRefs(store);
const {
public: {
contact: { emailMailto, email: rotkiEmail },
},
} = useRuntimeConfig();
const email = computed(() => {
const userAccount = account.value;
const userAccount = get(account);
return !userAccount ? '' : userAccount.email;
});
const username = computed(() => {
const userAccount = get(account);
return !userAccount ? '' : userAccount.username;
});
const { t } = useI18n();
</script>

Expand All @@ -22,13 +34,41 @@ const { t } = useI18n();
<div class="space-y-5">
<RuiTextField
id="email"
v-model="email"
v-model="username"
disabled
class="[&_input]:!text-rui-text"
variant="outlined"
:label="t('auth.common.email')"
:label="t('auth.common.username')"
hide-details
color="primary"
append-icon="lock-line"
/>
<div>
<RuiTextField
id="email"
v-model="email"
disabled
class="[&_input]:!text-rui-text"
variant="outlined"
:label="t('auth.common.email')"
hide-details
color="primary"
append-icon="lock-line"
/>
<div class="text-rui-text-secondary pt-2 px-3 text-xs flex">
To change your email, please contact our support tem via
<ButtonLink
:to="emailMailto"
external
color="primary"
variant="text"
class="leading-[0]"
inline
>
{{ rotkiEmail }}
</ButtonLink>
</div>
</div>
</div>

<div class="mt-10 mb-5 border-t border-grey-50" />
Expand Down
12 changes: 10 additions & 2 deletions layouts/account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ const { t } = useI18n();
const store = useMainStore();
const { account } = storeToRefs(store);
const username = computed(() => get(account)?.username);
const name = computed(() => {
const accountVal = get(account);
if (!accountVal)
return '';
const { firstName, lastName } = accountVal.address;
return `${firstName} ${lastName}`;
});
useHead({
title: 'account',
Expand All @@ -34,7 +42,7 @@ const tabModelValue = ref();
<div class="py-10 lg:py-16">
<div class="container">
<div class="text-h4 mb-6">
{{ t('account.welcome') }} {{ username }}
{{ t('account.welcome') }} {{ name }}
</div>
<div class="flex flex-col lg:flex-row gap-6">
<div class="hidden lg:block w-[270px] shrink-0">
Expand Down
2 changes: 2 additions & 0 deletions modules/ui-library/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
RiHandCoinLine,
RiInformationLine,
RiLightbulbLine,
RiLockLine,
RiLogoutBoxRLine,
RiMailSendLine,
RiMapPinLine,
Expand Down Expand Up @@ -96,6 +97,7 @@ export default defineNuxtPlugin((nuxtApp) => {
RiCoinLine,
RiPaypalLine,
RiSearchLine,
RiLockLine,
],
mode: 'light',
},
Expand Down

0 comments on commit b555759

Please sign in to comment.