Commit 7e2ea987 authored by insert's avatar insert

Fix sidebar.

parent bfce90c5
Pipeline #277 failed with stage
in 2 minutes and 48 seconds
......@@ -3,6 +3,8 @@ import Helmet from 'react-helmet';
import styles from './Chat.module.scss';
import { SwipeableDrawer } from 'flatbase/dist';
import { useCheckWidth } from 'flatbase/dist/util';
import { HomeSidebar } from './chat/sidebar/conversation/Home';
import { GuildSidebar } from './chat/sidebar/conversation/Guild';
import Browser from './chat/sidebar/Browser';
......@@ -55,6 +57,7 @@ const Chat = memo(() => {
body = <div>you have no friends lol</div>;
}
let is900 = useCheckWidth(900);
return (
<ChatContext.Provider value={states}>
<Helmet>
......@@ -62,7 +65,7 @@ const Chat = memo(() => {
</Helmet>
<div className={styles.chat}>
<SwipeableDrawer open={drawer} onChange={setDrawer}
closeOnOpacityClick={true} variant='permanent'>
closeOnOpacityClick={true} variant={is900 ? 'permanent' : 'temporary'}>
<div className={styles.sidebar}>
<Browser />
<div className={styles.conversation}>
......
......@@ -56,7 +56,7 @@ const MessageList = memo((props: { messages: RMessage[] }) => {
<span className={styles.username}>{group[0].author.username}</span>
<time>{ moment(group[0].createdAt).calendar() }</time>
</div>
{ group.map(x => <div>x.content</div>) }
{ group.map(x => <div>{x.content}</div>) }
</div>
</div>
) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment