2019-05-07 04:35:04 +02:00
|
|
|
// @flow
|
|
|
|
import * as MODALS from 'constants/modal_types';
|
|
|
|
import * as ICONS from 'constants/icons';
|
|
|
|
import React from 'react';
|
|
|
|
import Button from 'component/button';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
uri: string,
|
2019-11-14 18:11:46 +01:00
|
|
|
isChannel: boolean,
|
2019-05-07 04:35:04 +02:00
|
|
|
doOpenModal: (id: string, {}) => void,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function ShareButton(props: Props) {
|
2019-11-14 18:11:46 +01:00
|
|
|
const { uri, doOpenModal, isChannel = false } = props;
|
2019-05-07 04:35:04 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Button
|
|
|
|
button="alt"
|
|
|
|
icon={ICONS.SHARE}
|
2019-09-04 06:22:31 +02:00
|
|
|
label={__('Share')}
|
2019-11-14 18:11:46 +01:00
|
|
|
onClick={() => doOpenModal(MODALS.SOCIAL_SHARE, { uri, webShareable: true, isChannel })}
|
2019-05-07 04:35:04 +02:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|