Display all custom components in the gallery (#8224)

* Add code

* add changeset

* restore pnpm lock

* Empty

* new lockfile

* pin 9.0

* Test

* Fix action

* add changeset

* Update tests-js.yml

* remove limit

* revert pnpm-lock

* add changeset

* fix template issue

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: aliabd <ali.si3luwa@gmail.com>
This commit is contained in:
Freddy Boulton 2024-05-07 12:58:33 -04:00 committed by GitHub
parent 1a5bed2ffb
commit 6ee1f1f721
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -0,0 +1,5 @@
---
"website": minor
---
feat:Display all custom components in the gallery

View File

@ -6,8 +6,6 @@
import { clickOutside } from "./utils";
const API = "https://gradio-custom-component-gallery-backend.hf.space/";
const OFFSET = 0;
const LIMIT = 50;
let components: ComponentData[] = [];
let selection: string = "";
@ -47,9 +45,7 @@
async function fetch_components(selection: string[] = []) {
components = await fetch(
`${API}components?offset=${OFFSET}&limit=${LIMIT}&name_or_tags=${selection.join(
","
)}`
`${API}components?name_or_tags=${selection.join(",")}`
)
.then((response) => response.json())
.catch((error) => `Error: ${error}`);
@ -163,7 +159,7 @@
@{component.author}
</span>
</p>
{#if component.template != "Fallback"}
{#if component.template && component.template != "Fallback"}
<p
class="text-sm font-light py-1"
style="position: absolute; bottom: 5%; right: 5%"