2018-03-30 18:13:11 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import * as icons from 'constants/icons';
|
|
|
|
import Button from 'component/button';
|
|
|
|
|
|
|
|
type Props = {
|
2018-06-06 21:22:28 +02:00
|
|
|
claimId: ?string,
|
|
|
|
claimName: ?string,
|
2018-03-30 18:13:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default (props: Props) => {
|
2018-06-06 21:22:28 +02:00
|
|
|
const { claimId, claimName } = props;
|
|
|
|
const speechURL = claimName.startsWith('@')
|
|
|
|
? `${claimName}:${claimId}`
|
|
|
|
: `${claimId}/${claimName}`;
|
2018-03-30 18:13:11 +02:00
|
|
|
|
2018-06-06 21:22:28 +02:00
|
|
|
return claimId && claimName ? (
|
2018-03-30 18:13:11 +02:00
|
|
|
<Button
|
2018-06-06 21:22:28 +02:00
|
|
|
icon={icons.GLOBE}
|
2018-03-30 18:13:11 +02:00
|
|
|
button="alt"
|
2018-07-25 02:50:04 +02:00
|
|
|
label={__('Share')}
|
2018-06-06 21:22:28 +02:00
|
|
|
href={`http://spee.ch/${speechURL}`}
|
2018-03-30 18:13:11 +02:00
|
|
|
/>
|
|
|
|
) : null;
|
|
|
|
};
|