-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from art-by-city/90-resolve-usernames-across-…
…dapp Adds username resolution across the dapp
- Loading branch information
Showing
6 changed files
with
77 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<nuxt-link | ||
v-if="!noLink" | ||
class="text-primary" | ||
:to="`/${user?.username || props.address}`" | ||
> | ||
<span v-if="user?.profile?.displayName || user?.username"> | ||
{{ user?.profile?.displayName || user?.username }} | ||
</span> | ||
<code v-else> | ||
{{ props.address }} | ||
</code> | ||
</nuxt-link> | ||
<template v-else> | ||
<span v-if="user?.profile?.displayName || user?.username"> | ||
{{ user?.profile?.displayName || user?.username }} | ||
</span> | ||
<code v-else> | ||
{{ props.address }} | ||
</code> | ||
</template> | ||
</template> | ||
<script setup lang="ts"> | ||
const props = defineProps<{ address: string, noLink?: boolean}>() | ||
const abc = useArtByCity() | ||
const { data: user } = useLazyAsyncData(props.address, async () => { | ||
const profile = await abc.legacy.fetchProfile(props.address) | ||
const username = | ||
await abc.usernames.resolveUsernameFromAddress(props.address) | ||
return { profile, username } | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters