Add mobile compatibility for app search bar

This commit is contained in:
Andrew Kingston 2021-10-01 11:43:09 +01:00
parent 2b49635a31
commit ad97e5fb71
1 changed files with 20 additions and 1 deletions

View File

@ -216,6 +216,7 @@
<div class="filter"> <div class="filter">
<div class="select"> <div class="select">
<Select <Select
autoWidth
bind:value={sortBy} bind:value={sortBy}
placeholder={null} placeholder={null}
options={[ options={[
@ -224,7 +225,9 @@
{ label: "Sort by status", value: "status" }, { label: "Sort by status", value: "status" },
]} ]}
/> />
<Search placeholder="Search" bind:value={searchTerm} /> <div class="desktop-search">
<Search placeholder="Search" bind:value={searchTerm} />
</div>
</div> </div>
<ActionGroup> <ActionGroup>
<ActionButton <ActionButton
@ -241,6 +244,9 @@
/> />
</ActionGroup> </ActionGroup>
</div> </div>
<div class="mobile-search">
<Search placeholder="Search" bind:value={searchTerm} />
</div>
<div <div
class:appGrid={layout === "grid"} class:appGrid={layout === "grid"}
class:appTable={layout === "table"} class:appTable={layout === "table"}
@ -318,6 +324,7 @@
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 10px;
} }
.select { .select {
@ -325,6 +332,12 @@
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
grid-gap: 10px; grid-gap: 10px;
} }
.filter :global(.spectrum-ActionGroup) {
flex-wrap: nowrap;
}
.mobile-search {
display: none;
}
.appGrid { .appGrid {
display: grid; display: grid;
@ -364,5 +377,11 @@
.appTable { .appTable {
grid-template-columns: 1fr auto; grid-template-columns: 1fr auto;
} }
.desktop-search {
display: none;
}
.mobile-search {
display: block;
}
} }
</style> </style>