2019-04-11 09:35:59 +12:00
|
|
|
import React, { memo } from 'react';
|
|
|
|
|
import Icon from './Icon';
|
2020-08-15 21:05:00 +12:00
|
|
|
import Button from './Button';
|
|
|
|
|
import { trackEvent } from './Trackable';
|
2017-02-28 16:13:27 +13:00
|
|
|
|
2020-08-15 21:05:00 +12:00
|
|
|
export default memo(({ onTrigger }) => {
|
2019-09-05 15:36:11 +12:00
|
|
|
const handleClick = (e) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
e.stopPropagation();
|
2020-08-09 21:04:07 +12:00
|
|
|
onTrigger(e);
|
2020-08-15 21:05:00 +12:00
|
|
|
|
|
|
|
|
trackEvent({
|
|
|
|
|
category: 'ContextMenu',
|
|
|
|
|
action: 'Open',
|
|
|
|
|
});
|
2019-09-05 15:36:11 +12:00
|
|
|
};
|
2017-02-28 16:13:27 +13:00
|
|
|
|
2019-09-05 15:36:11 +12:00
|
|
|
return (
|
2020-08-15 21:05:00 +12:00
|
|
|
<Button
|
|
|
|
|
className="context-menu-trigger mouse-contextable touch-contextable"
|
2020-08-09 21:04:07 +12:00
|
|
|
onClick={handleClick}
|
2020-08-15 21:05:00 +12:00
|
|
|
icon
|
2020-08-09 21:04:07 +12:00
|
|
|
>
|
2019-09-05 15:36:11 +12:00
|
|
|
<Icon name="more_horiz" />
|
2020-08-15 21:05:00 +12:00
|
|
|
</Button>
|
2019-09-05 15:36:11 +12:00
|
|
|
);
|
2019-04-11 09:35:59 +12:00
|
|
|
});
|