2022-07-25 20:22:24 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { boredState } from '$lib/stores/boredState';
|
|
|
|
|
import { gameStore } from '$lib/stores/gameSearchStore';
|
2022-08-07 21:53:21 +00:00
|
|
|
import AdvancedSearch from '$lib/components/search/advancedSearch/index.svelte';
|
2022-07-25 20:22:24 +00:00
|
|
|
|
2022-08-03 05:37:21 +00:00
|
|
|
export let showButton: boolean = false;
|
|
|
|
|
export let advancedSearch: boolean = false;
|
|
|
|
|
console.log('showButton', showButton);
|
2022-07-29 00:07:23 +00:00
|
|
|
|
2022-07-25 20:22:24 +00:00
|
|
|
let submitting = $boredState?.loading;
|
|
|
|
|
let name = '';
|
|
|
|
|
</script>
|
|
|
|
|
|
2022-08-07 21:53:21 +00:00
|
|
|
<!-- <form on:submit|preventDefault={handleSearch} method="post"> -->
|
|
|
|
|
<fieldset class="text-search" aria-busy={submitting} disabled={submitting}>
|
|
|
|
|
<label for="name">
|
|
|
|
|
Search
|
|
|
|
|
<input
|
|
|
|
|
id="name"
|
|
|
|
|
name="name"
|
|
|
|
|
bind:value={name}
|
|
|
|
|
type="text"
|
|
|
|
|
aria-label="Search boardgame"
|
|
|
|
|
placeholder="Search boardgame"
|
|
|
|
|
/>
|
|
|
|
|
</label>
|
|
|
|
|
</fieldset>
|
|
|
|
|
{#if advancedSearch}
|
|
|
|
|
<AdvancedSearch />
|
|
|
|
|
{/if}
|
|
|
|
|
{#if showButton}
|
|
|
|
|
<button class="btn" type="submit" disabled={submitting}>Submit</button>
|
|
|
|
|
{/if}
|
2022-07-25 20:22:24 +00:00
|
|
|
|
2022-08-07 21:53:21 +00:00
|
|
|
<!-- </form> -->
|
2022-07-25 20:22:24 +00:00
|
|
|
<style lang="scss">
|
|
|
|
|
h1 {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
button {
|
2022-08-03 05:37:21 +00:00
|
|
|
padding: 1rem;
|
2022-08-07 22:02:14 +00:00
|
|
|
margin-bottom: 1.5rem;
|
2022-07-25 20:22:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
label {
|
|
|
|
|
display: grid;
|
2022-08-08 21:45:39 +00:00
|
|
|
grid-template-columns: auto auto;
|
2022-07-29 00:07:23 +00:00
|
|
|
gap: 1rem;
|
2022-08-08 21:45:39 +00:00
|
|
|
place-content: start;
|
2022-07-29 00:07:23 +00:00
|
|
|
place-items: center;
|
2022-07-25 20:22:24 +00:00
|
|
|
margin: 1rem;
|
2022-08-04 07:22:10 +00:00
|
|
|
|
|
|
|
|
@media (max-width: 850px) {
|
2022-08-07 21:53:21 +00:00
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
2022-08-04 07:22:10 +00:00
|
|
|
}
|
2022-07-25 20:22:24 +00:00
|
|
|
}
|
|
|
|
|
</style>
|