Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
INDEXSUPPLY_API_KEY=
TIDX_BASIC_AUTH= # e.g. tidx:...
TIDX_URL=https://tidx.tempo.xyz
SLACK_FEEDBACK_WEBHOOK= # e.g. https://hooks.slack.com/services/...
VITE_BASE_URL= # e.g. https://docs.tempo.xyz
VITE_GA_MEASUREMENT_ID=
Expand Down
3 changes: 2 additions & 1 deletion env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ interface EnvironmentVariables {
readonly VITE_POSTHOG_HOST: string
readonly VITE_TEMPO_ENV: 'localnet' | 'devnet' | 'moderato'

readonly INDEXSUPPLY_API_KEY: string
readonly TIDX_BASIC_AUTH: string
readonly TIDX_URL: string
readonly SLACK_FEEDBACK_WEBHOOK: string

readonly VERCEL_URL: string
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"sql-formatter": "^15.7.3",
"tailwind-merge": "^3.5.0",
"tailwindcss": "^4.2.2",
"tidx.ts": "^0.1.1",
"unplugin-auto-import": "^21.0.0",
"unplugin-icons": "^23.0.1",
"viem": "^2.48.4",
Expand Down
27 changes: 27 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 12 additions & 14 deletions src/components/SignatureSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'
import * as React from 'react'
import { getAllSignatures, type SignatureInfo } from './lib/IndexSupplySignatures'
import { getAllSignatures, type SignatureInfo } from './lib/TidxSignatures'

type SignatureSelectorProps = {
value: string[]
Expand All @@ -17,6 +17,12 @@ export function SignatureSelector(props: SignatureSelectorProps) {

const allSignatures = React.useMemo(() => getAllSignatures(), [])

const handleClickOutside = React.useEffectEvent((event: MouseEvent) => {
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
setIsOpen(false)
}
})

const filteredSignatures = React.useMemo(() => {
let signatures = allSignatures

Expand Down Expand Up @@ -56,12 +62,6 @@ export function SignatureSelector(props: SignatureSelectorProps) {
React.useEffect(() => {
if (!isOpen) return

function handleClickOutside(event: MouseEvent) {
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
setIsOpen(false)
}
}

document.addEventListener('mousedown', handleClickOutside)
return () => document.removeEventListener('mousedown', handleClickOutside)
}, [isOpen])
Expand Down Expand Up @@ -115,7 +115,7 @@ export function SignatureSelector(props: SignatureSelectorProps) {
onChange={(e) => setSearchQuery(e.target.value)}
onFocus={() => !disabled && setIsOpen(true)}
placeholder={placeholderText}
className="h-[34px] w-full rounded-lg border border-gray4 px-3 text-[13px] focus:outline-none focus:ring-1 focus:ring-accent disabled:cursor-not-allowed disabled:opacity-50"
className="h-8.5 w-full rounded-lg border border-gray4 px-3 text-[13px] focus:outline-none focus:ring-1 focus:ring-accent disabled:cursor-not-allowed disabled:opacity-50"
disabled={disabled}
/>
{value.length > 0 && !disabled && (
Expand All @@ -131,7 +131,7 @@ export function SignatureSelector(props: SignatureSelectorProps) {
</div>

{isOpen && (
<div className="absolute z-10 mt-1 max-h-[400px] w-full overflow-y-auto rounded-lg border border-gray4 bg-gray1 shadow-lg">
<div className="absolute z-10 mt-1 max-h-100 w-full overflow-y-auto rounded-lg border border-gray4 bg-gray1 shadow-lg">
{Object.keys(groupedSignatures).length === 0 ? (
<div className="px-3 py-4 text-center text-[13px] text-gray9">No signatures found</div>
) : (
Expand Down Expand Up @@ -159,7 +159,7 @@ export function SignatureSelector(props: SignatureSelectorProps) {
{sig.signature}
</span>
<span
className={`ml-auto flex h-[16px] shrink-0 items-center justify-center rounded px-1.5 text-center font-medium text-[9px] uppercase leading-none tracking-[2%] ${
className={`ml-auto flex h-4 shrink-0 items-center justify-center rounded px-1.5 text-center font-medium text-[9px] uppercase leading-none tracking-[2%] ${
sig.type === 'event' ? 'bg-blue3 text-blue9' : 'bg-purple3 text-purple9'
}`}
>
Expand Down Expand Up @@ -194,7 +194,7 @@ export function SignatureSelector(props: SignatureSelectorProps) {
</div>
<div className="text-[11px] text-gray10">
<a
href="https://www.indexsupply.net/docs#evm-data"
href="https://github.com/tempoxyz/tidx.ts"
target="_blank"
rel="noopener noreferrer"
className="text-accent hover:underline"
Expand All @@ -219,9 +219,7 @@ export function SignatureSelector(props: SignatureSelectorProps) {
isEvent ? 'bg-blue9' : 'bg-purple9'
}`}
/>
<span className="max-w-[300px] truncate text-gray11">
{sigInfo?.name || sig}
</span>
<span className="max-w-75 truncate text-gray11">{sigInfo?.name || sig}</span>
{!disabled && (
<button
type="button"
Expand Down
Loading
Loading