Skip to content

Commit d2d3d1a

Browse files
committed
Implemented transferable module in the dashboard
1 parent 295dd1b commit d2d3d1a

File tree

8 files changed

+563
-379
lines changed

8 files changed

+563
-379
lines changed

apps/dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"preinstall": "npx only-allow pnpm",
7-
"dev": "next dev --turbo",
7+
"dev": "next dev",
88
"build": "next build",
99
"start": "next start",
1010
"format": "biome format ./src --write",

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/ContractEditModulesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const ContractEditModulesPage: React.FC<
5757
{isOwner && (
5858
<div>
5959
<div>
60-
<h2 className="mb-1 font-bold text-2xl tracking-tight">
60+
<h2 className="mb-1 text-2xl font-bold tracking-tight">
6161
Edit Modules
6262
</h2>
6363
<p className="text-muted-foreground">

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/InstalledModulesTable.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
import { uninstallModuleByProxy } from "thirdweb/modules";
3131
import type { Account } from "thirdweb/wallets";
3232
import { useModuleContractInfo } from "./moduleContractInfo";
33+
import TransferrableModal from "./transferrable/TransferrableModal";
3334

3435
export const InstalledModulesTable = (props: {
3536
contract: ContractOptions;
@@ -43,7 +44,7 @@ export const InstalledModulesTable = (props: {
4344
const { installedModules, ownerAccount } = props;
4445

4546
const sectionTitle = (
46-
<h2 className="mb-3 font-bold text-2xl tracking-tight">
47+
<h2 className="mb-3 text-2xl font-bold tracking-tight">
4748
Installed Modules
4849
</h2>
4950
);
@@ -75,6 +76,7 @@ export const InstalledModulesTable = (props: {
7576
<TableHeading> Module Address </TableHeading>
7677
<TableHeading> Version </TableHeading>
7778
{ownerAccount && <TableHeading> Remove </TableHeading>}
79+
{ownerAccount && <TableHeading> Configure </TableHeading>}
7880
</TableHeadingRow>
7981
</thead>
8082

@@ -145,6 +147,7 @@ function ModuleRow(props: {
145147
}) {
146148
const { contract, moduleAddress, ownerAccount } = props;
147149
const [isUninstallModalOpen, setIsUninstallModalOpen] = useState(false);
150+
const [isConfigureModalOpen, setIsConfigureModalOpen] = useState(false);
148151

149152
const contractInfo = useModuleContractInfo(
150153
getContract({
@@ -240,6 +243,15 @@ function ModuleRow(props: {
240243
</TableData>
241244
)}
242245

246+
{/* Configure */}
247+
{ownerAccount && (
248+
<TableData>
249+
<div>
250+
<TransferrableModal contract={contract} account={ownerAccount} />
251+
</div>
252+
</TableData>
253+
)}
254+
243255
<Dialog
244256
open={isUninstallModalOpen}
245257
onOpenChange={setIsUninstallModalOpen}
@@ -291,7 +303,7 @@ function ModuleRow(props: {
291303

292304
function TableRow(props: { children: React.ReactNode }) {
293305
return (
294-
<tr className="border-border border-b [&:last-child]:border-b-0">
306+
<tr className="border-b border-border [&:last-child]:border-b-0">
295307
{props.children}
296308
</tr>
297309
);
@@ -303,7 +315,7 @@ function TableData({ children }: { children: React.ReactNode }) {
303315

304316
function TableHeading(props: { children: React.ReactNode }) {
305317
return (
306-
<th className="min-w-[150px] border-border border-b px-3 py-3 text-left font-medium text-muted-foreground text-sm">
318+
<th className="min-w-[150px] border-b border-border px-3 py-3 text-left text-sm font-medium text-muted-foreground">
307319
{props.children}
308320
</th>
309321
);

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/Transferrable.tsx

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

0 commit comments

Comments
 (0)