Work on channels, render content of messages.

This commit is contained in:
Paul
2021-06-20 17:31:53 +01:00
parent 89f8ab2694
commit d0b9cf9090
30 changed files with 1415 additions and 58 deletions

View File

@@ -0,0 +1,44 @@
import styled from "styled-components";
import { useParams } from "react-router-dom";
import Header from "../../components/ui/Header";
import { useRenderState } from "../../lib/renderer/Singleton";
import { useChannel, useForceUpdate, useUsers } from "../../context/revoltjs/hooks";
import { MessageArea } from "./messaging/MessageArea";
const ChannelMain = styled.div`
flex-grow: 1;
display: flex;
min-height: 0;
overflow: hidden;
flex-direction: row;
`;
const ChannelContent = styled.div`
flex-grow: 1;
display: flex;
overflow: hidden;
flex-direction: column;
`;
export default function Channel() {
const { channel: id } = useParams<{ channel: string }>();
const ctx = useForceUpdate();
const channel = useChannel(id, ctx);
if (!channel) return null;
// const view = useRenderState(id);
return (
<>
<Header placement="primary">
Channel
</Header>
<ChannelMain>
<ChannelContent>
<MessageArea id={id} />
</ChannelContent>
</ChannelMain>
</>
)
}