fix: use pageheader where needed

This commit is contained in:
Xylight committed 2024-07-27 13:14:26 -07:00
1 parent 7c66fea335
commit 1ab3f404cc
28 files changed
+132 -135

No files matched your search

@@ -1,16 +1,23 @@
<script lang="ts">
import { userSettings } from '$lib/settings'
import { contentPadding } from '../Shell.svelte'
export let pageHeader = false
</script>
<div
class="
w-[calc(100%+2rem)]
sm:w-[calc(100%+3rem)]
{pageHeader
? `w-[calc(100%+2rem)] sm:w-[calc(100%+3rem)]
bg-slate-50 dark:bg-zinc-950 -m-4 sm:-m-6 mb-0 sm:mb-0 sm:p-6 p-4
border-b border-slate-200 dark:border-zinc-800"
style="margin-top: min(-1.5rem, calc(-1 * calc({$contentPadding.top}px)));
padding-top: max(1.5rem, calc({$contentPadding.top}px));"
border-b border-slate-200 dark:border-zinc-800`
: ''}
"
style="{pageHeader
? `margin-top: min(-1.5rem, calc(-1 * calc(${$contentPadding.top}px))); padding-top: max(1.5rem, calc(${$contentPadding.top}px));`
: ''};
"
>
<h1
class="text-3xl font-bold flex items-center gap-2 w-full
+1 -1
View File
@@ -28,7 +28,7 @@
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<header class="flex flex-col gap-4 relative">
<Header>
<Header pageHeader>
{$t('routes.frontpage.title')}
<div class="flex items-center gap-2" slot="extended">
+32 -24
View File
@@ -1,8 +1,7 @@
<script>
import { goto } from '$app/navigation'
import { page } from '$app/stores'
import { notifications, profile } from '$lib/auth'
import MultiSelect from '$lib/components/input/Switch.svelte'
import { notifications } from '$lib/auth'
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
import { t } from '$lib/translations'
import { Badge } from 'mono-svelte'
</script>
@@ -16,25 +15,34 @@
{/if}
<div class="flex flex-col gap-4 h-full">
<MultiSelect
options={[
'/admin/config',
'/admin/applications',
'/admin/taglines',
'/admin/team',
'/admin/federation',
]}
optionNames={[
$t('routes.admin.config.title'),
$t('routes.admin.applications.title'),
$t('routes.admin.taglines.title'),
$t('routes.admin.team.title'),
$t('routes.admin.federation.title'),
]}
selected={$page.url.pathname}
on:select={(e) => {
goto(e.detail)
}}
/>
<div
class="sticky mx-auto z-50 max-w-full min-w-0 flex items-center gap-2"
style="top: max(1.5rem, {$contentPadding.top}px);"
>
<Tabs
routes={[
{
href: '/admin/config',
name: $t('routes.admin.config.title'),
},
{
href: '/admin/applications',
name: $t('routes.admin.applications.title'),
},
{
href: '/admin/taglines',
name: $t('routes.admin.taglines.title'),
},
{
href: '/admin/team',
name: $t('routes.admin.team.title'),
},
{
href: '/admin/federation',
name: $t('routes.admin.federation.title'),
},
]}
/>
</div>
<slot />
</div>
+1 -1
View File
@@ -12,7 +12,7 @@
export let data
</script>
<Header>{$t('routes.admin.applications.title')}</Header>
<Header pageHeader>{$t('routes.admin.applications.title')}</Header>
<MultiSelect
options={[false, true]}
selected={data.unreadOnly ?? true}
+1 -1
View File
@@ -57,7 +57,7 @@
</svelte:head>
<form class="flex flex-col gap-4" on:submit|preventDefault={save}>
<Header>{$t('routes.admin.config.title')}</Header>
<Header pageHeader>{$t('routes.admin.config.title')}</Header>
{#if formData}
<TextInput bind:value={formData.name} label={$t('form.name')} />
<TextInput
+3 -2
View File
@@ -1,6 +1,7 @@
<script lang="ts">
import { profile } from '$lib/auth.js'
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import EditableList from '$lib/components/ui/list/EditableList.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
@@ -170,12 +171,12 @@
<title>{$t('routes.admin.federation.title')}</title>
</svelte:head>
<h1 class="font-bold text-2xl flex items-center justify-between">
<Header pageHeader class="font-bold text-2xl flex items-center justify-between">
{$t('routes.admin.federation.title')}
<Button color="primary" on:click={save} loading={saving} disabled={saving}>
{$t('common.save')}
</Button>
</h1>
</Header>
{#if data.site && data.federated_instances?.federated_instances?.blocked}
<FileInput preview={false} bind:files={csv}>
<Button class="w-max" slot="button">
+4 -4
View File
@@ -44,9 +44,8 @@
</script>
{#if taglines.length > 0}
<div class="flex flex-row justify-between items-center">
<Header>{$t('routes.admin.taglines.title')}</Header>
<Button
<Header pageHeader class="justify-between">
{$t('routes.admin.taglines.title')}<Button
color="primary"
on:click={save}
loading={saving}
@@ -56,7 +55,8 @@
>
{$t('common.save')}
</Button>
</div>
</Header>
<EditableList
let:action
on:action={(e) => {
+1 -1
View File
@@ -44,7 +44,7 @@
}
</script>
<Header>{$t('routes.admin.team.title')}</Header>
<Header pageHeader>{$t('routes.admin.team.title')}</Header>
{#if data.site}
<EditableList let:action on:action={(e) => removeAdmin(e.detail, false)}>
{#if data.site.admins.length <= 0}
@@ -85,7 +85,7 @@
}
</script>
<Header>Moderators</Header>
<Header pageHeader>Moderators</Header>
<EditableList
let:action
on:action={(e) => {
+9 -6
View File
@@ -27,7 +27,7 @@
<title>{$t('routes.communities')}</title>
</svelte:head>
<Header>
<Header pageHeader class="justify-between">
<span>{$t('routes.communities')}</span>
<Popover
openOnHover
@@ -55,18 +55,17 @@
</p>
</Material>
</Popover>
</Header>
<div class="flex flex-row flex-wrap gap-4 mt-4 items-center">
<Location selected={data.type} />
<Sort selected={data.sort} />
<form
on:submit|preventDefault={() => searchParam($page.url, 'q', search, 'page')}
class="flex flex-col sm:flex-row gap-2 sm:ml-auto items-center"
slot="extended"
>
<TextInput
bind:value={search}
label={$t('routes.search.query')}
aria-label={$t('routes.search.query')}
size="md"
class="flex-1"
/>
<Button
submit
@@ -79,6 +78,10 @@
<Icon src={MagnifyingGlass} size="16" mini />
</Button>
</form>
</Header>
<div class="flex flex-row flex-wrap gap-4 mt-4 items-center">
<Location selected={data.type} />
<Sort selected={data.sort} />
</div>
<ul class="flex flex-col divide-y divide-slate-200 dark:divide-zinc-800">
{#if data.communities.length == 0}
+1 -1
View File
@@ -53,7 +53,7 @@
</svelte:head>
<div class="flex flex-row gap-2">
<Header class="justify-between items-end">
<Header pageHeader class="justify-between items-end">
{$t('routes.inbox.title')}
<div class="flex items-center gap-2">
+2 -1
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import type { Instance } from 'lemmy-js-client'
@@ -9,7 +10,7 @@
export let data
</script>
<h1 class="font-bold text-3xl mb-4">Linked Instances</h1>
<Header pageHeader>Linked Instances</Header>
{#if data}
<div class="flex flex-col md:flex-row gap-4">
<div class="flex-1 w-full max-h-[42rem] h-full flex flex-col gap-2">
+1 -1
View File
@@ -12,7 +12,7 @@
<div class="flex flex-row w-full">
{#if $site}
<div class="flex flex-col flex-1 gap-4">
<Header>{$t('routes.legal.title')}</Header>
<Header pageHeader>{$t('routes.legal.title')}</Header>
<Markdown
source={$site.site_view.local_site.legal_information ??
$t('routes.legal.noLegal')}
+2 -1
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import {
DEFAULT_INSTANCE_URL,
LINKED_INSTANCE_URL,
@@ -37,7 +38,7 @@
</script>
<div class="my-auto max-w-xl mx-auto flex flex-col gap-2">
<h1 class="font-bold text-3xl">{$t('routes.resetLogin.title')}</h1>
<Header>{$t('routes.resetLogin.title')}</Header>
<p>
{$t('routes.resetLogin.description')}
</p>
+20 -18
View File
@@ -21,24 +21,26 @@
</script>
<div class="mb-4 flex flex-col gap-4">
<Header>{$t('routes.moderation.title')}</Header>
<div class="flex flex-row gap-2 flex-wrap items-center">
<Select
bind:value={data.type}
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
>
<span slot="label" class="flex items-center gap-1">
<Icon src={Funnel} size="15" mini />
{$t('filter.filter')}
</span>
<option value="all">{$t('filter.location.all')}</option>
<option value="unread">{$t('filter.unread')}</option>
</Select>
<Button href="/modlog" class="h-max ml-auto">
<Icon src={Newspaper} size="16" mini />
{$t('routes.modlog')}
</Button>
</div>
<Header pageHeader>
{$t('routes.moderation.title')}
<div class="flex flex-row gap-2 flex-wrap items-end" slot="extended">
<Select
bind:value={data.type}
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
>
<span slot="label" class="flex items-center gap-1">
<Icon src={Funnel} size="15" mini />
{$t('filter.filter')}
</span>
<option value="all">{$t('filter.location.all')}</option>
<option value="unread">{$t('filter.unread')}</option>
</Select>
<Button href="/modlog" class="h-max ml-auto">
<Icon src={Newspaper} size="16" mini />
{$t('routes.modlog')}
</Button>
</div>
</Header>
</div>
{#if data.items && data.items.length > 0}
<div class="flex flex-col gap-4">
@@ -1,5 +1,6 @@
<script lang="ts">
import { goto } from '$app/navigation'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import {
DEFAULT_INSTANCE_URL,
LINKED_INSTANCE_URL,
@@ -47,7 +48,7 @@
</script>
<div class="my-auto max-w-xl mx-auto flex flex-col gap-2">
<h1 class="font-bold text-3xl">{$t('routes.passwordChange.title')}</h1>
<Header>{$t('routes.passwordChange.title')}</Header>
<p>
{$t('routes.passwordChange.description')}
</p>
@@ -88,7 +88,7 @@
<h1 class="font-bold text-3xl">{$t('routes.profile.credentials')}</h1>
<div class="flex flex-row flex-wrap gap-8">
<div class="flex flex-col gap-2 max-w-sm w-full">
<h1 class="font-bold text-2xl">{$t('form.password')}</h1>
<Header pageHeader>{$t('form.password')}</Header>
<form
on:submit|preventDefault={changePassword}
class="max-w-sm flex flex-col gap-4"
@@ -158,7 +158,7 @@
{/if}
<form class="flex flex-col gap-4 h-full" on:submit|preventDefault={save}>
<Header>{$t('routes.profile.settings')}</Header>
<Header pageHeader>{$t('routes.profile.settings')}</Header>
{#if data.my_user?.local_user_view?.local_user && formData}
<TextInput
label={$t('form.profile.displayName')}
+4 -1
View File
@@ -4,10 +4,13 @@ import { getItemPublished } from '$lib/lemmy/item.js'
import type { SortType } from 'lemmy-js-client'
import { get } from 'svelte/store'
// disable ssr, as the server cannot be authenticated
export let ssr = false
export async function load({ params, url, fetch }) {
const my_user =
get(profile)?.user ??
(await client({ auth: get(profile)?.jwt }).getSite()).my_user
(await client({ auth: get(profile)?.jwt, func: fetch }).getSite()).my_user
return {
my_user: my_user,
+1 -1
View File
@@ -11,7 +11,7 @@
export let data
</script>
<Header>{$t('routes.profile.media.title')}</Header>
<Header pageHeader>{$t('routes.profile.media.title')}</Header>
<div class="media-grid">
{#each data.images as image (image.local_image.pictrs_delete_token)}
<div animate:flip={{ duration: 500, easing: expoInOut }}>
+1
View File
@@ -1,5 +1,6 @@
import { profile } from '$lib/auth.js'
import { client } from '$lib/lemmy.js'
import { error } from '@sveltejs/kit'
import { get } from 'svelte/store'
export async function load({ fetch, url }) {
+1 -1
View File
@@ -22,7 +22,7 @@
<title>{$t('routes.saved')}</title>
</svelte:head>
<Header>{$t('routes.saved')}</Header>
<Header pageHeader>{$t('routes.saved')}</Header>
<div
class="flex flex-col list-none my-4 divide-slate-200 dark:divide-zinc-800"
class:gap-4={$userSettings.view == 'card'}
+25 -17
View File
@@ -51,7 +51,31 @@
<title>{$t('routes.search.title')}</title>
</svelte:head>
<Header>{$t('routes.search.title')}</Header>
<Header pageHeader>
{$t('routes.search.title')}
<form
on:submit|preventDefault={() => searchParam($page.url, 'q', query, 'page')}
class="flex flex-col sm:flex-row gap-2 sm:ml-auto items-center"
slot="extended"
>
<TextInput
bind:value={query}
aria-label={$t('routes.search.query')}
size="md"
class="flex-1 rounded-lg"
/>
<Button
submit
color="secondary"
size="custom"
class="self-end"
style="width: 38px; height: 38px;"
title="Search"
>
<Icon src={MagnifyingGlass} size="16" mini />
</Button>
</form>
</Header>
<div class="flex flex-row flex-wrap items-center gap-4 mt-4">
<Select
bind:value={data.type}
@@ -68,22 +92,6 @@
<option value="Users">{$t('content.users')}</option>
</Select>
<Sort navigate bind:selected={data.sort} />
<form
on:submit|preventDefault={() => searchParam($page.url, 'q', query, 'page')}
class="flex flex-col sm:flex-row gap-2 sm:ml-auto items-center"
>
<TextInput bind:value={query} label={$t('routes.search.query')} size="md" />
<Button
submit
color="secondary"
size="custom"
class="self-end"
style="width: 38px; height: 38px;"
title="Search"
>
<Icon src={MagnifyingGlass} size="16" mini />
</Button>
</form>
<Button
slot="summary"
size="square-lg"
+1 -1
View File
@@ -80,7 +80,7 @@
</Modal>
{/if}
<Header class="text-3xl font-bold flex justify-between">
<Header pageHeader class="text-3xl font-bold flex justify-between">
{$t('settings.title')}
<div class="flex items-center">
<Button
+2 -1
View File
@@ -22,6 +22,7 @@
import { onMount } from 'svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
import { t } from '$lib/translations'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
let selectedInstance: string = ''
let validating: boolean = false
@@ -83,7 +84,7 @@
</svelte:head>
<div class="mx-auto max-w-xl flex flex-col gap-4 my-auto h-max w-full">
<h1 class="font-bold text-4xl">{$t('form.signup.title')}</h1>
<Header pageHeader>{$t('form.signup.title')}</Header>
<p>{$t('form.signup.description')}</p>
<p>
{$t('form.signup.info')}
+1 -1
View File
@@ -125,7 +125,7 @@
</span>
{#if data.site_view.local_site.registration_mode != 'Closed'}
<Header>{$t('form.signup.title')}</Header>
<Header pageHeader>{$t('form.signup.title')}</Header>
<TextInput
bind:value={email}
label={$t('form.email')}
+1 -1
View File
@@ -55,7 +55,7 @@
{/if}
<div class="flex flex-col gap-4 h-full">
<Header>Theme</Header>
<Header pageHeader>Theme</Header>
<div
class="grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4
gap-4 overflow-auto max-h-72"
-40
View File
@@ -1,40 +0,0 @@
<script lang="ts">
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/translations'
import { Heart, Icon } from 'svelte-hero-icons'
</script>
<Header class="mb-4">
{$t('routes.translators')}
</Header>
<ul class="divide-y divide-slate-200 dark:divide-zinc-900 list">
<li class="flex flex-col">
<span class="font-bold text-lg">Estonian</span>
<span>pewgar_seemsimandroid@lemmy.blahaj.zone</span>
</li>
<li class="flex flex-col">
<span class="font-bold text-lg">Finnish</span>
<span>sevonj</span>
</li>
<li class="flex flex-col">
<span class="font-bold text-lg">French</span>
<span>Blisterexe@lemmy.zip</span>
</li>
<li class="flex flex-col">
<span class="font-bold text-lg">German</span>
<span>Tmpod</span>
</li>
<li class="flex flex-col">
<span class="font-bold text-lg">Portuguese</span>
<span>poVoq</span>
</li>
</ul>
<style>
.list > *:not(:first-child) {
padding-top: 0.5rem;
}
.list > *:not(:last-child) {
padding-bottom: 0.5rem;
}
</style>