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
+2
View File
@@ -10,6 +10,8 @@ const Styled = styled.div`
filter: drop-shadow(0px 25px 50px rgba(31, 41, 55, 0.25));
border-radius: 12px;
min-width: 486px;
max-height: 90vh;
overflow-y: scroll;
/* width: fit-content; */
> .head {
font-weight: 600;
+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>
</>