fix: adapt for mobile
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { goto } from "$app/navigation";
|
||||||
import {
|
import {
|
||||||
enqueueBackfill,
|
enqueueBackfill,
|
||||||
getCurrentPresence,
|
getCurrentPresence,
|
||||||
@@ -123,6 +124,17 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<header class="chat-header">
|
<header class="chat-header">
|
||||||
|
<div class="back">
|
||||||
|
<Button
|
||||||
|
variant="translucent"
|
||||||
|
round
|
||||||
|
smaller
|
||||||
|
onclick={() => goto("/app")}
|
||||||
|
aria-label="Назад"
|
||||||
|
>
|
||||||
|
<Icon name="arrow-left" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
{#snippet children({ props })}
|
{#snippet children({ props })}
|
||||||
<button
|
<button
|
||||||
@@ -207,6 +219,15 @@
|
|||||||
background-color: var(--color-background);
|
background-color: var(--color-background);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.back {
|
||||||
|
display: none;
|
||||||
|
margin-left: -0.25rem;
|
||||||
|
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.peek {
|
.peek {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cubicOut } from "svelte/easing";
|
import { cubicOut } from "svelte/easing";
|
||||||
import { fly } from "svelte/transition";
|
import { fly } from "svelte/transition";
|
||||||
|
import { page } from "$app/state";
|
||||||
import ChatList from "$lib/components/ChatList.svelte";
|
import ChatList from "$lib/components/ChatList.svelte";
|
||||||
import FolderTabs from "$lib/components/FolderTabs.svelte";
|
import FolderTabs from "$lib/components/FolderTabs.svelte";
|
||||||
import RightColumn from "$lib/components/RightColumn.svelte";
|
import RightColumn from "$lib/components/RightColumn.svelte";
|
||||||
@@ -17,6 +18,8 @@
|
|||||||
|
|
||||||
let { children } = $props();
|
let { children } = $props();
|
||||||
|
|
||||||
|
const chatOpen = $derived(page.params.chatId != null);
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (!accounts.loaded) {
|
if (!accounts.loaded) {
|
||||||
accounts.load().catch(() => toasts.error("Failed to load accounts"));
|
accounts.load().catch(() => toasts.error("Failed to load accounts"));
|
||||||
@@ -28,7 +31,11 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="Main" class:with-right={ui.rightPanel !== null}>
|
<div
|
||||||
|
id="Main"
|
||||||
|
class:with-right={ui.rightPanel !== null}
|
||||||
|
class:chat-open={chatOpen}
|
||||||
|
>
|
||||||
<div id="LeftColumn">
|
<div id="LeftColumn">
|
||||||
{#if ui.leftView === "settings"}
|
{#if ui.leftView === "settings"}
|
||||||
<div
|
<div
|
||||||
@@ -102,6 +109,40 @@
|
|||||||
&.with-right {
|
&.with-right {
|
||||||
grid-template-columns: minmax(16rem, 26.5rem) 1fr minmax(20rem, 25rem);
|
grid-template-columns: minmax(16rem, 26.5rem) 1fr minmax(20rem, 25rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
grid-template-columns: 100%;
|
||||||
|
|
||||||
|
&.with-right {
|
||||||
|
grid-template-columns: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#LeftColumn,
|
||||||
|
#MiddleColumn,
|
||||||
|
#RightColumn {
|
||||||
|
grid-row: 1;
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#RightColumn {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MiddleColumn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.chat-open {
|
||||||
|
#LeftColumn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MiddleColumn {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#LeftColumn {
|
#LeftColumn {
|
||||||
|
|||||||
Reference in New Issue
Block a user