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:
parent
2da82a5eb7
commit
66a62614d3
@ -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>
|
||||
);
|
||||
}
|
||||
|
@ -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>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user