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

Product table refactor #13807

Merged
merged 160 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
610748a
wip
corwintines Aug 1, 2024
c64aa75
Merge branch 'dev' into walletTableAbstraction
corwintines Aug 7, 2024
ccb0574
setup basic preset selection, and story implementation for find wallets
corwintines Aug 9, 2024
aa870a3
PresetFilter implemented
corwintines Aug 9, 2024
02f2bb9
typing
corwintines Aug 9, 2024
4cd40f0
setup filters
corwintines Aug 12, 2024
2e1b65d
Merge branch 'dev' into walletTableAbstraction
corwintines Aug 12, 2024
34b983d
switch boolean filters
corwintines Aug 13, 2024
c195f3c
setup filter switches
corwintines Aug 13, 2024
2f5237b
setup select
corwintines Aug 13, 2024
2b34a31
setup language filter
corwintines Aug 14, 2024
8a85c78
remove console logs
corwintines Aug 14, 2024
6706b5c
refactor
corwintines Aug 14, 2024
9ce98a4
add hidden filters
corwintines Aug 19, 2024
a753cd6
setup selecting multiple presets
corwintines Aug 19, 2024
904f38f
add logic for getting combined preset values
corwintines Aug 19, 2024
1723b67
render description
corwintines Aug 19, 2024
64a0af7
Add options checkbox to filtering and wallet filters
corwintines Aug 20, 2024
5301bbc
apply presets
corwintines Aug 20, 2024
74d4d02
comment
corwintines Aug 20, 2024
b2e4e91
setup table
corwintines Aug 22, 2024
c039298
Merge branch 'dev' into walletTableAbstraction
corwintines Aug 22, 2024
1f017a6
desktop row styling
corwintines Aug 22, 2024
89df3de
remove header
corwintines Aug 22, 2024
ebac7e8
responsive design filters
corwintines Aug 22, 2024
61a9010
Abstraction and typing
corwintines Aug 22, 2024
5249664
expand styling
corwintines Aug 22, 2024
3640f39
some styling updates and event control
corwintines Aug 23, 2024
381f2b1
introduce WalletSubComponent
corwintines Aug 27, 2024
f4890cc
tooltip
corwintines Aug 27, 2024
8b1b195
social links
corwintines Aug 27, 2024
a779352
setup mobile filters
corwintines Aug 27, 2024
10e4047
Merge branch 'dev' into walletTableAbstraction
corwintines Aug 28, 2024
33c9453
mobile filters
corwintines Aug 30, 2024
96554d8
Mobile menu button
corwintines Sep 2, 2024
946bdc7
sort feature info in WalletSubComponent
corwintines Sep 2, 2024
8cefc1a
remove margin on MobileFilters
corwintines Sep 2, 2024
623c3da
Move TableHead rendering to ColumnsDef files
corwintines Sep 2, 2024
f32bbf9
Filters design polish, and add open state to ProductTable to control …
corwintines Sep 2, 2024
bf32fc7
implement reset filters function and some styling for labels
corwintines Sep 2, 2024
6331c1e
fix logo size
corwintines Sep 2, 2024
c7e39ee
remove deprecated files
corwintines Sep 2, 2024
01acbb6
update typing, and add option to ignoring filter in updates
corwintines Sep 2, 2024
fa83585
fix preset logic
corwintines Sep 2, 2024
7558c8b
fix preset
corwintines Sep 2, 2024
254c7bd
Merge branch 'dev' into walletTableAbstraction
corwintines Sep 3, 2024
f24c7be
Add query param support
corwintines Sep 3, 2024
44186cf
Apply or remove preset based on active filters
corwintines Sep 3, 2024
4108ad3
fix filter count
corwintines Sep 3, 2024
252d155
no results styling
corwintines Sep 3, 2024
65668f6
Merge branch 'dev' into walletTableAbstraction
corwintines Sep 4, 2024
572f6b1
filter data based on filters
corwintines Sep 5, 2024
2c35a64
Refactor filter logic to parent component implementing ProductTable t…
corwintines Sep 5, 2024
cf005e1
languages filtering and restFilters abstraction
corwintines Sep 5, 2024
f0b8088
wrap badges
corwintines Sep 5, 2024
b795790
design tweaks
corwintines Sep 5, 2024
8bf747a
translations
corwintines Sep 5, 2024
48aee45
missing label and padding fix
corwintines Sep 5, 2024
3e0a399
Merge branch 'dev' into walletTableAbstraction
corwintines Sep 5, 2024
46b42d8
fix story
corwintines Sep 6, 2024
9a51aa4
Merge branch 'dev' into walletTableAbstraction
wackerow Sep 6, 2024
496c612
chore: patch color tokens
wackerow Sep 6, 2024
ea4782c
chore: use react-icons instead of lucide-react
wackerow Sep 6, 2024
d195b56
build: yarn remove lucide-react
wackerow Sep 6, 2024
290ec6a
fix typings
corwintines Sep 6, 2024
499331c
Merge remote-tracking branch 'origin/walletTableAbstraction' into wal…
corwintines Sep 6, 2024
706ece2
accessorKey to id
corwintines Sep 6, 2024
5296375
simplify resetFilter function
corwintines Sep 6, 2024
b5e5f8a
Update src/components/FindWalletProductTable/index.tsx
corwintines Sep 6, 2024
64db16f
Update src/components/FindWalletProductTable/index.tsx
corwintines Sep 6, 2024
d6b252a
clean up imports and revert functions
corwintines Sep 6, 2024
4b5fb46
fix build errors
corwintines Sep 6, 2024
586ec1c
make table translation file and move components
corwintines Sep 6, 2024
c60b1ba
abstract out no results component
corwintines Sep 6, 2024
6934cbf
fix padding regression
corwintines Sep 6, 2024
d646c0c
translation abstractions
corwintines Sep 6, 2024
cb751a0
fix bar rendering
corwintines Sep 6, 2024
dcffaff
convert SupportedLanguagesTooltip to shadcn
corwintines Sep 6, 2024
54c3ce6
guard clause
corwintines Sep 6, 2024
5743281
setup translations
corwintines Sep 17, 2024
7f6ef24
Merge branch 'dev' into walletTableAbstraction
corwintines Sep 18, 2024
e6653ac
test
corwintines Sep 18, 2024
836cbe7
fix story imports
corwintines Sep 18, 2024
6f983f5
test
corwintines Sep 18, 2024
b533813
Readd table
corwintines Sep 18, 2024
9080c6c
fix bug where input was firing event twice
corwintines Sep 18, 2024
3a1983c
Persona mobile styling
corwintines Sep 18, 2024
591e9fb
Merge branch 'dev' into walletTableAbstraction
corwintines Sep 19, 2024
92cfe00
fix: relocate /ui/Select/* to fix name collision
wackerow Sep 19, 2024
51b29da
Matomo events
corwintines Sep 19, 2024
8ddd6a9
Merge pull request #13908 from ethereum/walletSelect
corwintines Sep 19, 2024
9e37f0b
patch: import casing
wackerow Sep 20, 2024
ced3046
Merge branch 'dev' into walletTableAbstraction
wackerow Sep 20, 2024
fca3309
Update src/components/FindWalletProductTable/data/WalletFilters.tsx
corwintines Sep 30, 2024
1f0de83
Update src/components/ui/badge.tsx
corwintines Sep 30, 2024
b6626df
Merge branch 'dev' into walletTableAbstraction
corwintines Sep 30, 2024
0b50a21
presets text body medium
corwintines Sep 30, 2024
f41eeb2
change to checkbox
corwintines Sep 30, 2024
9a0c30c
filter text body medium
corwintines Sep 30, 2024
4cf7153
match WalletInfo text sizes to production
corwintines Sep 30, 2024
3021282
hover effect
corwintines Oct 1, 2024
31d07b0
sticky header
corwintines Oct 1, 2024
c4075f3
Update src/components/FindWalletProductTable/WalletSubComponent.tsx
corwintines Oct 1, 2024
b498c23
refactor Table to DataTable
corwintines Oct 1, 2024
5e79fc9
convert data file to hooks
corwintines Oct 1, 2024
15fbeb7
refactor to tailwind InlineLink
corwintines Oct 1, 2024
d43796e
FindWalletProductTable story data refactor
corwintines Oct 1, 2024
208e553
Refactor data keys to be more descriptive
corwintines Oct 1, 2024
f6c61ea
refactor div to button
corwintines Oct 1, 2024
c2133ee
baseStyles for table variants refactor
corwintines Oct 1, 2024
13a67fa
fix select import
pettinarip Oct 1, 2024
7899055
clean datatable from product definitions
pettinarip Oct 1, 2024
2266923
clean classnames
pettinarip Oct 1, 2024
f756408
add focus styles on preset filter buttons
pettinarip Oct 1, 2024
01466b9
Update color of text when active in PresetFilters
corwintines Oct 1, 2024
bf185d2
showing filter update
corwintines Oct 1, 2024
2b76cea
fix sticky position
corwintines Oct 1, 2024
78e1a19
Add closing x back in
corwintines Oct 1, 2024
631607e
fix filtering logic for presets
corwintines Oct 1, 2024
f35b214
text transition
corwintines Oct 1, 2024
a3e2ebe
switch style props with classname
pettinarip Oct 2, 2024
3528ff2
fix key prop in loop
pettinarip Oct 2, 2024
348bf4e
remove div from header render to have valid html
pettinarip Oct 2, 2024
fa50e31
replace react-i18next with next-i18next
pettinarip Oct 2, 2024
8cea986
replace old buttons with new ones and refactor code
pettinarip Oct 2, 2024
a1709f3
fix zindex in drawer
pettinarip Oct 2, 2024
577f2bf
fix top space and drawer handle color
pettinarip Oct 2, 2024
753d08d
bump vaul to latest
pettinarip Oct 2, 2024
b2b4101
fix language text
corwintines Oct 4, 2024
ce7492b
refactor WalletInfo for mobile layout
corwintines Oct 4, 2024
74e222f
styling for mobile
corwintines Oct 4, 2024
edf9a7c
Merge branch 'dev' into walletTableAbstraction
corwintines Oct 4, 2024
4d7b881
fix filter style for options
corwintines Oct 7, 2024
84db813
category labels bold, white, left aligned
corwintines Oct 7, 2024
009311b
fix z-index for select on mobile
corwintines Oct 8, 2024
52380e1
What are you looking for padding
corwintines Oct 8, 2024
310a9f2
Left align persona text
corwintines Oct 8, 2024
9a7b8bb
break words with hyphen
corwintines Oct 8, 2024
61f931f
fix button position
corwintines Oct 8, 2024
446b53d
fix brand line
corwintines Oct 8, 2024
6ce4f97
move labels up if no personas for a wallet
corwintines Oct 8, 2024
9614888
fix conditional for cases where there are options for filters
corwintines Oct 8, 2024
ea4475d
Animation on data change
corwintines Oct 8, 2024
cd49f21
Merge branch 'dev' into walletTableAbstraction
corwintines Oct 21, 2024
90bde68
fix border alignment issue
corwintines Oct 21, 2024
8bdad82
tablet button width fix
corwintines Oct 21, 2024
e1920e5
add gap for subcomponent
corwintines Oct 21, 2024
e0d4a13
WalletInfo blocking space
corwintines Oct 21, 2024
dc6a6d3
remove drawer handle
corwintines Oct 21, 2024
7397577
fix alignment
corwintines Oct 21, 2024
2ddad50
trigger build
corwintines Oct 21, 2024
209c326
fix: icon type erros
wackerow Oct 21, 2024
4c8e15a
fix: info icon no-wrap; wallet attribute alignment
wackerow Oct 21, 2024
2b3caae
Merge pull request #14207 from ethereum/walletTableAbstraction-info-icon
corwintines Oct 21, 2024
cf599cd
fix json file
pettinarip Oct 22, 2024
b85fdeb
fix minimal variant for the table component
pettinarip Oct 22, 2024
490bee0
fix rounded drawer border
corwintines Oct 23, 2024
b407906
center buttons in MobileFilters
corwintines Oct 23, 2024
5137804
fix brand bar media query
corwintines Oct 23, 2024
ba803de
item options now use newInputState as well for filters
corwintines Oct 23, 2024
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
2 changes: 2 additions & 0 deletions .storybook/i18next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export const ns = [
"page-developers-index",
"page-what-is-ethereum",
"page-upgrades-index",
"page-wallets-find-wallet",
"page-developers-docs",
"table",
] as const
const supportedLngs = Object.keys(baseLocales)

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@
"@radix-ui/react-portal": "^1.1.1",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@radix-ui/react-visually-hidden": "^1.1.0",
"@socialgouv/matomo-next": "^1.8.0",
"@tanstack/react-table": "^8.19.3",
"chart.js": "^4.4.2",
"chartjs-plugin-datalabels": "^2.2.0",
"class-variance-authority": "^0.7.0",
Expand Down Expand Up @@ -87,6 +89,7 @@
"tailwind-variants": "^0.2.1",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^3.1.0",
"vaul": "^1.0.0",
"yaml-loader": "^0.8.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/components/CentralizedExchanges/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import type { ChildOnlyProp, Lang } from "@/lib/types"

import CardList from "@/components/CardList"
import Emoji from "@/components/Emoji"
import Select from "@/components/ui/Select"
import InlineLink from "@/components/ui/Link"

import { getLocaleTimestamp } from "@/lib/utils/time"

import { WEBSITE_EMAIL } from "@/lib/constants"

import InlineLink from "../ui/Link"
import Select from "../Select"

import { useCentralizedExchanges } from "@/hooks/useCentralizedExchanges"

Expand Down
123 changes: 123 additions & 0 deletions src/components/DataTable/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import { Fragment, useEffect, useRef, useState } from "react"
import {
ColumnDef,
flexRender,
getCoreRowModel,
getExpandedRowModel,
useReactTable,
} from "@tanstack/react-table"

import {
Table,
TableBody,
TableCell,
TableHeader,
TableProps,
TableRow,
} from "@/components/ui/Table"

type DataTableProps<TData, TValue> = TableProps & {
columns: ColumnDef<TData, TValue>[]
data: TData[]
subComponent?: React.FC<TData>
noResultsComponent?: React.FC
}

const DataTable = <TData, TValue>({
columns,
data,
subComponent,
noResultsComponent,
...props
}: DataTableProps<TData, TValue>) => {
const [isVisible, setIsVisible] = useState(true)
const [currentData, setCurrentData] = useState(data)
const previousDataRef = useRef(data)

const table = useReactTable({
data: currentData,
columns,
getRowCanExpand: () => true,
getCoreRowModel: getCoreRowModel(),
getExpandedRowModel: getExpandedRowModel(),
})

useEffect(() => {
if (JSON.stringify(data) !== JSON.stringify(previousDataRef.current)) {
setIsVisible(false)
const timer = setTimeout(() => {
setCurrentData(data)
setIsVisible(true)
previousDataRef.current = data
}, 25) // Adjust this value to match your CSS transition duration

return () => clearTimeout(timer)
}
}, [data])

return (
<Table {...props}>
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
return (
<Fragment key={header.id}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext()
)}
</Fragment>
)
})}
</TableRow>
))}
</TableHeader>
<TableBody
className={`duration-25 transition-opacity ${
isVisible ? "opacity-100" : "opacity-0"
}`}
>
{table.getRowModel().rows?.length ? (
table.getRowModel().rows.map((row, idx) => (
<Fragment key={row.id}>
<TableRow
data-state={row.getIsSelected() && "selected"}
className={`${row.getIsExpanded() ? "cursor-pointer border-b-background-highlight bg-background-highlight" : "cursor-pointer"} hover:bg-background-highlight`}
onClick={(e) => {
// Prevent expanding the wallet more info section when clicking on the "Visit website" button
if (!(e.target as Element).matches("a, a svg")) {
row.getToggleExpandedHandler()()
}
}}
>
{row.getVisibleCells().map((cell) => (
<TableCell key={cell.id}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</TableCell>
))}
</TableRow>
{row.getIsExpanded() && (
<TableRow className={`bg-background-highlight`}>
<TableCell colSpan={row.getAllCells().length}>
{subComponent && subComponent(row.original, idx)}
</TableCell>
</TableRow>
)}
</Fragment>
))
) : (
<TableRow>
<TableCell colSpan={columns.length} className="h-24 text-center">
{noResultsComponent && noResultsComponent({})}
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
)
}

export default DataTable
152 changes: 0 additions & 152 deletions src/components/FindWallet/LanguageSupportFilter.tsx

This file was deleted.

Loading
Loading