mirror of
https://github.com/spacebarchat/client.git
synced 2024-11-25 11:42:30 +01:00
fix empty list not rendering when no active channel
This commit is contained in:
parent
95411d5158
commit
ca96cb9bce
@ -10,14 +10,10 @@ const Container = styled.div`
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export function EmptyChannelList() {
|
|
||||||
return <Container></Container>;
|
|
||||||
}
|
|
||||||
|
|
||||||
function ChannelList() {
|
function ChannelList() {
|
||||||
const app = useAppStore();
|
const app = useAppStore();
|
||||||
|
|
||||||
if (!app.activeGuild || !app.activeChannel) return null;
|
if (!app.activeGuild || !app.activeChannel) return <Container />;
|
||||||
const { channels } = app.activeGuild;
|
const { channels } = app.activeGuild;
|
||||||
|
|
||||||
const rowRenderer = ({ index, key, style }: ListRowProps) => {
|
const rowRenderer = ({ index, key, style }: ListRowProps) => {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import { useAppStore } from "../stores/AppStore";
|
|
||||||
import ChannelHeader from "./ChannelHeader";
|
import ChannelHeader from "./ChannelHeader";
|
||||||
import ChannelList, { EmptyChannelList } from "./ChannelList/ChannelList";
|
import ChannelList from "./ChannelList/ChannelList";
|
||||||
import Container from "./Container";
|
import Container from "./Container";
|
||||||
import UserPanel from "./UserPanel";
|
import UserPanel from "./UserPanel";
|
||||||
|
|
||||||
@ -18,13 +17,11 @@ const Wrapper = styled(Container)`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
function ChannelSidebar() {
|
function ChannelSidebar() {
|
||||||
const app = useAppStore();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
{/* TODO: replace with dm search if no guild */}
|
{/* TODO: replace with dm search if no guild */}
|
||||||
<ChannelHeader />
|
<ChannelHeader />
|
||||||
{app.activeGuild ? <ChannelList /> : <EmptyChannelList />}
|
<ChannelList />
|
||||||
<UserPanel />
|
<UserPanel />
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user