Skip to content

Commit

Permalink
- complete the claiming process per nftOwner
Browse files Browse the repository at this point in the history
- add fetching of all images when a user goes straight to claimed through controller
  • Loading branch information
starknetdev committed Aug 29, 2024
1 parent f4bb81b commit 46d9ffa
Show file tree
Hide file tree
Showing 11 changed files with 371 additions and 274 deletions.
9 changes: 4 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@ const App = () => {
setUsername,
fetchingMetadata,
setFetchingMetadata,
freeGamesData,
} = useUIStore();

const { connector } = useConnect();

const network: Network = import.meta.env.VITE_NETWORK;

console.log(claimedData);
// console.log(claimedData);

useEffect(() => {
if (
claimedData.length > 0 &&
freeGamesData.length > 0 &&
fetchingMetadata &&
connector?.id.includes("cartridge")
) {
const fetchImages = async () => {
const adventurersMetadata = await Promise.all(
claimedData.map((claimed) =>
freeGamesData.map((claimed) =>
fetchAdventurerMetadata(
networkConfig[network!].gameAddress,
claimed.adventurerId,
Expand All @@ -57,8 +58,6 @@ const App = () => {
}
}, [claimedData, fetchingMetadata, connector]);

console.log(claimed);

useEffect(() => {
if (connector?.id.includes("cartridge")) {
const init = async () => {
Expand Down
131 changes: 28 additions & 103 deletions src/components/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,109 +14,34 @@ export const CompleteIcon: React.FC = () => (
);

export const TwitterIcon: React.FC = () => (
<svg viewBox="0 0 43 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M24.0001 29.3346H10.6667V26.668H13.3334V24.0013H16.0001V21.3346H13.3334V18.668H10.6667V13.3346H8.00008V10.668H5.33342V8.0013H2.66675V5.33464H8.00008V8.0013H16.0001V10.668H21.3334V8.0013H24.0001V5.33464H26.6667V2.66797H34.6668V5.33464H40.0001V8.0013H37.3334V13.3346H34.6668V21.3346H32.0001V24.0013H29.3334V26.668H24.0001V29.3346Z"
fill="#33FF33"
/>
<path
d="M21.3333 5.33333H24V8H21.3333V5.33333Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M24 2.66667H26.6667V5.33333H24V2.66667Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M40 5.33333H42.6667V8H40V5.33333Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M32 21.3333H34.6667V24H32V21.3333Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M29.3333 24H32V26.6667H29.3333V24Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M8 26.6667H10.6667V29.3333H8V26.6667Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M10.6667 24H13.3333V26.6667H10.6667V24Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M13.3333 21.3333H16V24H13.3333V21.3333Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M10.6667 18.6667H13.3333V21.3333H10.6667V18.6667Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M5.33333 10.6667H8V13.3333H5.33333V10.6667Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M2.66667 8H5.33333V10.6667H2.66667V8Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M0 5.33333H2.66667V8H0V5.33333Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M24 32V29.3333H10.6667V32H24Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M29.3333 29.3333V26.6667H24V29.3333H29.3333Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M37.3333 13.3333H34.6667V21.3333H37.3333V13.3333Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path d="M40 8H37.3333V13.3333H40V8Z" fill="#33FF33" fill-opacity="0.25" />
<path
d="M34.6667 2.66667V5.33333H40V2.66667H34.6667Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M26.6667 0V2.66667H34.6667V0H26.6667Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path d="M16 8V10.6667H21.3333V8H16Z" fill="#33FF33" fill-opacity="0.25" />
<path d="M8 5.33333V8H16V5.33333H8Z" fill="#33FF33" fill-opacity="0.25" />
<path
d="M2.66667 2.66667V5.33333H8V2.66667H2.66667Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<path
d="M8 18.6667H10.6667V13.3333H8V18.6667Z"
fill="#33FF33"
fill-opacity="0.25"
/>
<svg
viewBox="0 0 43 32"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M24.0001 29.3346H10.6667V26.668H13.3334V24.0013H16.0001V21.3346H13.3334V18.668H10.6667V13.3346H8.00008V10.668H5.33342V8.0013H2.66675V5.33464H8.00008V8.0013H16.0001V10.668H21.3334V8.0013H24.0001V5.33464H26.6667V2.66797H34.6668V5.33464H40.0001V8.0013H37.3334V13.3346H34.6668V21.3346H32.0001V24.0013H29.3334V26.668H24.0001V29.3346Z" />
<path d="M21.3333 5.33333H24V8H21.3333V5.33333Z" />
<path d="M24 2.66667H26.6667V5.33333H24V2.66667Z" />
<path d="M40 5.33333H42.6667V8H40V5.33333Z" />
<path d="M32 21.3333H34.6667V24H32V21.3333Z" />
<path d="M29.3333 24H32V26.6667H29.3333V24Z" />
<path d="M8 26.6667H10.6667V29.3333H8V26.6667Z" />
<path d="M10.6667 24H13.3333V26.6667H10.6667V24Z" />
<path d="M13.3333 21.3333H16V24H13.3333V21.3333Z" />
<path d="M10.6667 18.6667H13.3333V21.3333H10.6667V18.6667Z" />
<path d="M5.33333 10.6667H8V13.3333H5.33333V10.6667Z" />
<path d="M2.66667 8H5.33333V10.6667H2.66667V8Z" />
<path d="M0 5.33333H2.66667V8H0V5.33333Z" />
<path d="M24 32V29.3333H10.6667V32H24Z" />
<path d="M29.3333 29.3333V26.6667H24V29.3333H29.3333Z" />
<path d="M37.3333 13.3333H34.6667V21.3333H37.3333V13.3333Z" />
<path d="M40 8H37.3333V13.3333H40V8Z" />
<path d="M34.6667 2.66667V5.33333H40V2.66667H34.6667Z" />
<path d="M26.6667 0V2.66667H34.6667V0H26.6667Z" />
<path d="M16 8V10.6667H21.3333V8H16Z" />
<path d="M8 5.33333V8H16V5.33333H8Z" />
<path d="M2.66667 2.66667V5.33333H8V2.66667H2.66667Z" />
<path d="M8 18.6667H10.6667V13.3333H8V18.6667Z" />
</svg>
);

Expand Down
Loading

0 comments on commit 46d9ffa

Please sign in to comment.