refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-27 17:48:11 +08:00
parent 396a296c0b
commit 974432a0af
14 changed files with 783 additions and 685 deletions
+3 -3
View File
@@ -32,7 +32,7 @@ export default function ChatPage() {
? null
: { key: `user_${user_id}`, mid: null, unreads: 0, id: user_id, type: "user" };
// console.log("temp uid", tmpUid);
const placeholderVisible = !channel_id && !user_id;
const placeholderVisible = channel_id == 0 && user_id == 0;
return (
<>
{channelModalVisible && (
@@ -47,8 +47,8 @@ export default function ChatPage() {
</div>
<div className={`right ${placeholderVisible ? "placeholder" : ""}`}>
{placeholderVisible && <BlankPlaceholder />}
{channel_id && <ChannelChat cid={+channel_id} />}
{user_id && <DMChat uid={+user_id} />}
{channel_id !== 0 && <ChannelChat cid={+channel_id} />}
{user_id !== 0 && <DMChat uid={+user_id} />}
</div>
</StyledWrapper>
</>