1
0
mirror of https://github.com/spacebarchat/client.git synced 2024-11-22 10:22:30 +01:00

fix(ChannelSidebar): not displayed when no guild

This commit is contained in:
Puyodead1 2023-05-09 23:11:10 -04:00
parent 2da82a5eb7
commit 66a62614d3
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
2 changed files with 6 additions and 8 deletions

View File

@ -1,5 +1,4 @@
import styled from "styled-components";
import Guild from "../stores/objects/Guild";
import Container from "./Container";
const Wrapper = styled(Container)`
@ -13,13 +12,13 @@ const Wrapper = styled(Container)`
`;
interface Props {
guild: Guild;
text: string;
}
function ChannelHeader({ guild }: Props) {
function ChannelHeader({ text }: Props) {
return (
<Wrapper>
<span>{guild.name}</span>
<span>{text}</span>
</Wrapper>
);
}

View File

@ -22,13 +22,12 @@ function ChannelSidebar() {
guildId: string;
channelId: string;
}>();
if (!guildId) return null;
const guild = app.guilds.get(guildId);
if (!guild) return null;
const guild = guildId ? app.guilds.get(guildId) : undefined;
return (
<Wrapper>
<ChannelHeader guild={guild} />
{/* // TODO: replace with dm search if no guild */}
<ChannelHeader text={guild?.name ?? "Channel Header"} />
<ChannelList />
</Wrapper>
);