Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/KYC levels and Link color change #115

Merged
merged 3 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "host-console",
"version": "1.0.0-alpha.6",
"version": "1.0.0-alpha.7",
"private": true,
"homepage": "https://holo-host.github.io/host-console-ui/",
"scripts": {
Expand Down
10 changes: 7 additions & 3 deletions src/components/MobileTopNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
import { ref } from 'vue'
import MenuIcon from '@/components/icons/MenuIcon.vue'
import TheSidebar from '@/components/sidebar/TheSidebar.vue'
import TopNav from '@/components/TopNav.vue'
import TopNavMenu from '@/components/TopNavMenu.vue'
import { EUserKycLevel } from '@/types/types'

withDefaults(
const props = withDefaults(
defineProps<{
kycLevel: EUserKycLevel
nickname: string
agentAddress?: typeof Uint8Array | null
}>(),
Expand All @@ -22,9 +25,10 @@ const isMobileSidebarVisible = ref(false)
<MenuIcon @click="isMobileSidebarVisible = !isMobileSidebarVisible" />

<TopNavMenu
:nickname="nickname"
:kyc-level="props.kycLevel"
:nickname="props.nickname"
:white="true"
:agent-address="agentAddress"
:agent-address="props.agentAddress"
/>

<TheSidebar v-if="isMobileSidebarVisible" />
Expand Down
2 changes: 2 additions & 0 deletions src/components/PrimaryLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ onMounted(async () => {
class="main-column"
>
<MobileTopNav
:kyc-level="userStore.kycLevel"
:nickname="nickname"
:agent-address="agentAddress"
/>

<TopNav
:kyc-level="userStore.kycLevel"
:breadcrumbs="breadcrumbsOrTitle"
:nickname="nickname"
:agent-address="agentAddress"
Expand Down
7 changes: 5 additions & 2 deletions src/components/TopNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { computed } from 'vue'
import RightChevronIcon from '@/components/icons/RightChevronIcon.vue'
import TopNavMenu from '@/components/TopNavMenu.vue'
import type { BreadCrumb } from '@/types/types'
import { EUserKycLevel } from '@/types/types'

const props = withDefaults(
defineProps<{
kycLevel: EUserKycLevel
breadcrumbs: BreadCrumb[]
agentAddress?: typeof Uint8Array | null
nickname: string
Expand Down Expand Up @@ -61,8 +63,9 @@ const isSubtitleVisible = computed(
</div>

<TopNavMenu
:nickname="nickname"
:agent-address="agentAddress"
:kyc-level="props.kycLevel"
:nickname="props.nickname"
:agent-address="props.agentAddress"
data-test-top-nav-menu
/>

Expand Down
14 changes: 10 additions & 4 deletions src/components/TopNavMenu.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<script setup lang="ts">
import Identicon from '@uicommon/components/Identicon.vue'
import { ref } from 'vue'
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import DownTriangleIcon from '@/components/icons/DownTriangleIcon.vue'
import { useGoToHoloFuel } from '@/composables/useGoToHoloFuel'
import { kAuthTokenLSKey } from '@/constants.ts'
import { kRoutes } from '@/router'
import { EUserKycLevel } from '@/types/types'

const { goToHoloFuel } = useGoToHoloFuel()

const router = useRouter()
const { t } = useI18n()

const props = withDefaults(
defineProps<{
kycLevel: EUserKycLevel
nickname: string
agentAddress?: typeof Uint8Array | null
white?: boolean
Expand All @@ -25,6 +29,8 @@ const props = withDefaults(

const isMenuOpen = ref(false)

const currentLevel = computed((): number => (props.kycLevel === EUserKycLevel.one ? 1 : 2))

function toggleMenu(): void {
isMenuOpen.value = !isMenuOpen.value
}
Expand Down Expand Up @@ -63,7 +69,7 @@ async function openSettingsAndCloseMenu(): Promise<void> {
<div class="display-name">
{{ nickname }}
<span class="verification-status">
{{ $t('settings.verification.verified') }}
{{ t('settings.verification.current_level', { level: currentLevel }) }}
</span>
</div>
<DownTriangleIcon
Expand Down Expand Up @@ -134,8 +140,8 @@ async function openSettingsAndCloseMenu(): Promise<void> {
.display-name {
display: flex;
flex-direction: column;
align-items: flex-end;
text-align: right;
align-items: flex-start;
text-align: left;
margin-left: 12px;
}

Expand Down
1 change: 1 addition & 0 deletions src/components/dashboard/HoloFuelCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const items = computed((): DashboardCardItem[] => [
.springboard-link {
font-weight: bold;
cursor: pointer;
color: #b0ecf0;
text-decoration: underline;
text-underline-offset: 4px;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/earnings/RedeemableHoloFuelCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const canRedeem = computed((): boolean => !isKycLevelOne.value && Number(props.r
.springboard-link {
font-weight: bold;
cursor: pointer;
color: #b0ecf0;
text-decoration: underline;
text-underline-offset: 4px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/SettingsHolofuelSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const props = withDefaults(
defineProps<{
nickname: string
agentAddress?: Uint8Array | null
kycLevel: number
kycLevel: EUserKycLevel
}>(),
{
agentAddress: null
Expand Down
5 changes: 2 additions & 3 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default {
ssh_access: 'Access for HoloPort support (SSH)',
header: 'Account Settings',
verification: {
current_level: 'Verified to Level {level}',
current_level: 'Level {level} Verified',
description:
'Level 2 verification is required for transactions larger than ~10,000 GBP and other special uses of HoloFuel.',
holo_kyc_1: 'Level 1',
Expand All @@ -182,8 +182,7 @@ export default {
link: 'Complete level {level} verification',
next_level_descriptions: {
two: 'As a level 1 user, you are limited to <500 GBP of transactions per month. update your KYC to make more transactions.'
},
verified: 'Verified'
}
}
},
sidebar: {
Expand Down