mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-03 14:57:22 +03:00
Fixed problem while copying short URL
This commit is contained in:
parent
7add153d93
commit
4522443789
1 changed files with 9 additions and 13 deletions
|
@ -116,14 +116,13 @@ class RowMenu extends React.Component {
|
||||||
toggle = () => this.setState({ isOpen: ! this.state.isOpen });
|
toggle = () => this.setState({ isOpen: ! this.state.isOpen });
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const determineClass = () => {
|
const { display, shortUrl, onCopyToClipboard } = this.props;
|
||||||
const baseClass = 'short-urls-list__dropdown-toggle';
|
const baseClass = 'short-urls-list__dropdown-toggle';
|
||||||
return ! this.props.display ? `${baseClass} short-urls-list__dropdown-toggle--hidden` : baseClass;
|
const toggleClass = ! display ? `${baseClass} short-urls-list__dropdown-toggle--hidden` : baseClass;
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ButtonDropdown toggle={this.toggle} isOpen={this.state.isOpen} direction="left">
|
<ButtonDropdown toggle={this.toggle} isOpen={this.state.isOpen} direction="left">
|
||||||
<DropdownToggle color="white" size="sm" caret className={determineClass()}>
|
<DropdownToggle color="white" size="sm" caret className={toggleClass}>
|
||||||
<FontAwesomeIcon icon={menuIcon} />
|
<FontAwesomeIcon icon={menuIcon} />
|
||||||
</DropdownToggle>
|
</DropdownToggle>
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
|
@ -138,14 +137,11 @@ class RowMenu extends React.Component {
|
||||||
<FontAwesomeIcon icon={qrIcon} /> QR code
|
<FontAwesomeIcon icon={qrIcon} /> QR code
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
<DropdownItem divider />
|
<DropdownItem divider />
|
||||||
<DropdownItem>
|
<CopyToClipboard text={shortUrl} onCopy={onCopyToClipboard}>
|
||||||
<CopyToClipboard text={this.props.shortUrl} onCopy={this.props.onCopyToClipboard}>
|
<DropdownItem>
|
||||||
<span><FontAwesomeIcon icon={copyIcon} /> Copy to clipboard</span>
|
<FontAwesomeIcon icon={copyIcon} /> Copy to clipboard
|
||||||
</CopyToClipboard>
|
</DropdownItem>
|
||||||
</DropdownItem>
|
</CopyToClipboard>
|
||||||
{/*<DropdownItem tag={CopyToClipboard} text={this.props.shortUrl} onCopy={this.props.onCopyToClipboard}>*/}
|
|
||||||
{/*<span><FontAwesomeIcon icon={copyIcon} /> Copy to clipboard</span>*/}
|
|
||||||
{/*</DropdownItem>*/}
|
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</ButtonDropdown>
|
</ButtonDropdown>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue