mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Remove unused text search code.
This commit is contained in:
parent
5d9af200b7
commit
4c75d1f863
1 changed files with 66 additions and 82 deletions
|
|
@ -80,96 +80,80 @@
|
||||||
<SuperDebug data={$form} />
|
<SuperDebug data={$form} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<form id="search-form" action="/search" method="GET">
|
<search>
|
||||||
<div class="search">
|
<form id="search-form" action="/search" method="GET">
|
||||||
<fieldset class="text-search" aria-busy={submitting} disabled={submitting}>
|
<div class="search">
|
||||||
<Label for="label">Search</Label>
|
<fieldset class="text-search" aria-busy={submitting} disabled={submitting}>
|
||||||
<Input type="text" id="q" class={$errors.q && "outline outline-destructive"} name="search" placeholder="Search board games" data-invalid={$errors.q} bind:value={$form.q} />
|
<Label for="label">Search</Label>
|
||||||
{#if $errors.q}
|
<Input type="text" id="q" class={$errors.q && "outline outline-destructive"} name="search" placeholder="Search board games" data-invalid={$errors.q} bind:value={$form.q} />
|
||||||
<p class="text-sm text-destructive">{$errors.q}</p>
|
{#if $errors.q}
|
||||||
{/if}
|
<p class="text-sm text-destructive">{$errors.q}</p>
|
||||||
<input id="skip" type="hidden" name="skip" bind:value={$form.skip} />
|
|
||||||
<input id="limit" type="hidden" name="limit" bind:value={$form.limit} />
|
|
||||||
</fieldset>
|
|
||||||
{#if advancedSearch}
|
|
||||||
<!-- <Disclosure> -->
|
|
||||||
<!-- <DisclosureButton
|
|
||||||
class="disclosure-button"
|
|
||||||
on:click={() => (disclosureOpen = !disclosureOpen)}
|
|
||||||
> -->
|
|
||||||
<span>Advanced Search?</span>
|
|
||||||
<!-- <ChevronRightIcon
|
|
||||||
class="icon disclosure-icon"
|
|
||||||
style={disclosureOpen
|
|
||||||
? 'transform: rotate(90deg); transition: transform 0.5s ease;'
|
|
||||||
: 'transform: rotate(0deg); transition: transform 0.5s ease;'}
|
|
||||||
/> -->
|
|
||||||
<!-- </DisclosureButton> -->
|
|
||||||
|
|
||||||
{#if disclosureOpen}
|
|
||||||
<div transition:fade|global>
|
|
||||||
<!-- Using `static`, `DisclosurePanel` is always rendered,
|
|
||||||
and ignores the `open` state -->
|
|
||||||
<!-- <DisclosurePanel static> -->
|
|
||||||
{#if disclosureOpen}
|
|
||||||
<AdvancedSearch {form} {errors} {constraints} />
|
|
||||||
{/if}
|
|
||||||
<!-- </DisclosurePanel> -->
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
<!-- </Disclosure> -->
|
<input id="skip" type="hidden" name="skip" bind:value={$form.skip} />
|
||||||
{/if}
|
<input id="limit" type="hidden" name="limit" bind:value={$form.limit} />
|
||||||
</div>
|
</fieldset>
|
||||||
{#if showButton}
|
{#if advancedSearch}
|
||||||
<Button type="submit">Submit</Button>
|
<!-- <Disclosure> -->
|
||||||
{/if}
|
<!-- <DisclosureButton
|
||||||
</form>
|
class="disclosure-button"
|
||||||
|
on:click={() => (disclosureOpen = !disclosureOpen)}
|
||||||
|
> -->
|
||||||
|
<span>Advanced Search?</span>
|
||||||
|
<!-- <ChevronRightIcon
|
||||||
|
class="icon disclosure-icon"
|
||||||
|
style={disclosureOpen
|
||||||
|
? 'transform: rotate(90deg); transition: transform 0.5s ease;'
|
||||||
|
: 'transform: rotate(0deg); transition: transform 0.5s ease;'}
|
||||||
|
/> -->
|
||||||
|
<!-- </DisclosureButton> -->
|
||||||
|
|
||||||
{#if $boredState.loading}
|
{#if disclosureOpen}
|
||||||
<div class="games">
|
<div transition:fade|global>
|
||||||
<h1>Games Found:</h1>
|
<!-- Using `static`, `DisclosurePanel` is always rendered,
|
||||||
<div class="games-list">
|
and ignores the `open` state -->
|
||||||
<!-- {#each placeholderList as game, i}
|
<!-- <DisclosurePanel static> -->
|
||||||
<SkeletonPlaceholder
|
{#if disclosureOpen}
|
||||||
style="width: 100%; height: 500px; border-radius: var(--borderRadius);"
|
<AdvancedSearch {form} {errors} {constraints} />
|
||||||
/>
|
{/if}
|
||||||
{/each} -->
|
<!-- </DisclosurePanel> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/if}
|
||||||
{:else}
|
<!-- </Disclosure> -->
|
||||||
<div class="games">
|
|
||||||
<h1>Games Found:</h1>
|
|
||||||
<div class="games-list">
|
|
||||||
{#if totalCount > 0}
|
|
||||||
{#each games as game (game.id)}
|
|
||||||
<Game {game} />
|
|
||||||
{/each}
|
|
||||||
{:else}
|
|
||||||
<h2>Sorry no games found!</h2>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if showPagination && $gameStore?.length > 0}
|
{#if showButton}
|
||||||
<Pagination
|
<Button type="submit">Submit</Button>
|
||||||
{pageSize}
|
{/if}
|
||||||
{page}
|
</form>
|
||||||
{totalItems}
|
</search>
|
||||||
forwardText="Next"
|
|
||||||
backwardText="Prev"
|
<section class="games">
|
||||||
pageSizes={[10, 25, 50, 100]}
|
<h1>Games Found:</h1>
|
||||||
on:nextPageEvent={handleNextPageEvent}
|
<div class="games-list">
|
||||||
on:previousPageEvent={handlePreviousPageEvent}
|
{#if totalCount > 0}
|
||||||
on:perPageEvent={handlePerPageEvent}
|
{#each games as game (game.id)}
|
||||||
/>
|
<Game {game} />
|
||||||
|
{/each}
|
||||||
|
{:else}
|
||||||
|
<h2>Sorry no games found!</h2>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{#if showPagination && $gameStore?.length > 0}
|
||||||
|
<Pagination
|
||||||
|
{pageSize}
|
||||||
|
{page}
|
||||||
|
{totalItems}
|
||||||
|
forwardText="Next"
|
||||||
|
backwardText="Prev"
|
||||||
|
pageSizes={[10, 25, 50, 100]}
|
||||||
|
on:nextPageEvent={handleNextPageEvent}
|
||||||
|
on:previousPageEvent={handlePreviousPageEvent}
|
||||||
|
on:perPageEvent={handlePerPageEvent}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
</section>
|
||||||
|
|
||||||
<style lang="postcss">
|
<style lang="postcss">
|
||||||
.search {
|
|
||||||
display: grid;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
:global(.disclosure-button) {
|
:global(.disclosure-button) {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.25rem;
|
gap: 0.25rem;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue