@turtleclub/opportunities 0.1.0-beta.61 → 0.1.0-beta.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.1.0-beta.62](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.61...@turtleclub/opportunities@0.1.0-beta.62) (2026-01-28)
7
+
8
+ ### Features
9
+
10
+ - implement turtle-basic UI scaffold with platform adapters ([#235](https://github.com/turtle-dao/turtle-tools/issues/235)) ([89dea4b](https://github.com/turtle-dao/turtle-tools/commit/89dea4b944a4e1dda8ae11ae17b6848ef1c81fa6))
11
+
6
12
  # [0.1.0-beta.61](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.60...@turtleclub/opportunities@0.1.0-beta.61) (2026-01-28)
7
13
 
8
14
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turtleclub/opportunities",
3
- "version": "0.1.0-beta.61",
3
+ "version": "0.1.0-beta.62",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -15,7 +15,7 @@
15
15
  "@tanstack/react-table": "^8.21.3",
16
16
  "@turtleclub/hooks": "0.5.0-beta.44",
17
17
  "@turtleclub/multichain": "0.5.0-beta.1",
18
- "@turtleclub/ui": "0.7.0-beta.23",
18
+ "@turtleclub/ui": "0.7.0-beta.24",
19
19
  "@turtleclub/utils": "0.4.0-beta.0",
20
20
  "jotai": "^2.10.3",
21
21
  "lucide-react": "^0.542.0",
@@ -31,5 +31,5 @@
31
31
  "@types/react-dom": "^18.3.5",
32
32
  "typescript": "^5.7.2"
33
33
  },
34
- "gitHead": "4a93ec9e58cff4424e003cabe74da0892dadcc95"
34
+ "gitHead": "b4cd0702ae6d9df357b930c8c86a371be7cec516"
35
35
  }
package/src/index.ts CHANGED
@@ -24,3 +24,9 @@ export * from "./route-details";
24
24
 
25
25
  // Constants
26
26
  export * from "./constants";
27
+
28
+ // Hooks
29
+ export * from "./opportunity-table/hooks";
30
+
31
+ // Utils
32
+ export * from "./opportunity-table/utils";
@@ -1,5 +1,5 @@
1
1
  import type { Opportunity, TokenBalance } from "@turtleclub/hooks";
2
- import { APIStatus, DataTable } from "@turtleclub/ui";
2
+ import { APIStatus, DataTable, cn } from "@turtleclub/ui";
3
3
  import type { ColumnDef, Row } from "@tanstack/react-table";
4
4
  import { formatCurrency } from "@turtleclub/utils";
5
5
  import { getTotalYield } from "../hooks/useTotalYield";
@@ -17,6 +17,7 @@ interface OpportunitiesTableProps {
17
17
  userTvlByOpportunity?: Record<string, number>;
18
18
  turtleTvl?: Record<string, number>;
19
19
  isWidget?: boolean;
20
+ compact?: boolean;
20
21
  }
21
22
 
22
23
  export function OpportunitiesTable({
@@ -29,6 +30,7 @@ export function OpportunitiesTable({
29
30
  userTvlByOpportunity = {},
30
31
  turtleTvl = {},
31
32
  isWidget = false,
33
+ compact = false,
32
34
  }: OpportunitiesTableProps) {
33
35
  const handleSelectOpportunity = (opportunity: Opportunity) => {
34
36
  onSelectOpportunity(opportunity);
@@ -41,16 +43,21 @@ export function OpportunitiesTable({
41
43
  onClose?.();
42
44
  };
43
45
 
46
+ const iconSize = compact ? "size-5" : "size-6";
47
+ const nameTextSize = compact ? "text-sm" : "";
48
+ const tvlTextSize = compact ? "text-xs" : "";
49
+ const aprTextSize = compact ? "text-sm" : "";
50
+
44
51
  const columns: ColumnDef<Opportunity>[] = [
45
52
  {
46
53
  accessorKey: "name",
47
54
  header: () => <div>Opportunity</div>,
48
55
  cell: ({ row }) => (
49
- <div className="flex items-center gap-2">
56
+ <div className={cn("flex items-center gap-2", nameTextSize)}>
50
57
  <div className="relative shrink-0">
51
58
  <img
52
59
  src={row.original.receiptToken.logoUrl}
53
- className="size-6 rounded-full"
60
+ className={cn("rounded-full", iconSize)}
54
61
  loading="lazy"
55
62
  alt={row.original.receiptToken.name}
56
63
  />
@@ -89,7 +96,7 @@ export function OpportunitiesTable({
89
96
  <div className="flex h-[30px] items-center gap-2">
90
97
  <img
91
98
  src={row.original.products[0].organization.iconUrl || ""}
92
- className="size-6 rounded-full"
99
+ className={cn("rounded-full", iconSize)}
93
100
  loading="lazy"
94
101
  />
95
102
  {row.original.products[0].organization.name}
@@ -109,7 +116,7 @@ export function OpportunitiesTable({
109
116
  {row.original.vaultConfig.curator.iconUrl && (
110
117
  <img
111
118
  src={row.original.vaultConfig.curator.iconUrl}
112
- className="size-6 rounded-full"
119
+ className={cn("rounded-full", iconSize)}
113
120
  loading="lazy"
114
121
  alt={row.original.vaultConfig.curator.name}
115
122
  />
@@ -131,7 +138,7 @@ export function OpportunitiesTable({
131
138
  {row.original.vaultConfig.infraProvider.iconUrl && (
132
139
  <img
133
140
  src={row.original.vaultConfig.infraProvider.iconUrl}
134
- className="size-6 rounded-full"
141
+ className={cn("rounded-full", iconSize)}
135
142
  loading="lazy"
136
143
  alt={row.original.vaultConfig.infraProvider.name}
137
144
  />
@@ -175,7 +182,9 @@ export function OpportunitiesTable({
175
182
  accessorKey: "tvl",
176
183
  header: () => <div className="flex w-full justify-end">Total TVL</div>,
177
184
  cell: ({ row }) => (
178
- <div className="text-end">{formatCurrency(row.original.tvl, 0, true)}</div>
185
+ <div className={compact ? cn("flex h-[30px] w-full justify-end items-center gap-2", tvlTextSize) : "text-end"}>
186
+ {formatCurrency(row.original.tvl, 0, true)}
187
+ </div>
179
188
  ),
180
189
  enableSorting: true,
181
190
  },
@@ -184,11 +193,12 @@ export function OpportunitiesTable({
184
193
  accessorFn: (row) => calculateNetAPR(row.incentives, row.vaultConfig ?? undefined),
185
194
  header: () => <div className="flex w-full justify-end">Est. APR</div>,
186
195
  cell: ({ row }) => (
187
- <div className="flex flex-row-reverse">
196
+ <div className={cn("flex flex-row-reverse", aprTextSize)}>
188
197
  <APRBreakdownTooltip
189
198
  incentives={row.original.incentives}
190
199
  vaultConfig={row.original.vaultConfig ?? undefined}
191
- isWidget={isWidget}
200
+ isWidget={compact || isWidget}
201
+ isPill={compact}
192
202
  />
193
203
  </div>
194
204
  ),