design: restructure andd redesign sidebar
This commit is contained in:
24 files changed
+281
-353
No files matched your search
@@ -6,9 +6,9 @@
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import ProfileButton from '$lib/components/ui/sidebar/ProfileButton.svelte'
|
||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { client } from '$lib/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { toast } from 'mono-svelte'
|
||||
import Button from 'mono-svelte/button/Button.svelte'
|
||||
import Material from 'mono-svelte/materials/Material.svelte'
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import ImageInputUpload from '$lib/components/form/ImageInputUpload.svelte'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient, site } from '$lib/lemmy.svelte.js'
|
||||
import { uploadImage } from '$lib/util.svelte.js'
|
||||
import type { SaveUserSettings } from 'lemmy-js-client'
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
ImageInput,
|
||||
Material,
|
||||
Menu,
|
||||
MenuButton,
|
||||
@@ -20,7 +19,6 @@
|
||||
} from 'mono-svelte'
|
||||
import { Icon, Plus } from 'svelte-hero-icons'
|
||||
import type { PageData } from './$types'
|
||||
import ImageInputUpload from '$lib/components/form/ImageInputUpload.svelte'
|
||||
|
||||
interface Props {
|
||||
inline?: boolean
|
||||
@@ -110,6 +108,9 @@
|
||||
<Switch bind:checked={formData.show_bot_accounts}>
|
||||
{$t('form.profile.showBots')}
|
||||
</Switch>
|
||||
<Switch bind:checked={formData.show_read_posts}>
|
||||
{$t('form.profile.showRead')}
|
||||
</Switch>
|
||||
<div class="space-y-1">
|
||||
<SectionTitle id="languages">
|
||||
{$t('form.profile.languages.title')}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<script>
|
||||
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { site } from '$lib/lemmy.svelte'
|
||||
import { feature } from '$lib/version'
|
||||
import { Button, Menu, MenuButton } from 'mono-svelte'
|
||||
import {
|
||||
ArrowDown,
|
||||
@@ -28,10 +26,6 @@
|
||||
<div class="flex flex-row justify-between">
|
||||
<Tabs
|
||||
routes={[
|
||||
{
|
||||
href: '/profile',
|
||||
name: $t('profile.profile'),
|
||||
},
|
||||
{
|
||||
href: '/profile/user',
|
||||
name: $t('routes.profile.submissions'),
|
||||
@@ -52,21 +46,16 @@
|
||||
name: $t('routes.profile.credentials'),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
{#if feature('mediaAndVotes', site.data?.version)}
|
||||
>
|
||||
<Menu class="flex-1" placement="bottom-end">
|
||||
{#snippet target()}
|
||||
<Button
|
||||
title={$t('post.actions.more.label')}
|
||||
size="square-lg"
|
||||
rounding="pill"
|
||||
aria-label={$t('post.actions.more.label')}
|
||||
size="square-sm"
|
||||
color="none"
|
||||
class="bg-white/60 dark:bg-zinc-800/60
|
||||
border border-slate-200/60 dark:border-zinc-800
|
||||
backdrop-blur-xl shadow-xl hover:bg-slate-100 dark:hover:bg-zinc-800
|
||||
shrink-0"
|
||||
class="z-0 text-slate-600 dark:text-zinc-500 hover:bg-slate-100 hover:dark:bg-zinc-800"
|
||||
>
|
||||
<Icon src={EllipsisHorizontal} size="16" mini />
|
||||
<Icon src={EllipsisHorizontal} size="16" micro />
|
||||
</Button>
|
||||
{/snippet}
|
||||
<MenuButton href="/profile/media">
|
||||
@@ -88,7 +77,7 @@
|
||||
{$t('routes.profile.downvoted')}
|
||||
</MenuButton>
|
||||
</Menu>
|
||||
{/if}
|
||||
</Tabs>
|
||||
</div>
|
||||
{@render children?.()}
|
||||
</div>
|
||||
@@ -1,8 +0,0 @@
|
||||
<script lang="ts">
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
</script>
|
||||
|
||||
<Header pageHeader>
|
||||
{$t('profile.profile')}
|
||||
</Header>
|
||||
@@ -0,0 +1,5 @@
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
|
||||
export function load() {
|
||||
redirect(302, '/profile/user')
|
||||
}
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
{#if data.user && data.sort && data.type && data.page}
|
||||
<UserPage
|
||||
inline
|
||||
data={{
|
||||
items: new ReactiveState(data.user.submissions),
|
||||
filters: new ReactiveState({
|
||||
@@ -14,8 +13,8 @@
|
||||
sort: data.sort,
|
||||
type: data.type,
|
||||
}),
|
||||
person_view: {value: data.user.person_view},
|
||||
moderates: {value: data.user.moderates},
|
||||
person_view: { value: data.user.person_view },
|
||||
moderates: { value: data.user.moderates },
|
||||
}}
|
||||
/>
|
||||
{:else}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { page } from '$app/state'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||
import ItemList from '$lib/components/lemmy/generic/ItemList.svelte'
|
||||
import { ban, isAdmin } from '$lib/components/lemmy/moderation/moderation.js'
|
||||
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
|
||||
@@ -34,7 +35,6 @@
|
||||
import {
|
||||
AdjustmentsHorizontal,
|
||||
AtSymbol,
|
||||
ChartBar,
|
||||
EllipsisHorizontal,
|
||||
Envelope,
|
||||
Fire,
|
||||
@@ -330,22 +330,10 @@
|
||||
<Option value="posts">{$t('content.posts')}</Option>
|
||||
<Option value="comments">{$t('content.comments')}</Option>
|
||||
</Select>
|
||||
<Select
|
||||
bind:value={data.filters.value.sort}
|
||||
name="sort"
|
||||
<Sort
|
||||
bind:selected={data.filters.value.sort}
|
||||
onchange={() => sortForm?.requestSubmit()}
|
||||
>
|
||||
{#snippet customLabel()}
|
||||
<span class="flex items-center gap-1">
|
||||
<Icon src={ChartBar} size="14" mini />
|
||||
{$t('filter.sort.label')}
|
||||
</span>
|
||||
{/snippet}
|
||||
<Option value="New">{$t('filter.sort.new')}</Option>
|
||||
<Option value="TopAll">{$t('filter.sort.top.label')}</Option>
|
||||
<Option value="Old">{$t('filter.sort.old')}</Option>
|
||||
<Option value="Controversial">{$t('filter.sort.controversial')}</Option>
|
||||
</Select>
|
||||
/>
|
||||
</form>
|
||||
{#if data.items.value.length == 0}
|
||||
<Placeholder
|
||||
|
||||
Reference in new issue
Block a user