Add twitter link

This commit is contained in:
Luke Berndt
2021-02-23 22:02:59 -05:00
parent f17f45722e
commit 2509441121
3 changed files with 17 additions and 5 deletions

View File

@@ -21,7 +21,7 @@
// Init
wavesurfer = WaveSurfer.create({
container: document.querySelector("#waveform"),
waveColor: "#BF675F",
waveColor: "#BF938F",
progressColor: "#BF1000",
backend: "MediaElement",
mediaControls: true,

View File

@@ -1,11 +1,13 @@
import React from "react";
import {
Header,
Button,
Divider,
List,
Segment,
Statistic,
Icon
Icon,
Menu
} from "semantic-ui-react";
// ----------------------------------------------------
@@ -19,6 +21,8 @@ class CallInfo extends React.Component {
var callDate = "-";
var callTime = "-";
var talkgroupNum = "-";
var callDownload = "";
var callTweet = "";
if (this.props.call) {
const currentCall = this.props.call;
var time = new Date(currentCall.time);
@@ -33,12 +37,15 @@ class CallInfo extends React.Component {
[{source.pos}]</List.Item>);
callLength = currentCall.len;
talkgroupNum = currentCall.talkgroupNum;
callDownload = currentCall.url;
callTweet = "https://twitter.com/intent/tweet?url="+encodeURIComponent(document.location.origin+this.props.link)+"&via="+encodeURIComponent("OpenMHz");
}
return (
<Segment padded>
<div>
<Segment padded attached>
<Header as='h1'>{this.props.header}</Header>
<List bulleted horizontal link>
{srcList}
@@ -74,7 +81,12 @@ class CallInfo extends React.Component {
</List.Item>
</List>
</Segment>
<Menu attached='bottom'>
<a href={callTweet}><Menu.Item name="tweet" ><Icon name='twitter' />Tweet</Menu.Item></a>
<a href={callDownload}><Menu.Item name="download"><Icon name="download" />Download</Menu.Item></a>
<a href={this.props.link}><Menu.Item name="link"><Icon name="at" />Link</Menu.Item></a>
</Menu>
</div>
);
}
}

View File

@@ -603,7 +603,7 @@ class CallPlayer extends React.Component {
</Sidebar.Pushable>
<Rail position='right' className="desktop-only" dimmed={sidebarOpened ? "true" : "false"} >
<Sticky context={contextRef} offset={60}>
<CallInfo call={currentCall} header={callInfoHeader} />
<CallInfo call={currentCall} header={callInfoHeader} link={callLink}/>
</Sticky>
</Rail>
</Container>