Small sidebar fix
This commit is contained in:
@@ -12,6 +12,7 @@ import { Server, Message } from "@/types/types";
|
|||||||
import SidebarServers from "./SidebarServers";
|
import SidebarServers from "./SidebarServers";
|
||||||
import SidebarDMs from "./SidebarDMs";
|
import SidebarDMs from "./SidebarDMs";
|
||||||
import SidebarChannels from "./SidebarChannels";
|
import SidebarChannels from "./SidebarChannels";
|
||||||
|
import DMItem from "./DMItem";
|
||||||
|
|
||||||
export default function AppLayout({
|
export default function AppLayout({
|
||||||
children,
|
children,
|
||||||
@@ -70,10 +71,12 @@ export default function AppLayout({
|
|||||||
app.sidebarOpen && isMobile ? "w-5xl md:w-md" : "w-0 md:w-md"
|
app.sidebarOpen && isMobile ? "w-5xl md:w-md" : "w-0 md:w-md"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{/* Left column — servers */}
|
<div className="flex-shrink-0">
|
||||||
<SidebarServers app={app} />
|
<SidebarServers app={app} />
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Right column — DMs or server channels */}
|
<div className="flex-1 min-w-0 flex flex-col bg-sidebar">
|
||||||
|
<div className="flex-1 min-h-0">
|
||||||
{server ? (
|
{server ? (
|
||||||
<SidebarChannels server={server} />
|
<SidebarChannels server={server} />
|
||||||
) : (
|
) : (
|
||||||
@@ -81,6 +84,19 @@ export default function AppLayout({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<footer className="mt-auto pb-3 px-3">
|
||||||
|
<DMItem
|
||||||
|
name={app.profile?.display_name || "Loading.."}
|
||||||
|
id={app.profile?.id || "me"}
|
||||||
|
avatar={app.profile?.avatar_url || ""}
|
||||||
|
status="online"
|
||||||
|
app={app}
|
||||||
|
settings
|
||||||
|
/>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{app.sidebarOpen && isMobile ? (
|
{app.sidebarOpen && isMobile ? (
|
||||||
<div
|
<div
|
||||||
className="w-full h-full overflow-x-hidden"
|
className="w-full h-full overflow-x-hidden"
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export default function SidebarDMs({ app }: { app: App }) {
|
|||||||
<div className="px-3 py-2">
|
<div className="px-3 py-2">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
className="w-full justify-start gap-2 text-sm"
|
className="w-full justify-start gap-2 text-sm truncate"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const res = await axios.get("/api/profile", {
|
const res = await axios.get("/api/profile", {
|
||||||
params: { username: query },
|
params: { username: query },
|
||||||
@@ -92,17 +92,6 @@ export default function SidebarDMs({ app }: { app: App }) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
|
|
||||||
<footer className="mt-auto pb-3 px-3">
|
|
||||||
<DMItem
|
|
||||||
name={app.profile?.display_name || "Loading.."}
|
|
||||||
id={app.profile?.id || "me"}
|
|
||||||
avatar={app.profile?.avatar_url || ""}
|
|
||||||
status="online"
|
|
||||||
app={app}
|
|
||||||
settings
|
|
||||||
/>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user