unify headers

This commit is contained in:
2026-07-07 13:50:05 +02:00
parent c4fea538f0
commit c5deca1b2c
7 changed files with 85 additions and 43 deletions
+1 -1
View File
@@ -21,7 +21,7 @@
<div class="flex w-78 overflow-hidden" class:w-screen={$isMobile}> <div class="flex w-78 overflow-hidden" class:w-screen={$isMobile}>
<Toast /> <Toast />
{#if activePage === 'main'} {#if activePage === 'main'}
<div transition:fly={{ x: -300, duration: 150 }} class="min-w-full w-full h-75 flex-1 flex flex-col"> <div transition:fly={{ x: -300, duration: 150 }} class="min-w-full w-full h-80 flex-1 flex flex-col">
<Main <Main
onSettingsOpenRequest={() => (activePage = 'settings')} onSettingsOpenRequest={() => (activePage = 'settings')}
onSiteConfigOpenRequest={() => (activePage = 'site-config')} onSiteConfigOpenRequest={() => (activePage = 'site-config')}
@@ -0,0 +1,20 @@
<script lang="ts">
import { ArrowLeft } from '@steeze-ui/heroicons';
import { Icon } from '@steeze-ui/svelte-icon';
/* types */
interface Props {
onclick: () => void;
}
/* states */
let { onclick }: Props = $props();
</script>
<button
type="button"
class="shrink-0 flex items-center justify-center w-7 h-7 rounded-md text-gray-300 hover:text-gray-100 hover:bg-gray-800/60 cursor-pointer transition-colors"
{onclick}
>
<Icon src={ArrowLeft} size="1.1rem" />
</button>
@@ -0,0 +1,35 @@
<script lang="ts">
import type { Snippet } from 'svelte';
/* types */
interface Props {
title: string;
subtitle?: string;
actionsLeft?: Snippet;
actionsRight?: Snippet;
}
/* states */
let { title, subtitle, actionsLeft, actionsRight }: Props = $props();
</script>
<div class="flex items-center gap-2 px-3 py-2.5">
{#if actionsLeft}
<div class="shrink-0 flex items-center gap-2">
{@render actionsLeft()}
</div>
{/if}
<div class="min-w-0 flex-1">
<h1 class="text-lg font-semibold text-gray-100 leading-tight truncate">{title}</h1>
{#if subtitle}
<p class="text-xs text-gray-400 leading-tight truncate" title={subtitle}>{subtitle}</p>
{/if}
</div>
{#if actionsRight}
<div class="shrink-0 flex items-center gap-2">
{@render actionsRight()}
</div>
{/if}
</div>
+14 -9
View File
@@ -1,4 +1,7 @@
<script lang="ts"> <script lang="ts">
import { Cog6Tooth } from '@steeze-ui/heroicons';
import { Icon } from '@steeze-ui/svelte-icon';
import PageHeader from '@/entrypoints/popup/components/PageHeader.svelte';
import Toggle from '@/entrypoints/popup/components/Toggle.svelte'; import Toggle from '@/entrypoints/popup/components/Toggle.svelte';
import { HostSettings } from '@/lib/settings'; import { HostSettings } from '@/lib/settings';
@@ -32,15 +35,17 @@
}); });
</script> </script>
<div class="flex justify-between items-center p-2"> <PageHeader title="stream-bypass" subtitle="v{import.meta.env.VERSION}">
<div class="flex items-baseline gap-2"> {#snippet actionsRight()}
<h1>stream-bypass</h1>
<span class="text-xs text-gray-400">v{import.meta.env.VERSION}</span>
</div>
<div class="flex items-center gap-2">
{#key allHostsDisabled} {#key allHostsDisabled}
<Toggle bind:checked={() => !allHostsDisabled, (v) => (allHostsDisabled = !v)} /> <Toggle bind:checked={() => !allHostsDisabled, (v) => (allHostsDisabled = !v)} />
{/key} {/key}
<button class="font-bold cursor-pointer" onclick={() => onSettingsClick()}>⋮</button> <button
</div> type="button"
</div> class="shrink-0 flex items-center justify-center w-7 h-7 rounded-md text-gray-300 hover:text-gray-100 hover:bg-gray-800/60 cursor-pointer transition-colors"
onclick={() => onSettingsClick()}
>
<Icon src={Cog6Tooth} size="1.1rem" />
</button>
{/snippet}
</PageHeader>
+1 -1
View File
@@ -63,7 +63,7 @@
<Notice <Notice
level="warning" level="warning"
title="Extension disabled" title="Extension disabled"
description="Configurations are still saved and take effect when extension is re-enabled." description="Configurations are still saved and take effect the when extension is re-enabled."
/> />
{:else if currentMatch} {:else if currentMatch}
<div class="flex flex-col justify-between h-full px-2"> <div class="flex flex-col justify-between h-full px-2">
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { ArrowLeft } from '@steeze-ui/heroicons'; import BackButton from '@/entrypoints/popup/components/BackButton.svelte';
import { Icon } from '@steeze-ui/svelte-icon'; import PageHeader from '@/entrypoints/popup/components/PageHeader.svelte';
/* types */ /* types */
interface Props { interface Props {
@@ -11,18 +11,8 @@
let { onBackClick }: Props = $props(); let { onBackClick }: Props = $props();
</script> </script>
<div class="flex justify-between items-center px-3 py-2.5"> <PageHeader title="Settings" subtitle="Manage hosts and integrations">
<div class="flex items-center gap-2"> {#snippet actionsLeft()}
<button <BackButton onclick={onBackClick} />
type="button" {/snippet}
class="flex items-center justify-center w-7 h-7 rounded-md text-gray-300 hover:text-gray-100 hover:bg-gray-800/60 cursor-pointer transition-colors" </PageHeader>
onclick={() => onBackClick()}
>
<Icon src={ArrowLeft} size="1.1rem" />
</button>
<div>
<h1 class="text-lg font-semibold text-gray-100 leading-tight">Settings</h1>
<p class="text-xs text-gray-400 leading-tight">Manage hosts and integrations</p>
</div>
</div>
</div>
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { ArrowLeft } from '@steeze-ui/heroicons'; import BackButton from '@/entrypoints/popup/components/BackButton.svelte';
import { Icon } from '@steeze-ui/svelte-icon'; import PageHeader from '@/entrypoints/popup/components/PageHeader.svelte';
/* types */ /* types */
interface Props { interface Props {
@@ -12,16 +12,8 @@
let { domain, onBackClick }: Props = $props(); let { domain, onBackClick }: Props = $props();
</script> </script>
<div class="flex items-center gap-2 px-3 py-2.5"> <PageHeader title="Site settings" subtitle={domain}>
<button {#snippet actionsLeft()}
type="button" <BackButton onclick={onBackClick} />
class="flex items-center justify-center w-7 h-7 rounded-md text-gray-300 hover:text-gray-100 hover:bg-gray-800/60 cursor-pointer transition-colors" {/snippet}
onclick={() => onBackClick()} </PageHeader>
>
<Icon src={ArrowLeft} size="1.1rem" />
</button>
<div class="min-w-0">
<h1 class="text-lg font-semibold text-gray-100 leading-tight">Site settings</h1>
<p class="text-xs text-gray-400 leading-tight truncate" title={domain}>{domain}</p>
</div>
</div>