import React from 'react' import { useAsyncCallback, useOnline as useOnlineListener } from 'actionsack' import { useAPI } from './ApiContext' import { COLORS } from '../lib/constants' import Button from './Button' import Popout, { managePopout } from './Popout' import { Down as ArrowDown } from './svg/Arrows' const popoutStyle = { width: '120px', right: 8 } function ShareMenu({ isVisible, toggleVisibility, tweet, imgur }) { const api = useAPI() const online = useOnlineListener() const [onClickTweet, { loading: tweeting }] = useAsyncCallback(tweet) const [onClickImgur, { loading: imguring }] = useAsyncCallback(imgur) if (!api || !api.tweet) { return null } if (!online) { return null } return (