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

Tables refactor #651

Merged
merged 30 commits into from
Jan 18, 2025
Merged

Tables refactor #651

merged 30 commits into from
Jan 18, 2025

Conversation

babalicious-io
Copy link
Collaborator

@babalicious-io babalicious-io commented Jan 17, 2025

Created a global table template - Tables.tsx - and table syles - TableStyles.ts - that handles all stamps and token tables (on their details page)
Table content files have been refactored and much of the definitions/handling moved to Table and TableStyles
StampListingsAll.tsx / StampSales.tsx / StampTransfers.tsx / TokenMints.tsx / TokenTransfers.tsx

TableStyles.ts

  • defines 4 categories of tables - stamps/src20/src101/vaults - used in Tables.tsx
  • styling for tab title/counts - Tables.tsx
  • styling for table content (amount and width of colGroup / cell text alignment) - StampListingsAll.tsx / StampSales.tsx / StampTransfers.tsx / TokenMints.tsx / TokenTransfers.tsx

Tables.tsx

  • customisable 1/2/3 tab headers
  • limit load to 20 rows - infinite scroll loads next 20 rows
  • Tab count moved to parent file - [id] (stamps) // [tick] (tokens) - for faster load/display
  • Animated LOADING text

Table content

  • url links and hoverState added to addy and tx hash
  • responsive abbreviated addresses and tx hash
  • StampListingsAll - custom colGroup / changed CONFIRMED column to SOURCE with static DISPENSER text / changed CLOSED to STATUS and BLOCK# to CLOSED with link to tx on blockchain.com
  • DATE columns have custom INVALID text message overriding "Invalid Date" error texts

HoldersGraph.tsx

  • updated the table to use the new global table styles
  • cleaned up column structure

StampListingsOpen.tsx - select listings part of the StampInfo buy button

  • updated the table to use the new global table styles
  • FROM changed to SOURCE with static DISPENSER text

I have attempted to refactor as best to my (and Claude's) knowledge - text linking could be refactored - everything should be reviewed and can probably be optimised some more
I haven't changed anything else with the HoldersGraph, since it's loading fast - the difference is that this table loads all rows instead of just 20 rows at a time (needs to be an island instead of a component to do this) - but it doesn't seem to slow it down
Tab counts for tables with many rows loads slow - same for infinite scroll - /src20/stamp
StampSales and StampTransfers DATE data is "unstable", sometimes it displays other times shows INVALID
StampListingsAll and StampListingsOpen are prepared for adding MARKETPLACE listings
I attempted to display a NO LISTINGS/SALES/TRANSFERS/MINTS text if the table data is empty, but got stuck in Claude's circular logic and couldn't get it to work

@reinamora137 reinamora137 merged commit 05bdbf8 into dev Jan 18, 2025
2 checks passed
@reinamora137 reinamora137 deleted the baba/tables_galore branch January 18, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants