mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Add group name next to PM recipient avatar
Also changed group icon color and did minor refactoring
This commit is contained in:
parent
38ded77e16
commit
0884cd218d
@ -16,17 +16,18 @@ createWidget("topic-header-participant", {
|
|||||||
|
|
||||||
html(attrs) {
|
html(attrs) {
|
||||||
const { user, group } = attrs;
|
const { user, group } = attrs;
|
||||||
let avatar, url;
|
let content, url;
|
||||||
|
|
||||||
if (attrs.type === "user") {
|
if (attrs.type === "user") {
|
||||||
avatar = avatarImg("tiny", {
|
content = avatarImg("tiny", {
|
||||||
template: user.avatar_template,
|
template: user.avatar_template,
|
||||||
username: user.username
|
username: user.username
|
||||||
});
|
});
|
||||||
url = user.get("path");
|
url = user.get("path");
|
||||||
} else {
|
} else {
|
||||||
avatar = iconNode("users");
|
content = [iconNode("users")];
|
||||||
url = Discourse.getURL(`/groups/${group.name}`);
|
url = Discourse.getURL(`/groups/${group.name}`);
|
||||||
|
content.push(h("span", group.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
return h(
|
return h(
|
||||||
@ -38,7 +39,7 @@ createWidget("topic-header-participant", {
|
|||||||
title: attrs.username
|
title: attrs.username
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
avatar
|
content
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -136,7 +137,7 @@ export default createWidget("header-topic-info", {
|
|||||||
participants.push(
|
participants.push(
|
||||||
this.attach("topic-header-participant", {
|
this.attach("topic-header-participant", {
|
||||||
type: "user",
|
type: "user",
|
||||||
user: user,
|
user,
|
||||||
username: user.username
|
username: user.username
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@ -150,7 +151,7 @@ export default createWidget("header-topic-info", {
|
|||||||
participants.push(
|
participants.push(
|
||||||
this.attach("topic-header-participant", {
|
this.attach("topic-header-participant", {
|
||||||
type: "group",
|
type: "group",
|
||||||
group: group,
|
group,
|
||||||
username: group.name
|
username: group.name
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -310,8 +310,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trigger-group-card {
|
.trigger-group-card {
|
||||||
line-height: 20px;
|
height: 16px;
|
||||||
margin: 0 4px;
|
margin: 0 4px;
|
||||||
|
padding: 1px 4px;
|
||||||
|
border: 1px solid $primary-low;
|
||||||
|
border-radius: 0.25em;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $primary-high;
|
||||||
|
|
||||||
|
.d-icon {
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.more-participants {
|
.more-participants {
|
||||||
|
Loading…
Reference in New Issue
Block a user