feat: enable sorting and filtering even without being signed in (#361)

This commit is contained in:
Vojtech Simetka 2023-04-03 11:31:28 +02:00 committed by GitHub
parent e0b4d297dc
commit 6c2ef2f9f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 71 deletions

View File

@ -73,37 +73,32 @@
<svelte:fragment slot="buttons">
{#if $profile.signer !== undefined}
<Button icon={Add} label="Create persona" on:click={createDraft} />
<Dropdown>
<Button slot="button" icon={SettingsView} />
<DropdownItem active={sortBy === 'date'} onClick={() => (sortBy = 'date')}>
Sort by date of creation
</DropdownItem>
<DropdownItem
active={sortBy === 'participantsCount'}
onClick={() => (sortBy = 'participantsCount')}
>
Sort by number of participants
</DropdownItem>
<DropdownItem active={sortBy === 'postsCount'} onClick={() => (sortBy = 'postsCount')}>
Sort by number of posts
</DropdownItem>
<DropdownItem
active={sortBy === 'alphabetical'}
onClick={() => (sortBy = 'alphabetical')}
>
Sort by name (alphabetical)
</DropdownItem>
</Dropdown>
<Button
icon={sortAsc ? SortAscending : SortDescending}
on:click={() => (sortAsc = !sortAsc)}
/>
{/if}
<Dropdown>
<Button slot="button" icon={SettingsView} />
<DropdownItem active={sortBy === 'date'} onClick={() => (sortBy = 'date')}>
Sort by date of creation
</DropdownItem>
<DropdownItem
active={sortBy === 'participantsCount'}
onClick={() => (sortBy = 'participantsCount')}
>
Sort by number of participants
</DropdownItem>
<DropdownItem active={sortBy === 'postsCount'} onClick={() => (sortBy = 'postsCount')}>
Sort by number of posts
</DropdownItem>
<DropdownItem active={sortBy === 'alphabetical'} onClick={() => (sortBy = 'alphabetical')}>
Sort by name (alphabetical)
</DropdownItem>
</Dropdown>
<Button
icon={sortAsc ? SortAscending : SortDescending}
on:click={() => (sortAsc = !sortAsc)}
/>
</svelte:fragment>
{#if $profile.signer !== undefined}
<Search bind:filterQuery />
{/if}
<Search bind:filterQuery />
</SectionTitle>
<Grid>

View File

@ -133,29 +133,25 @@
<SectionTitle title="All posts">
<svelte:fragment slot="buttons">
{#if $profile.signer !== undefined}
<Dropdown>
<Button slot="button" icon={SettingsView} />
<Dropdown>
<Button slot="button" icon={SettingsView} />
<DropdownItem active={sortBy === 'date'} onClick={() => (sortBy = 'date')}>
Sort by date of creation
</DropdownItem>
<DropdownItem
active={sortBy === 'alphabetical'}
onClick={() => (sortBy = 'alphabetical')}
>
Sort by name (alphabetical)
</DropdownItem>
</Dropdown>
<Button
icon={sortAsc ? SortAscending : SortDescending}
on:click={() => (sortAsc = !sortAsc)}
/>
{/if}
<DropdownItem active={sortBy === 'date'} onClick={() => (sortBy = 'date')}>
Sort by date of creation
</DropdownItem>
<DropdownItem
active={sortBy === 'alphabetical'}
onClick={() => (sortBy = 'alphabetical')}
>
Sort by name (alphabetical)
</DropdownItem>
</Dropdown>
<Button
icon={sortAsc ? SortAscending : SortDescending}
on:click={() => (sortAsc = !sortAsc)}
/>
</svelte:fragment>
{#if $profile.signer !== undefined}
<Search bind:filterQuery />
{/if}
<Search bind:filterQuery />
</SectionTitle>
{#if !personaPosts || personaPosts.loading}

View File

@ -200,29 +200,22 @@
<SectionTitle title="All pending posts">
<svelte:fragment slot="buttons">
{#if $profile.signer !== undefined}
<Dropdown>
<Button slot="button" icon={SettingsView} />
<Dropdown>
<Button slot="button" icon={SettingsView} />
<DropdownItem active={sortBy === 'date'} onClick={() => (sortBy = 'date')}>
Sort by date of creation
</DropdownItem>
<DropdownItem
active={sortBy === 'alphabetical'}
onClick={() => (sortBy = 'alphabetical')}
>
Sort by name (alphabetical)
</DropdownItem>
</Dropdown>
<Button
icon={sortAsc ? SortAscending : SortDescending}
on:click={() => (sortAsc = !sortAsc)}
/>
{/if}
<DropdownItem active={sortBy === 'date'} onClick={() => (sortBy = 'date')}>
Sort by date of creation
</DropdownItem>
<DropdownItem active={sortBy === 'alphabetical'} onClick={() => (sortBy = 'alphabetical')}>
Sort by name (alphabetical)
</DropdownItem>
</Dropdown>
<Button
icon={sortAsc ? SortAscending : SortDescending}
on:click={() => (sortAsc = !sortAsc)}
/>
</svelte:fragment>
{#if $profile.signer !== undefined}
<Search bind:filterQuery />
{/if}
<Search bind:filterQuery />
</SectionTitle>
{#if !personaPosts || personaPosts.loading}