diff --git a/src/stash/StashContextMenu.jsx b/src/stash/StashContextMenu.jsx index b53e737..b4ade79 100644 --- a/src/stash/StashContextMenu.jsx +++ b/src/stash/StashContextMenu.jsx @@ -96,7 +96,15 @@ export default class StashContextMenu extends React.Component { }); this.props.fileBoxesChanged(fileBoxes); } - shareClick() {} + shareClick() { + const fileBoxes = this.props.fileBoxes; + const selectedBoxes = this.props.getSelectedBoxes(); + if (selectedBoxes.length !== 1) + return toast.error("Only one file can be selected!"); + const url = `${window.location.origin}${process.env.PUBLIC_URL}${downloadUrl}?target=${selectedBoxes[0]}`; + navigator.clipboard.writeText(url); + toast.success("Link successfully copied!"); + } styleCalc() { const estimatedHeight = 180; //px diff --git a/src/stash/Stashbar.jsx b/src/stash/Stashbar.jsx index f43dce1..8d421a1 100644 --- a/src/stash/Stashbar.jsx +++ b/src/stash/Stashbar.jsx @@ -24,7 +24,13 @@ class Stashbar extends React.Component { setSearchMode={this.setSearchMode.bind(this)} /> ); - else return ; + else + return ( + + ); } render() { diff --git a/src/stash/stashbar/StashbarMenu.jsx b/src/stash/stashbar/StashbarMenu.jsx index 3231840..af2fabf 100644 --- a/src/stash/stashbar/StashbarMenu.jsx +++ b/src/stash/stashbar/StashbarMenu.jsx @@ -11,7 +11,7 @@ class StashbarMenu extends React.Component { render() { return (
- +