refactor: add more TS constraints

This commit is contained in:
Tristan Yang
2022-07-04 18:15:24 +08:00
parent 8330e45674
commit ff7fe05b58
18 changed files with 48 additions and 202 deletions
+2 -2
View File
@@ -63,14 +63,14 @@ const Channel: FC<Props> = ({ interactive = true, id, compact = false, avatarSiz
});
if (!channel) return null;
const { name, members = [], is_public, avatar } = channel;
const { name, members = [], is_public, icon } = channel;
return (
<StyledWrapper
size={avatarSize}
className={`${interactive ? "interactive" : ""} ${compact ? "compact" : ""}`}
>
<div className="avatar">
<Avatar type="channel" url={avatar} name={"#"} alt="avatar" />
<Avatar type="channel" url={icon} name={"#"} alt="avatar" />
</div>
{!compact && (
<div className="name">