Skip to content

Commit ab71d53

Browse files
committed
Merge branch 'feature/add-details-page' into feature/hide-package-lock-diffs
2 parents 2196766 + 6d02b7b commit ab71d53

File tree

62 files changed

+1196
-428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1196
-428
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ src/graphql/*
2828
*.njsproj
2929
*.sln
3030
*.sw?
31+
TODO

package-lock.json

Lines changed: 4 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc -b && vite build",
8+
"build": "vite build",
99
"lint": "eslint .",
10+
"check-type": "tsc -b",
1011
"format": "prettier --write src",
1112
"check-format": "prettier --check src",
1213
"preview": "vite preview",
@@ -21,6 +22,7 @@
2122
"@fontsource/space-mono": "^5.2.5",
2223
"@hookform/resolvers": "^5.0.1",
2324
"@icons-pack/react-simple-icons": "^12.7.0",
25+
"@multiformats/multiaddr": "^12.4.1",
2426
"@radix-ui/react-dialog": "^1.1.7",
2527
"@radix-ui/react-label": "^2.1.3",
2628
"@radix-ui/react-select": "^2.2.2",
@@ -41,7 +43,6 @@
4143
"graphql": "^16.10.0",
4244
"iexec": "^8.15.0",
4345
"lucide-react": "^0.487.0",
44-
"multiaddr": "^10.0.1",
4546
"prettier-plugin-tailwindcss": "^0.6.11",
4647
"react": "^19.0.0",
4748
"react-dom": "^19.0.0",

src/components/DataTable.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface DataTableProps<TData, TValue> {
2121
isLoading?: boolean;
2222
}
2323

24-
export function DataTable<TData extends { destination: string }, TValue>({
24+
export function DataTable<TData, TValue>({
2525
columns,
2626
data,
2727
tableLength = 10,
@@ -58,7 +58,12 @@ export function DataTable<TData extends { destination: string }, TValue>({
5858
<TableRow key={row.id} data-state={row.getIsSelected() && 'selected'}>
5959
{row.getVisibleCells().map((cell) => (
6060
<TableCell key={cell.id}>
61-
<ChainLink to={cell.row.original.destination}>
61+
<ChainLink
62+
to={
63+
(cell.row.original as { destination: string }).destination
64+
}
65+
className="w-full"
66+
>
6267
{flexRender(cell.column.columnDef.cell, cell.getContext())}
6368
</ChainLink>
6469
</TableCell>
@@ -80,7 +85,7 @@ export function DataTable<TData extends { destination: string }, TValue>({
8085
}).map((_, index) => (
8186
<TableRow key={`empty-${index}`}>
8287
{columns.map((_, colIndex) => (
83-
<TableCell key={colIndex} className="h-12">
88+
<TableCell key={colIndex} className="h-17">
8489
&nbsp;
8590
</TableCell>
8691
))}

src/components/navbar/NavBar.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Link } from '@tanstack/react-router';
21
import { LogOut } from 'lucide-react';
32
import { useState } from 'react';
43
import { useLoginLogout } from '@/hooks/useLoginLogout';
@@ -18,12 +17,12 @@ export function Navbar() {
1817
};
1918

2019
return (
21-
<div className="flex items-center justify-between pt-6 lg:pt-3">
20+
<div className="flex items-center justify-between py-6 lg:py-3">
2221
<ChainLink to="/" className="-m-2 flex items-center gap-2 p-2 font-mono">
2322
<img src={iExecLogo} width="25" height="25" alt="iExec logo" />
2423
<span className="hidden sm:block">iExec Explorer</span>
2524
</ChainLink>
26-
<div className="mr-6 flex items-center gap-4 md:mr-0">
25+
<div className="mr-8 flex items-center gap-4 md:mr-0">
2726
{isConnected && (
2827
<div className="hidden md:flex">
2928
<Button variant="link" asChild className="text-white">

src/components/ui/table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
9191
<td
9292
data-slot="table-cell"
9393
className={cn(
94-
'align-middle whitespace-nowrap *:inline-flex *:px-2 *:py-6 first:*:pl-4 last:*:pr-4 *:sm:px-3 *:sm:first:pl-6 sm:last:*:pr-6 *:md:px-5 md:first:*:pl-10 md:last:*:pr-10 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
94+
'align-middle whitespace-nowrap *:inline-flex *:px-2 *:py-6 first:*:pl-4 last:*:pr-4 *:sm:px-3 first:sm:*:pl-6 sm:last:*:pr-6 *:md:px-5 md:first:*:pl-10 md:last:*:pr-10 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
9595
className
9696
)}
9797
{...props}

src/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export const DETAIL_TABLE_LENGTH = 8;
77
export const TABLE_LENGTH = 16;
88
export const PREVIEW_TABLE_REFETCH_INTERVAL = 10_000;
99
export const TABLE_REFETCH_INTERVAL = 10_000;
10+
11+
export const IPFS_GATEWAY_URL = 'https://ipfs.iex.ec';
12+
1013
export const SUPPORTED_CHAINS = [
1114
{
1215
id: 134,

src/hooks/ChainSyncManger.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useParams, useRouter } from '@tanstack/react-router';
22
import { switchChain } from '@wagmi/core';
33
import { useEffect, useRef } from 'react';
44
import { useAccount } from 'wagmi';
5+
import { cleanIExecSDKs, initIExecSDKs } from '@/externals/iexecSdkClient';
56
import useUserStore from '@/stores/useUser.store';
67
import { getChainFromId, INITIAL_CHAIN } from '@/utils/chain.utils';
78
import { wagmiAdapter } from '@/utils/wagmiConfig';
@@ -22,6 +23,7 @@ export function ChainSyncManager() {
2223
address: accountAddress,
2324
isConnected: accountIsConnected,
2425
status: accountStatus,
26+
connector: accountConnector,
2527
} = useAccount();
2628
const { chainId, setChainId, setIsConnected, setAddress } = useUserStore();
2729

@@ -40,6 +42,11 @@ export function ChainSyncManager() {
4042
if (accountChain?.id && chainId !== accountChain?.id) {
4143
setChainId(accountChain?.id);
4244
}
45+
if (accountStatus === 'connected') {
46+
initIExecSDKs({ connector: accountConnector });
47+
return;
48+
}
49+
cleanIExecSDKs();
4350
}, [
4451
accountAddress,
4552
accountIsConnected,
@@ -48,6 +55,8 @@ export function ChainSyncManager() {
4855
chainId,
4956
accountChain?.id,
5057
setChainId,
58+
accountStatus,
59+
accountConnector,
5160
]);
5261

5362
// request chain change if the user connects on chain different from the active chain

src/hooks/useSyncChain.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)