Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

feat: mobile nav bar updates #514

Merged
merged 1 commit into from
Oct 28, 2024
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
28 changes: 22 additions & 6 deletions components/AppNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const handleNavigateMyUpDashboard = () => {
is-sticky
is-transparent
has-menu
mobile-breakpoint="lg"
mobile-breakpoint="md"
@on-brand-click="handleNavigateLanding"
>
<!-- Desktop Menu -->
Expand Down Expand Up @@ -91,15 +91,13 @@ const handleNavigateMyUpDashboard = () => {
<!-- Connect -->
<lukso-button
v-else
variant="secondary"
variant="landing"
custom-class="text-12 nav-apax-12-medium-uppercase"
@click="handleConnect"
:is-loading="isConnecting ? true : undefined"
:loading-text="$formatMessage('header_connect')"
>
<span class="text-purple-41">
{{ $formatMessage('header_connect') }}
</span>
{{ $formatMessage('header_connect') }}
</lukso-button>

<!-- Settings -->
Expand Down Expand Up @@ -224,12 +222,30 @@ const handleNavigateMyUpDashboard = () => {
</div>

<!-- Mobile Icons -->
<div slot="mobile-icons" class="flex">
<div slot="mobile-icons" class="flex items-center">
<lukso-icon
name="search"
class="cursor-pointer"
@click="handleMobileSearch"
></lukso-icon>
<lukso-button
v-if="!isConnected"
variant="landing"
size="small"
custom-class="text-12 nav-apax-12-medium-uppercase"
@click="handleConnect"
:is-loading="isConnecting ? true : undefined"
:loading-text="$formatMessage('header_connect')"
class="ml-4 mr-1"
>
{{ $formatMessage('header_connect') }}
</lukso-button>
<AppNavbarAvatar
v-if="isConnected"
size="x-small"
class="ml-4 mr-1 cursor-pointer"
@click="handleNavigateProfile"
/>
</div>
<div slot="desktop-center" class="w-full">
<AppNavbarProfileSearch />
Expand Down
23 changes: 23 additions & 0 deletions components/AppNavbarAvatar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script setup lang="ts">
import type { ProfileSize } from '@lukso/web-components'

type Props = {
size: ProfileSize
}

withDefaults(defineProps<Props>(), {
size: 'small',
})
const connectedProfile = useProfile().connectedProfile()
const avatarImage = useProfileAvatar(connectedProfile, 40)
</script>

<template>
<lukso-profile
:size="size"
:profile-url="avatarImage?.url"
:profile-address="connectedProfile?.address"
:data-profile-address="connectedProfile?.address"
has-identicon
></lukso-profile>
</template>
25 changes: 23 additions & 2 deletions components/AppNavbarLanding.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
const { isTestnet, isConnected, connectedProfileAddress } =
const { isTestnet, isConnected, connectedProfileAddress, isConnecting } =
storeToRefs(useAppStore())
const { disconnect } = useBaseProvider()
const { showModal } = useModal()
Expand Down Expand Up @@ -34,7 +34,6 @@ const handleNavigateMyUpDashboard = () => {
logo-url="/images/logo-ue.svg"
is-transparent
has-menu
mobile-breakpoint="lg"
>
<!-- Desktop Menu -->
<div
Expand Down Expand Up @@ -278,5 +277,27 @@ const handleNavigateMyUpDashboard = () => {
</lukso-button>
</div>
</div>

<!-- Mobile Icons -->
<div slot="mobile-icons" class="flex items-center">
<lukso-button
v-if="!isConnected"
variant="landing"
size="small"
custom-class="text-12 nav-apax-12-medium-uppercase"
@click="handleConnect"
:is-loading="isConnecting ? true : undefined"
:loading-text="$formatMessage('header_connect')"
class="ml-4 mr-1"
>
{{ $formatMessage('header_connect') }}
</lukso-button>
<AppNavbarAvatar
v-if="isConnected"
size="x-small"
class="ml-4 mr-1 cursor-pointer"
@click="handleNavigateProfile"
/>
</div>
</lukso-navbar>
</template>
11 changes: 1 addition & 10 deletions components/AppNavbarProfileDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const handleToggleDropdown = () => {
isDropdownOpen.value = !isDropdownOpen.value
}

const avatarImage = useProfileAvatar(connectedProfile, 40)

const handleDisconnect = async () => {
disconnect()
}
Expand Down Expand Up @@ -48,14 +46,7 @@ onUnmounted(() => {

<template>
<div class="relative cursor-pointer pl-4">
<lukso-profile
size="small"
:profile-url="avatarImage?.url"
@click="handleToggleDropdown"
:profile-address="connectedProfile?.address"
:data-profile-address="connectedProfile?.address"
has-identicon
></lukso-profile>
<AppNavbarAvatar @click="handleToggleDropdown" />
<div
class="absolute right-0 z-[1000] mt-4 animate-fade-in select-none rounded-12 bg-neutral-100 shadow-pink-drop-shadow animation-duration-150 before:absolute before:right-0 before:top-0 before:-mt-1 before:mr-4 before:size-3 before:rotate-45 before:bg-neutral-100"
:class="isDropdownOpen ? 'block' : 'hidden'"
Expand Down
Loading