Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Added conditional rendering of search bar

TzeYiing24c259d8d6e2
diff --git a/studio/components/interfaces/Settings/Logs/LogPanel.tsx b/studio/components/interfaces/Settings/Logs/LogPanel.tsx
index ed80630b45e..368f8ff7938 100644
--- a/studio/components/interfaces/Settings/Logs/LogPanel.tsx
+++ b/studio/components/interfaces/Settings/Logs/LogPanel.tsx
@@ -100,42 +100,44 @@ const LogPanel: FC<Props> = ({
</div>
<div className="flex items-center gap-x-4">
{/* wrap with form so that if user presses enter, the search value will submit automatically */}
- <form
- id="log-panel-search"
- onSubmit={(e) => {
- // prevent redirection
- e.preventDefault()
- onSearch(search)
- }}
- >
- <Input
- size="tiny"
- icon={<IconSearch size={16} />}
- placeholder="Search events"
- onChange={(e) => setSearch(e.target.value)}
- value={search}
- actions={[
- search && (
- <IconX
- key="clear-search"
+ {!isCustomQuery && (
+ <form
+ id="log-panel-search"
+ onSubmit={(e) => {
+ // prevent redirection
+ e.preventDefault()
+ onSearch(search)
+ }}
+ >
+ <Input
+ size="tiny"
+ icon={<IconSearch size={16} />}
+ placeholder="Search events"
+ onChange={(e) => setSearch(e.target.value)}
+ value={search}
+ actions={[
+ search && (
+ <IconX
+ key="clear-search"
+ size="tiny"
+ className="cursor-pointer mx-1"
+ title="Clear search"
+ onClick={() => setSearch('')}
+ />
+ ),
+ <Button
+ key="go"
size="tiny"
- className="cursor-pointer mx-1"
- title="Clear search"
- onClick={() => setSearch('')}
- />
- ),
- <Button
- key="go"
- size="tiny"
- title="Go"
- type="secondary"
- onClick={() => onSearch(search)}
- >
- Go
- </Button>,
- ]}
- />
- </form>
+ title="Go"
+ type="secondary"
+ onClick={() => onSearch(search)}
+ >
+ Go
+ </Button>,
+ ]}
+ />
+ </form>
+ )}
</div>
</div>
</div>