misc: change community sidebar to a modal
This commit is contained in:
1 parent
cdf10a29ff
commit
327ef007aa
3 files changed
+18
-16
No files matched your search
@@ -54,7 +54,7 @@
|
|||||||
export let size: ButtonSize = 'md'
|
export let size: ButtonSize = 'md'
|
||||||
export let rounded: ButtonRoundness = 'md'
|
export let rounded: ButtonRoundness = 'md'
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
// const dispatch = createEventDispatcher()
|
||||||
export let href: string | undefined = undefined
|
export let href: string | undefined = undefined
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<button
|
<button
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click={(e) => dispatch('click', e)}
|
on:click
|
||||||
class="{`
|
class="{`
|
||||||
${buttonColor[color]}
|
${buttonColor[color]}
|
||||||
${buttonSize[size]}
|
${buttonSize[size]}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
})
|
})
|
||||||
</script>
|
</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)}
|
{@html md.render(source)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,11 @@
|
|||||||
import { Color } from '$lib/ui/colors'
|
import { Color } from '$lib/ui/colors'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
import { userSettings } from '$lib/settings.js'
|
import { userSettings } from '$lib/settings.js'
|
||||||
|
import Modal from '$lib/components/ui/modal/Modal.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
|
let sidebar: boolean = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -29,24 +32,23 @@
|
|||||||
<meta name="og:url" content={$page.url.toString()} />
|
<meta name="og:url" content={$page.url.toString()} />
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex flex-col md:flex-row gap-4 w-full">
|
<Modal bind:open={sidebar}>
|
||||||
<div class="md:hidden">
|
<span slot="title">Sidebar</span>
|
||||||
<details>
|
<div class="mx-auto">
|
||||||
<summary class="flex flex-row">
|
<CommunityCard community_view={data.community.community_view} />
|
||||||
<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>
|
|
||||||
</div>
|
</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">
|
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||||
<h1 class="text-2xl font-bold">
|
<h1 class="text-2xl font-bold">
|
||||||
{data.community.community_view.community.title}
|
{data.community.community_view.community.title}
|
||||||
</h1>
|
</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">
|
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
||||||
<MultiSelect
|
<MultiSelect
|
||||||
options={['Active', 'Hot', 'TopAll', 'New']}
|
options={['Active', 'Hot', 'TopAll', 'New']}
|
||||||
|
|||||||
Reference in new issue
Block a user