mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-23 11:39:17 +08:00
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:
parent
1a5bed2ffb
commit
6ee1f1f721
5
.changeset/tidy-years-hammer.md
Normal file
5
.changeset/tidy-years-hammer.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"website": minor
|
||||
---
|
||||
|
||||
feat:Display all custom components in the gallery
|
@ -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%"
|
||||
|
Loading…
Reference in New Issue
Block a user