From 56c4b35011c5bfed819ae6ad7a568f9d263d12b1 Mon Sep 17 00:00:00 2001 From: Eniola3321 Date: Wed, 25 Feb 2026 09:55:45 +0100 Subject: [PATCH 1/3] refactor(frontend): remove old contracts dynamic route --- .../[id]/components/BackfillModal.tsx | 74 ------- .../[id]/components/ContractForm.tsx | 154 ------------- .../contracts/[id]/events/explorer/page.tsx | 10 - soroscan-frontend/app/contracts/[id]/page.tsx | 206 ------------------ .../app/contracts/[id]/timeline/page.tsx | 10 - 5 files changed, 454 deletions(-) delete mode 100644 soroscan-frontend/app/contracts/[id]/components/BackfillModal.tsx delete mode 100644 soroscan-frontend/app/contracts/[id]/components/ContractForm.tsx delete mode 100644 soroscan-frontend/app/contracts/[id]/events/explorer/page.tsx delete mode 100644 soroscan-frontend/app/contracts/[id]/page.tsx delete mode 100644 soroscan-frontend/app/contracts/[id]/timeline/page.tsx diff --git a/soroscan-frontend/app/contracts/[id]/components/BackfillModal.tsx b/soroscan-frontend/app/contracts/[id]/components/BackfillModal.tsx deleted file mode 100644 index 27c1de5fc..000000000 --- a/soroscan-frontend/app/contracts/[id]/components/BackfillModal.tsx +++ /dev/null @@ -1,74 +0,0 @@ -"use client"; - -import * as React from "react"; -import { Modal } from "@/components/terminal/Modal"; -import { Button } from "@/components/terminal/Button"; -import type { BackfillTask } from "@/components/ingest/contract-types"; - -interface BackfillModalProps { - isOpen: boolean; - onClose: () => void; - task: BackfillTask | null; -} - -export function BackfillModal({ isOpen, onClose, task }: BackfillModalProps) { - return ( - -
- {task ? ( - <> -
-
- Task ID: - {task.taskId} -
-
- Status: - - {task.status.toUpperCase()} - -
- {task.progress !== undefined && ( -
-
- Progress: - {task.progress}% -
-
-
-
-
- )} - {task.message && ( -
- {task.message} -
- )} -
- -
- -
- - ) : ( -
No task information available
- )} -
- - ); -} diff --git a/soroscan-frontend/app/contracts/[id]/components/ContractForm.tsx b/soroscan-frontend/app/contracts/[id]/components/ContractForm.tsx deleted file mode 100644 index 8a6f44c62..000000000 --- a/soroscan-frontend/app/contracts/[id]/components/ContractForm.tsx +++ /dev/null @@ -1,154 +0,0 @@ -"use client"; - -import * as React from "react"; -import { Input } from "@/components/terminal/Input"; -import { Button } from "@/components/terminal/Button"; -import type { Contract, ContractFormData } from "@/components/ingest/contract-types"; - -interface ContractFormProps { - contract: Contract; - onSave: (data: ContractFormData) => Promise; - onCancel: () => void; -} - -export function ContractForm({ contract, onSave, onCancel }: ContractFormProps) { - const [formData, setFormData] = React.useState({ - contractId: contract.contractId, - name: contract.name, - description: contract.description || "", - tags: contract.tags || [], - status: contract.status, - }); - const [tagsInput, setTagsInput] = React.useState((contract.tags || []).join(", ")); - const [isSubmitting, setIsSubmitting] = React.useState(false); - const [error, setError] = React.useState(null); - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - setError(null); - - if (!formData.name.trim()) { - setError("Name is required"); - return; - } - - setIsSubmitting(true); - try { - await onSave(formData); - } catch (err) { - setError(err instanceof Error ? err.message : "Failed to update contract"); - } finally { - setIsSubmitting(false); - } - }; - - const handleTagsChange = (value: string) => { - setTagsInput(value); - const tags = value - .split(",") - .map((tag) => tag.trim()) - .filter((tag) => tag.length > 0); - setFormData({ ...formData, tags }); - }; - - return ( -
-
- -
- > - -
-
- - setFormData({ ...formData, name: e.target.value })} - placeholder="My Contract" - required - /> - -
- -
- - > - -