misc: change community sidebar to a modal

This commit is contained in:
Xyphyn committed 2023-07-26 18:40:26 -07:00
1 parent cdf10a29ff
commit 327ef007aa
3 files changed
+18 -16

No files matched your search

+2 -2
View File
@@ -54,7 +54,7 @@
export let size: ButtonSize = 'md'
export let rounded: ButtonRoundness = 'md'
const dispatch = createEventDispatcher()
// const dispatch = createEventDispatcher()
export let href: string | undefined = undefined
</script>
@@ -90,7 +90,7 @@
<button
disabled={loading}
{...$$restProps}
on:click={(e) => dispatch('click', e)}
on:click
class="{`
${buttonColor[color]}
${buttonSize[size]}
+1 -1
View File
@@ -29,7 +29,7 @@
})
</script>
<div class="break-words flex flex-col markdown gap-2">
<div class="break-words flex flex-col markdown gap-2 leading-[22px]">
{@html md.render(source)}
</div>
+15 -13
View File
@@ -10,8 +10,11 @@
import { Color } from '$lib/ui/colors'
import { fly } from 'svelte/transition'
import { userSettings } from '$lib/settings.js'
import Modal from '$lib/components/ui/modal/Modal.svelte'
export let data
let sidebar: boolean = false
</script>
<svelte:head>
@@ -29,24 +32,23 @@
<meta name="og:url" content={$page.url.toString()} />
</svelte:head>
<div class="flex flex-col md:flex-row gap-4 w-full">
<div class="md:hidden">
<details>
<summary class="flex flex-row">
<div
class="{Color.secondary} px-3 py-1 transition-colors text-sm
rounded-md cursor-pointer mb-1"
>
Sidebar
</div>
</summary>
<CommunityCard community_view={data.community.community_view} />
</details>
<Modal bind:open={sidebar}>
<span slot="title">Sidebar</span>
<div class="mx-auto">
<CommunityCard community_view={data.community.community_view} />
</div>
</Modal>
<div class="flex flex-col md:flex-row gap-4 w-full">
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<h1 class="text-2xl font-bold">
{data.community.community_view.community.title}
</h1>
<div class="md:hidden">
<Button color="secondary" on:click={() => (sidebar = true)}>
Sidebar
</Button>
</div>
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
<MultiSelect
options={['Active', 'Hot', 'TopAll', 'New']}