ProfileOverlay: remove dropdown

This commit is contained in:
Matilde Park 2021-02-11 16:14:19 -05:00
parent 8253f385e8
commit cc26384fae

View File

@ -14,7 +14,6 @@ import {
ColProps,
Icon
} from '@tlon/indigo-react';
import { Dropdown } from './Dropdown';
import { withLocalState } from '~/logic/state/local';
import { ProfileStatus } from './ProfileStatus';
@ -36,13 +35,11 @@ type ProfileOverlayProps = ColProps & {
class ProfileOverlay extends PureComponent<ProfileOverlayProps, {}> {
public popoverRef: React.Ref<typeof Col>;
public dropdownRef: React.Ref<typeof Col>;
constructor(props) {
super(props);
this.popoverRef = React.createRef();
this.dropdownRef = React.createRef();
this.onDocumentClick = this.onDocumentClick.bind(this);
}
@ -57,9 +54,9 @@ class ProfileOverlay extends PureComponent<ProfileOverlayProps, {}> {
}
onDocumentClick(event) {
const { popoverRef, dropdownRef } = this;
const { popoverRef } = this;
// Do nothing if clicking ref's element or descendent elements
if (!popoverRef.current || dropdownRef?.current?.contains(event.target) || popoverRef?.current?.contains(event.target)) {
if (!popoverRef.current || popoverRef?.current?.contains(event.target)) {
return;
}
@ -125,45 +122,6 @@ class ProfileOverlay extends PureComponent<ProfileOverlayProps, {}> {
{...rest}
>
<Row color='black' width='100%' height="3rem">
<Dropdown
dropWidth="150px"
width="auto"
alignY="top"
alignX="left"
options={
<Col
mt='4'
p='1'
backgroundColor="white"
color="washedGray"
border={1}
borderRadius={2}
borderColor="lightGray"
ref={this.dropdownRef}
boxShadow="0px 0px 0px 3px">
<Row
p={1}
color='black'
cursor='pointer'
fontSize={0}
onClick={() => history.push(`/~profile/~${ship}`)}>
View Profile
</Row>
{(!isOwn) && (
<Row
p={1}
color='black'
cursor='pointer'
fontSize={0}
onClick={() => history.push(`/~landscape/dm/${ship}`)}
>
Send Message
</Row>
)}
</Col>
}>
<Icon icon="Menu" mr='3'/>
</Dropdown>
{(!isOwn) && (
<Icon icon="Chat" size={16} onClick={() => history.push(`/~landscape/dm/${ship}`)}/>
)}