lbry-desktop/src/renderer/component/viewOnWebButton/view.jsx

26 lines
547 B
React
Raw Normal View History

// @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,
};
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-06-06 21:22:28 +02:00
return claimId && claimName ? (
<Button
2018-06-06 21:22:28 +02:00
icon={icons.GLOBE}
button="alt"
label={__('Share')}
2018-06-06 21:22:28 +02:00
href={`http://spee.ch/${speechURL}`}
/>
) : null;
};