Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wallet-dashboard): show kiosk NFTs #4610

Merged
merged 42 commits into from
Jan 20, 2025
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
bf71636
refactor(wallet): move notification to separate component.
panteleymonchuk Dec 16, 2024
bc69f2f
feat(wallet): enhance hidden asset functionality with undo option and…
panteleymonchuk Dec 16, 2024
351bfe4
feat(wallet): add undo functionality for showing hidden assets with n…
panteleymonchuk Dec 16, 2024
a7a42f7
feat(core): move HiddenAssetsProvider.
panteleymonchuk Dec 16, 2024
0b491ad
feat(core): move useGetNFTs.
panteleymonchuk Dec 16, 2024
5137f19
feat(core): update useGetNFTs to accept filter and improve asset fetc…
panteleymonchuk Dec 16, 2024
5185c8d
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk Dec 17, 2024
70752dd
refactor(dashboard): remove 'Hidden' asset category and related logic
panteleymonchuk Dec 18, 2024
73f2001
refactor(wallet-dashboard): remove 'Hidden' asset category from layout
panteleymonchuk Dec 18, 2024
9537c65
refactor(dashboard): remove HiddenAssets context, update default sele…
panteleymonchuk Dec 18, 2024
47a7033
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk Dec 18, 2024
90e0791
feat(core): add refetch capability to useGetNFTs hook
panteleymonchuk Dec 18, 2024
1647efa
Merge branch 'develop' into tooling-dashboard/improve-asset-filter
panteleymonchuk Dec 18, 2024
2a08552
refactor(core): improve hide/show logic
panteleymonchuk Dec 20, 2024
2939b92
refactor(core): remove undo functionality and streamline asset visibi…
panteleymonchuk Dec 20, 2024
f12a355
refactor(core): simplify asset visibility management and improve erro…
panteleymonchuk Dec 20, 2024
600373a
refactor(wallet): rename MoveAssetNotification to MovedAssetNotification
panteleymonchuk Dec 20, 2024
d4c6b1d
Merge branch 'develop' into tooling-dashboard/improve-asset-filter
panteleymonchuk Dec 20, 2024
8d81ff3
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk Dec 23, 2024
57851fe
refactor(dashboard): adapt logic to useGetNFTs hook.
panteleymonchuk Dec 23, 2024
ea69c3d
feat(wallet-dashboard): add KioskTile component and integrate with As…
panteleymonchuk Dec 23, 2024
6565fd6
feat(dashboard): move KioskTile component to core and update references
panteleymonchuk Dec 23, 2024
bde631a
feat(dashboard): add KioskDetailsView and integrate with asset dialog…
panteleymonchuk Dec 23, 2024
81008ce
feat(core, wallet): move NftImage component to core and update refere…
panteleymonchuk Dec 23, 2024
4b710db
feat(dashboard): enhance AssetDialog and KioskDetailsView with select…
panteleymonchuk Dec 23, 2024
372e5af
Merge branch 'develop' into tooling-dashboard/improve-asset-filter
panteleymonchuk Dec 27, 2024
9e0acb8
Merge branch 'tooling-dashboard/improve-asset-filter' into tooling-da…
panteleymonchuk Jan 5, 2025
502121b
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk Jan 8, 2025
170730c
fix(wallet-dashboard): improve asset loading logic and conditional re…
panteleymonchuk Jan 8, 2025
04c36ba
feat(wallet-dashboard): move logic for page to the hook
panteleymonchuk Jan 8, 2025
7e296af
Merge branch 'develop' into tooling-dashboard/improve-asset-filter
panteleymonchuk Jan 8, 2025
bc5f016
Merge remote-tracking branch 'origin/tooling-dashboard/improve-asset-…
panteleymonchuk Jan 8, 2025
75d9f28
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk Jan 10, 2025
6910501
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk Jan 13, 2025
175bc41
refactor(dashboard): add back button for kiosk item details, fix send…
panteleymonchuk Jan 13, 2025
4d0966c
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk Jan 13, 2025
a962185
refactor(core): cleanup
panteleymonchuk Jan 14, 2025
e7c81ca
Merge branch 'develop' into tooling-dashboard/show-kiosk-in-the-dashb…
panteleymonchuk Jan 14, 2025
e137c1b
Merge branch 'develop' into tooling-dashboard/show-kiosk-in-the-dashb…
panteleymonchuk Jan 15, 2025
acda3a5
Merge branch 'develop' into tooling-dashboard/show-kiosk-in-the-dashb…
panteleymonchuk Jan 16, 2025
2a7b8b6
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk Jan 20, 2025
326a676
feat(wallet-dashboard): enhance KioskDetailsView layout and add item …
panteleymonchuk Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(wallet-dashboard): improve asset loading logic and conditional re…
…ndering
  • Loading branch information
panteleymonchuk committed Jan 8, 2025
commit 170730c3e6e43cf685371a2e7aeeea5b8a27decd
45 changes: 32 additions & 13 deletions apps/wallet-dashboard/app/(protected)/assets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ export default function AssetsDashboardPage(): React.JSX.Element {
const account = useCurrentAccount();
const {
data: ownedAssets,
isFetching,
fetchNextPage,
hasNextPage,
fetchNextPage,
isPending,
isFetching,
refetch,
isFetchingNextPage,
} = useGetNFTs(account?.address, {
MatchNone: [{ StructType: COIN_TYPE }],
});
const isAssetsLoaded = !!ownedAssets;

let assets: IotaObjectData[] = [];

Expand Down Expand Up @@ -70,21 +73,37 @@ export default function AssetsDashboardPage(): React.JSX.Element {
setSelectedCategory(defaultCategory);
}, [ownedAssets, selectedCategory]);

useEffect(() => {
// Fetch the next page if there are no visual assets, other + hidden assets are present in multiples of 50, and there are more pages to fetch
if (
hasNextPage &&
ownedAssets?.visual.length === 0 &&
ownedAssets?.other.length + ownedAssets?.hidden.length > 0 &&
(ownedAssets.other.length + ownedAssets.hidden.length) % 50 === 0 &&
!isFetchingNextPage
) {
fetchNextPage();
setSelectedCategory(null);
}
}, [hasNextPage, ownedAssets, isFetchingNextPage, fetchNextPage]);

return (
<Panel>
<Title title="Assets" size={TitleSize.Medium} />
<div className="px-lg">
<div className="flex flex-row items-center justify-start gap-xs py-xs">
{ASSET_CATEGORIES.map((tab) => (
<Chip
key={tab.label}
label={tab.label}
onClick={() => setSelectedCategory(tab.value)}
selected={selectedCategory === tab.value}
/>
))}
</div>
{selectedCategory && (
{isAssetsLoaded && Boolean(assets) ? (
<div className="flex flex-row items-center justify-start gap-xs py-xs">
{ASSET_CATEGORIES.map((tab) => (
<Chip
key={tab.label}
label={tab.label}
onClick={() => setSelectedCategory(tab.value)}
selected={selectedCategory === tab.value}
/>
))}
</div>
) : null}
{!isPending && selectedCategory && (
<AssetList
assets={assets}
selectedCategory={selectedCategory}
Expand Down
Loading