chore: rename type to context

This commit is contained in:
zerosoul
2022-03-30 23:10:14 +08:00
parent bdc4ab2db1
commit 862b16a5d2
6 changed files with 59 additions and 37 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ export default function ChannelChat({ cid = "", dropFiles = [] }) {
)}
<Layout
to={cid}
type="channel"
context="channel"
dropFiles={dropFiles}
// ref={containerRef}
header={
@@ -124,7 +124,7 @@ export default function ChannelChat({ cid = "", dropFiles = [] }) {
})}
</div>
</div>
<Send id={cid} type="channel" name={name} />
<Send key={cid} id={cid} type="channel" name={name} />
</div>
</StyledChannelChat>
{/* {unreads != 0 && (
+7 -2
View File
@@ -26,7 +26,7 @@ export default function DMChat({ uid = "", dropFiles = [] }) {
return (
<Layout
to={uid}
type="user"
context="user"
dropFiles={dropFiles}
header={
<StyledHeader>
@@ -62,7 +62,12 @@ export default function DMChat({ uid = "", dropFiles = [] }) {
});
})}
</div>
<Send type="user" name={currUser?.name} id={currUser?.uid} />
<Send
key={currUser?.uid}
type="user"
name={currUser?.name}
id={currUser?.uid}
/>
</StyledDMChat>
</Layout>
);
+2 -2
View File
@@ -77,7 +77,7 @@ export default function Layout({
header,
contacts = null,
dropFiles = [],
type = "channel",
context = "channel",
to = null,
}) {
const messagesContainer = useRef(null);
@@ -161,7 +161,7 @@ export default function Layout({
</StyledWrapper>
{files.length !== 0 && (
<UploadModal
type={type}
context={context}
files={files}
sendTo={to}
closeModal={resetFiles}