Fix minor UI issues with composer
This commit is contained in:
parent
3b2000a0ba
commit
4b8cb9f040
16 changed files with 172 additions and 114 deletions
|
@ -40,6 +40,8 @@ type StateType = {
|
|||
};
|
||||
|
||||
export class MainHeader extends React.Component<PropsType, StateType> {
|
||||
public containerRef: React.RefObject<HTMLDivElement> = React.createRef();
|
||||
|
||||
constructor(props: PropsType) {
|
||||
super(props);
|
||||
|
||||
|
@ -55,18 +57,14 @@ export class MainHeader extends React.Component<PropsType, StateType> {
|
|||
if (
|
||||
showingAvatarPopup &&
|
||||
popperRoot &&
|
||||
!popperRoot.contains(target as Node)
|
||||
!popperRoot.contains(target as Node) &&
|
||||
!this.containerRef.current?.contains(target as Node)
|
||||
) {
|
||||
this.hideAvatarPopup();
|
||||
}
|
||||
};
|
||||
|
||||
public showAvatarPopup = (
|
||||
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
||||
): void => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
public showAvatarPopup = (): void => {
|
||||
const popperRoot = document.createElement('div');
|
||||
document.body.appendChild(popperRoot);
|
||||
|
||||
|
@ -142,7 +140,10 @@ export class MainHeader extends React.Component<PropsType, StateType> {
|
|||
<Manager>
|
||||
<Reference>
|
||||
{({ ref }) => (
|
||||
<div className="module-main-header__avatar--container">
|
||||
<div
|
||||
className="module-main-header__avatar--container"
|
||||
ref={this.containerRef}
|
||||
>
|
||||
<Avatar
|
||||
acceptedMessageRequest
|
||||
avatarPath={avatarPath}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue