Fixed sidebar
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ export default function App() {
|
|||||||
minSize="4rem"
|
minSize="4rem"
|
||||||
groupResizeBehavior="preserve-pixel-size"
|
groupResizeBehavior="preserve-pixel-size"
|
||||||
>
|
>
|
||||||
<div className="flex">
|
<div className="h-screen flex overflow-y-hidden">
|
||||||
<ServerList appRef={appRef} />
|
<ServerList appRef={appRef} />
|
||||||
<Sidebar appRef={appRef} />
|
<Sidebar appRef={appRef} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { openUrl } from "@tauri-apps/plugin-opener";
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { RefreshCw, Rss } from "lucide-react";
|
import { RefreshCw, Rss } from "lucide-react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
import StatusCard from "../view/StatusCard";
|
||||||
|
|
||||||
function formatTime(publishedAt: number): string {
|
function formatTime(publishedAt: number): string {
|
||||||
if (!publishedAt) return "";
|
if (!publishedAt) return "";
|
||||||
@@ -73,7 +74,9 @@ function StaticFallback() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function MainPageSidebar(_props: {
|
export default function MainPageSidebar({
|
||||||
|
appRef,
|
||||||
|
}: {
|
||||||
appRef: React.RefObject<Enclave | null>;
|
appRef: React.RefObject<Enclave | null>;
|
||||||
}) {
|
}) {
|
||||||
const [items, setItems] = useState<NewsItem[] | null>(null);
|
const [items, setItems] = useState<NewsItem[] | null>(null);
|
||||||
@@ -98,6 +101,7 @@ export default function MainPageSidebar(_props: {
|
|||||||
}, [load]);
|
}, [load]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className="h-full relative w-full @container">
|
||||||
<div className="flex h-screen w-full flex-col">
|
<div className="flex h-screen w-full flex-col">
|
||||||
<header className="flex items-center justify-between px-3 py-2.5 border-b border-b-border">
|
<header className="flex items-center justify-between px-3 py-2.5 border-b border-b-border">
|
||||||
<h1 className="text-lg font-semibold flex items-center gap-2">
|
<h1 className="text-lg font-semibold flex items-center gap-2">
|
||||||
@@ -114,7 +118,7 @@ export default function MainPageSidebar(_props: {
|
|||||||
</Button>
|
</Button>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section className="flex-1 overflow-y-scroll scrollbar-none [scrollbar-width:none] [&::-webkit-scrollbar]:hidden px-2 py-2">
|
<section className="flex-1 overflow-y-scroll scrollbar-none[&::-webkit-scrollbar]:hidden px-2 py-2 mb-28">
|
||||||
{loading && items === null && (
|
{loading && items === null && (
|
||||||
<p className="px-2 py-4 text-sm text-muted-foreground">
|
<p className="px-2 py-4 text-sm text-muted-foreground">
|
||||||
Loading news…
|
Loading news…
|
||||||
@@ -151,5 +155,8 @@ export default function MainPageSidebar(_props: {
|
|||||||
)}
|
)}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<StatusCard appRef={appRef} />
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,20 +156,20 @@ export default function ServerSidebar({
|
|||||||
appRef: React.RefObject<Enclave | null>;
|
appRef: React.RefObject<Enclave | null>;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="h-screen relative w-full @container">
|
<div className="h-full relative w-full @container">
|
||||||
{appRef.current?.server?.meta && (
|
{appRef.current?.server?.meta && (
|
||||||
<>
|
<div className="h-full">
|
||||||
<header className="px-3 pt-2.5 pb-2.5 text-lg font-semibold border-b border-b-border">
|
<header className="px-3 pt-2.5 pb-2.5 text-lg font-semibold border-b border-b-border">
|
||||||
<h1>{appRef.current.server.meta.name}</h1>
|
<h1>{appRef.current.server.meta.name}</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section className="px-1.5 pt-3.5 w-full h-full flex flex-col gap-1 overflow-y-scroll scrollbar-none [scrollbar-width:none] [&::-webkit-scrollbar]:hidden pb-55">
|
<section className="px-1.5 pt-3.5 w-full h-full flex flex-col gap-1 overflow-y-scroll scrollbar-none [&::-webkit-scrollbar]:hidden mb-28">
|
||||||
<RenderChannels
|
<RenderChannels
|
||||||
appRef={appRef}
|
appRef={appRef}
|
||||||
channels={appRef.current.server.meta.channels}
|
channels={appRef.current.server.meta.channels}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
</>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<StatusCard appRef={appRef} />
|
<StatusCard appRef={appRef} />
|
||||||
|
|||||||
Reference in New Issue
Block a user