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 // Init
wavesurfer = WaveSurfer.create({ wavesurfer = WaveSurfer.create({
container: document.querySelector("#waveform"), container: document.querySelector("#waveform"),
waveColor: "#BF675F", waveColor: "#BF938F",
progressColor: "#BF1000", progressColor: "#BF1000",
backend: "MediaElement", backend: "MediaElement",
mediaControls: true, mediaControls: true,

View File

@@ -1,11 +1,13 @@
import React from "react"; import React from "react";
import { import {
Header, Header,
Button,
Divider, Divider,
List, List,
Segment, Segment,
Statistic, Statistic,
Icon Icon,
Menu
} from "semantic-ui-react"; } from "semantic-ui-react";
// ---------------------------------------------------- // ----------------------------------------------------
@@ -19,6 +21,8 @@ class CallInfo extends React.Component {
var callDate = "-"; var callDate = "-";
var callTime = "-"; var callTime = "-";
var talkgroupNum = "-"; var talkgroupNum = "-";
var callDownload = "";
var callTweet = "";
if (this.props.call) { if (this.props.call) {
const currentCall = this.props.call; const currentCall = this.props.call;
var time = new Date(currentCall.time); var time = new Date(currentCall.time);
@@ -33,12 +37,15 @@ class CallInfo extends React.Component {
[{source.pos}]</List.Item>); [{source.pos}]</List.Item>);
callLength = currentCall.len; callLength = currentCall.len;
talkgroupNum = currentCall.talkgroupNum; talkgroupNum = currentCall.talkgroupNum;
callDownload = currentCall.url;
callTweet = "https://twitter.com/intent/tweet?url="+encodeURIComponent(document.location.origin+this.props.link)+"&via="+encodeURIComponent("OpenMHz");
} }
return ( return (
<Segment padded> <div>
<Segment padded attached>
<Header as='h1'>{this.props.header}</Header> <Header as='h1'>{this.props.header}</Header>
<List bulleted horizontal link> <List bulleted horizontal link>
{srcList} {srcList}
@@ -74,7 +81,12 @@ class CallInfo extends React.Component {
</List.Item> </List.Item>
</List> </List>
</Segment> </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> </Sidebar.Pushable>
<Rail position='right' className="desktop-only" dimmed={sidebarOpened ? "true" : "false"} > <Rail position='right' className="desktop-only" dimmed={sidebarOpened ? "true" : "false"} >
<Sticky context={contextRef} offset={60}> <Sticky context={contextRef} offset={60}>
<CallInfo call={currentCall} header={callInfoHeader} /> <CallInfo call={currentCall} header={callInfoHeader} link={callLink}/>
</Sticky> </Sticky>
</Rail> </Rail>
</Container> </Container>