Skip to content

Commit

Permalink
finalize temporary artist directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-toth committed Sep 20, 2024
1 parent e58532f commit 4e882d9
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
36 changes: 27 additions & 9 deletions components/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
<template>
<v-avatar color="transparent" :size="size">
<v-img v-if="avatar" :src="avatar.src" aspect-ratio="1" :width="size" />
<v-img
v-else
src="\logo\art-by-city\art-by-city-x.png"
contained
aspect-ratio="1"
:width="size"
/>
<v-img :src="avatar ? avatar.src : ''" aspect-ratio="1" :width="size">
<template v-slot:error>
<v-img
src="\logo\art-by-city\art-by-city-x.png"
contained
aspect-ratio="1"
:width="size"
/>
</template>
<template v-slot:placeholder>
<v-img
src="\logo\art-by-city\art-by-city-x.png"
contained
aspect-ratio="1"
:width="size"
/>
</template>
</v-img>

</v-avatar>
</template>

Expand All @@ -23,7 +34,14 @@ const {
data: avatar,
refresh
} = useLazyAsyncData(`avatar-${props.address}`, async () => {
return await abc.legacy.fetchAvatar(props.address)
const avatar = await abc.legacy.fetchAvatar(props.address)
// CORS error with data url i guess
if (avatar && !avatar.src.startsWith('data')) {
return avatar
}
return null
})
watch(() => props.address, async () => { await refresh() })
Expand Down
9 changes: 6 additions & 3 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { replaceCodePlugin } from './plugins/vite-plugin-replace'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: false },

ssr: false,

app: {
Expand Down Expand Up @@ -42,9 +41,11 @@ export default defineNuxtConfig({
'vuetify/lib/styles/main.sass',
'@mdi/font/css/materialdesignicons.min.css'
],

build: {
transpile: ['vuetify'],
},

vite: {
define: {
'process.env.DEBUG': false,
Expand Down Expand Up @@ -105,5 +106,7 @@ exports.randomFillSync = randomFillSync`,
compilerOptions: {
isCustomElement: (tag: string) => tag === 'model-viewer'
}
}
})
},

compatibilityDate: '2024-09-20'
})
14 changes: 7 additions & 7 deletions pages/directory/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
<v-container id="discover-page">
<v-row>
<v-col>
<span class="text-h4">Directory</span>
<span class="text-h4">Verified Artist Directory</span>
</v-col>
</v-row>
<v-row
justify="center"
>
<v-col>
<v-list lines="one">
<v-col v-for="user in users" :key="user" cols="4">
<!-- <v-list lines="one">
<v-list-item
v-for="user in users"
:key="user"
>
<Avatar :address="user" small class="mr-2" />
> -->
<Avatar :address="user" class="mr-2" />
<ResolveUsername :address="user" />
</v-list-item>
</v-list>
<!-- </v-list-item>
</v-list> -->
</v-col>
</v-row>
</v-container>
Expand Down

0 comments on commit 4e882d9

Please sign in to comment.