Skip to content

Commit

Permalink
Split ducks everywhere theme page in many pages
Browse files Browse the repository at this point in the history
Ultimately the goal is to reuse some of the components for other Themes pages.

Also show all ducks even if they are disassembled, and make the page load faster.
  • Loading branch information
wraitii committed Dec 4, 2023
1 parent 34397c9 commit f5e4a4d
Show file tree
Hide file tree
Showing 13 changed files with 506 additions and 376 deletions.
16 changes: 15 additions & 1 deletion src/builder/DucksSale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,24 @@ export const useSearch = function() {
}
}

export const themeObjects = defaultDict((network: string) => {
return defaultDict((theme: string) => {
const ret = reactive(new Fetchable<Record<string, string>>());
ret.fetch(() => backendManager.fetch(`v1/${network}/${theme}/object_ids`));
return ret;
});
});

export const themeSetsDataStore = defaultDict((network: string) => {
return defaultDict((theme: string) => {
const ret = reactive(new Fetchable<Record<string, any>>());
ret.fetch(() => backendManager.fetch(`v1/${network}/${theme}/all_sets_static_data`));
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))
mapping[value['booklet_id']] = value;
return mapping;
});
return ret;
});
});
Expand Down
6 changes: 0 additions & 6 deletions src/components/Admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@ const setupWorld = async () => {
{ contractAddress: addr.attribute_groups, entrypoint: 'create_attribute_group', calldata: [addr.world, '0x3', 1, addr.booklet_ducks, addr.set_nft_ducks] },
{ contractAddress: addr.attribute_groups, entrypoint: 'create_attribute_group', calldata: [addr.world, '0x4', 1, addr.booklet_ducks_frens, addr.set_nft_1155_ducks_frens] },
/*
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['BriqFactoryStore', addr.briq_factory] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.briq_token] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.box_nft_sp] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.box_nft_briqmas] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.booklet_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.booklet_starknet_planet] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.booklet_briqmas] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.booklet_lil_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.booklet_ducks_frens] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.set_nft] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.set_nft_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.set_nft_sp] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.set_nft_briqmas] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.set_nft_1155_lil_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155OperatorApproval', addr.set_nft_1155_ducks_frens] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.briq_token] },
Expand All @@ -52,13 +49,11 @@ const setupWorld = async () => {
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.booklet_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.booklet_starknet_planet] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.booklet_briqmas] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.booklet_lil_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.booklet_ducks_frens] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.set_nft] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.set_nft_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.set_nft_sp] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.set_nft_briqmas] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.set_nft_1155_lil_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC1155Balance', addr.set_nft_1155_ducks_frens] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC721Balance', addr.set_nft] },
Expand All @@ -79,7 +74,6 @@ const setupWorld = async () => {
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC721TokenApproval', addr.set_nft_ducks] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC721TokenApproval', addr.set_nft_sp] },
{ contractAddress: addr.world, entrypoint: 'grant_writer', calldata: ['ERC721TokenApproval', addr.set_nft_briqmas] },
*/
];
// console.log(JSON.stringify(txes));
await (walletStore.signer)?.execute(txes)
Expand Down
2 changes: 1 addition & 1 deletion src/components/builder/genesis/GenesisMint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import RocketGlb from '@/assets/landing/rocket.glb?url';
import { nextTick, h, ref, onBeforeMount, onBeforeUnmount, onMounted } from 'vue';
import { useThemeURLs } from './ThemeUrlComposable';
import { useThemeURLs } from '@/components/themes/ThemeUrlComposable';
import { getSetMarketplaceUrl } from '@/chain/Marketplaces';
const modelViewerLoading = ref(true);
Expand Down
2 changes: 1 addition & 1 deletion src/components/builder/genesis/ThemeMainPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import MysteryBoxImg from '@/assets/landing/mysterybox.jpg';
import ToggleParagraph from '@/components/generic/ToggleParagraph.vue';
import { useThemeURLs } from './ThemeUrlComposable';
import { useThemeURLs } from '@/components/themes/ThemeUrlComposable';
import BoxCard from './BoxCard.vue';
const route = useRoute();
Expand Down
Loading

0 comments on commit f5e4a4d

Please sign in to comment.