Skip to content

Commit

Permalink
Frontend fixes for ducks theme pages
Browse files Browse the repository at this point in the history
  • Loading branch information
wraitii committed Dec 5, 2023
1 parent 19297d8 commit 1fc5157
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/builder/DucksSale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ export const themeSetsDataStore = defaultDict((network: string) => {
ret.fetch(async () => {
const data_by_set_id = await backendManager.fetch(`v1/${network}/${theme}/all_sets_static_data`)
const mapping = {};
for (const [key, value] of Object.entries(data_by_set_id))
for (const [key, value] of Object.entries(data_by_set_id)) {
value['id'] = key;
mapping[value['booklet_id']] = value;
}
return mapping;
});
return ret;
Expand Down
11 changes: 5 additions & 6 deletions src/components/themes/ObjectDetailCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Fetchable } from '@/DataFetching';
import { addressToStarknetId } from '@/chain/StarknetId';
import { CHAIN_NETWORKS } from '@/chain/Network';
import { getBookletLink, getSetLink } from '@/chain/Marketplaces';
import { log } from 'console';
import { bookletDataStore } from '@/builder/BookletData';
const props = defineProps<{
Expand Down Expand Up @@ -78,26 +77,26 @@ const currentOwner = computed(() => {
<hr class="my-2">

<div class="px-4 py-2 pt-0 flex flex-col gap-2">
<p v-if="isAssembled" class="flex justify-between">
<p v-if="isAssembled && theme !== 'ducks_frens'" class="flex justify-between">
<span class="text-grad-dark">Owner</span>
<span class="font-medium">{{ currentOwner }}</span>
</p>
<p v-else class="flex justify-center">
<p v-else-if="!isAssembled" class="flex justify-center">
<span class="text-grad-dark">This set is currently disassembled!</span>
</p>
<p v-if="expand && isAssembled" class="flex justify-between flex-wrap gap-2">
<RouterLink :to="{ name: 'UserCreation', params: { network: network, set_id: tokenId } }">
<RouterLink :to="{ name: 'UserCreation', params: { network: network, set_id: data._data!.id } }">
<Btn secondary>See details</Btn>
</RouterLink>
<a :href="getSetLink('element', network, theme, data._data!.id)" target="_blank">
<Btn secondary>See on Element</Btn>
</a>
</p>
<p v-else-if="expand && !isAssembled" class="flex justify-between flex-wrap gap-2">
<a :href="getBookletLink('element', network, theme, data._data.token_id)" target="_blank">
<a :href="getBookletLink('element', network, theme, data._data!.token_id)" target="_blank">
<Btn secondary>See on Element</Btn>
</a>
<a :href="getBookletLink('unframed', network, theme, data._data.token_id)" target="_blank">
<a :href="getBookletLink('unframed', network, theme, data._data!.token_id)" target="_blank">
<Btn secondary>See on Unframed</Btn>
</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/themes/ObjectListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const setHoveredDuck = (tokenId: string | undefined) => {
<input class="w-full" type="text" v-model="searchBar" placeholder="Search for a specific duck">
<i class="fa-solid fa-magnifying-glass absolute right-3"/>
</p>
<div class="hidden sm:flex gap-2">
<div v-if="themeName !== 'ducks_frens'" class="hidden sm:flex gap-2">
<Btn secondary class="px-2 font-normal text-sm" @click="groupBy ? groupBy = undefined : groupBy = 'owner'">
<Toggle v-model="isGroupedByOwner" class="mr-2 w-8 pointer-events-none"/>
Group by owner
Expand Down

0 comments on commit 1fc5157

Please sign in to comment.