mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 15:43:20 +00:00
view group chat profile (#260)
This commit is contained in:
parent
b3cee30602
commit
732d8ca303
@ -292,17 +292,23 @@ export async function* UI_Interaction_Update(args: {
|
||||
}
|
||||
model.rightPanelModel.show = true;
|
||||
} else if (event.type == "ViewUserDetail") {
|
||||
if (
|
||||
model.navigationModel.activeNav == "DM"
|
||||
) {
|
||||
if (model.dm.currentEditor) {
|
||||
if (model.dm.currentEditor) {
|
||||
const currentFocus = model.dm.focusedContent.get(model.dm.currentEditor.pubkey.hex);
|
||||
if (
|
||||
model.rightPanelModel.show == true &&
|
||||
currentFocus instanceof PublicKey &&
|
||||
currentFocus.hex == event.pubkey.hex &&
|
||||
currentFocus.hex == model.dm.currentEditor.pubkey.hex
|
||||
) {
|
||||
model.rightPanelModel.show = false;
|
||||
} else {
|
||||
model.dm.focusedContent.set(
|
||||
model.dm.currentEditor.pubkey.hex,
|
||||
event.pubkey,
|
||||
);
|
||||
model.rightPanelModel.show = true;
|
||||
}
|
||||
}
|
||||
model.rightPanelModel.show = true;
|
||||
} else if (event.type == "ViewNoteThread") {
|
||||
let root: NostrEvent = event.event;
|
||||
const tags = getTags(event.event);
|
||||
|
18
UI/dm.tsx
18
UI/dm.tsx
@ -23,6 +23,7 @@ import { ChatMessage } from "./message.ts";
|
||||
import { EditorModel } from "./editor.tsx";
|
||||
import { InviteButton } from "./invite-button.tsx";
|
||||
import { IS_BETA_VERSION } from "./config.js";
|
||||
import { UserIcon } from "./icons2/user-icon.tsx";
|
||||
|
||||
export type DM_Model = {
|
||||
currentEditor: EditorModel | undefined;
|
||||
@ -86,6 +87,23 @@ export function DirectMessageContainer(props: DirectMessageContainerProps) {
|
||||
let buttons = [];
|
||||
if (currentEditor && IS_BETA_VERSION) {
|
||||
if (props.isGroupMessage) {
|
||||
buttons.push(
|
||||
<button
|
||||
class={tw`w-8 h-8 ${CenterClass}`}
|
||||
onClick={() => {
|
||||
props.bus.emit({
|
||||
type: "ViewUserDetail",
|
||||
pubkey: currentEditor.pubkey,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<UserIcon
|
||||
class={tw`w-6 h-6 text-[${PrimaryTextColor}] stroke-current`}
|
||||
style={{ fill: "none" }}
|
||||
/>
|
||||
</button>,
|
||||
);
|
||||
|
||||
const canEditGroupProfile = props.groupChatController.getGroupAdminCtx(currentEditor.pubkey);
|
||||
if (canEditGroupProfile) {
|
||||
buttons.push(
|
||||
|
@ -274,7 +274,7 @@ export class MessageList extends Component<MessageListProps, MessageListState> {
|
||||
/>
|
||||
</button>
|
||||
<ul
|
||||
class={tw`w-full h-full overflow-y-auto overflow-x-hidden py-8 px-2 flex flex-col-reverse`}
|
||||
class={tw`w-full h-full overflow-y-auto overflow-x-hidden py-9 px-2 flex flex-col-reverse`}
|
||||
ref={this.messagesULElement}
|
||||
onScroll={this.onScroll}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user