rm dms 4th column
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
Martti Malmi 2023-11-27 14:28:44 +02:00
parent dcd7faa3aa
commit 360ca20eba
2 changed files with 0 additions and 59 deletions

View File

@ -13,11 +13,9 @@ import DmWindow from "@/Element/Chat/DmWindow";
import { Chat, ChatType, useChatSystem } from "@/chat";
import { ChatParticipantProfile } from "@/Element/Chat/ChatParticipant";
import classNames from "classnames";
import ProfileDmActions from "@/Pages/Messages/ProfileDmActions";
import NewChatWindow from "@/Pages/Messages/NewChatWindow";
const TwoCol = 768;
const ThreeCol = 1500;
export default function MessagesPage() {
const login = useLogin();
@ -112,11 +110,6 @@ export default function MessagesPage() {
</div>
)}
{chat ? <DmWindow id={chat} /> : pageWidth >= TwoCol && <div className="flex-1"></div>}
{pageWidth >= ThreeCol && chat && (
<div className="m-4">
<ProfileDmActions id={chat} />
</div>
)}
</div>
);
}

View File

@ -1,52 +0,0 @@
import { decodeTLV, TLVEntryType } from "@snort/system";
import { useUserProfile } from "@snort/system-react";
import useModeration from "@/Hooks/useModeration";
import Avatar from "@/Element/User/Avatar";
import { getDisplayName } from "@/SnortUtils";
import Text from "@/Element/Text";
import Icon from "@/Icons/Icon";
import { FormattedMessage } from "react-intl";
import React from "react";
export default function ProfileDmActions({ id }: { id: string }) {
const authors = decodeTLV(id)
.filter(a => a.type === TLVEntryType.Author)
.map(a => a.value as string);
const pubkey = authors[0];
const profile = useUserProfile(pubkey);
const { block, unblock, isBlocked } = useModeration();
function truncAbout(s?: string) {
if ((s?.length ?? 0) > 200) {
return `${s?.slice(0, 200)}...`;
}
return s;
}
const blocked = isBlocked(pubkey);
return (
<>
<Avatar pubkey={pubkey} user={profile} size={210} />
<h2>{getDisplayName(profile, pubkey)}</h2>
<p>
<Text
id={pubkey}
content={truncAbout(profile?.about) ?? ""}
tags={[]}
creator={pubkey}
disableMedia={true}
depth={0}
/>
</p>
<div className="settings-row" onClick={() => (blocked ? unblock(pubkey) : block(pubkey))}>
<Icon name="block" />
{blocked ? (
<FormattedMessage defaultMessage="Unblock" id="nDejmx" />
) : (
<FormattedMessage defaultMessage="Block" id="Up5U7K" />
)}
</div>
</>
);
}