use hashed filename as unique tag id

This commit is contained in:
henrych4 2018-10-15 21:48:01 +08:00
parent 546f389746
commit 18d809ce66

View File

@ -56,7 +56,7 @@ class Li extends React.Component {
handleClick = (e) => { handleClick = (e) => {
e.preventDefault(); e.preventDefault();
const aTag = document.getElementById('aTag'); const aTag = document.getElementById(this.props.item.hash);
aTag.click(); aTag.click();
} }
@ -103,7 +103,7 @@ class Li extends React.Component {
return ( return (
<CopyToClipboard text={item.url} onCopy={() => this.setState({copied: true})}> <CopyToClipboard text={item.url} onCopy={() => this.setState({copied: true})}>
<li className={styles.liWrapper}> <li className={styles.liWrapper}>
<a href={item.url} target="_blank" style={{ display: 'none' }} id="aTag">nothing</a> <a href={item.url} target="_blank" style={{ display: 'none' }} id={item.hash}>nothing</a>
<div className={styles.liContainer}> <div className={styles.liContainer}>
<div> <div>
<div /> <div />