0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 17:32:38 +00:00

Move copy ID to clipboard to separate button

This commit is contained in:
G.Ambatte
2024-07-25 22:11:14 +12:00
parent f82f893014
commit b068749380
2 changed files with 14 additions and 3 deletions

View File

@@ -207,23 +207,26 @@ const LockTable = createClass({
{this.state.result[this.props.resultName] &&
<>
<p>Total Reviews Waiting: {this.state.result[this.props.resultName].length}</p>
<p>Click a row to copy the Share ID to the clipboard</p>
<table className='lockTable'>
<thead>
<tr>
{this.props.propertyNames.map((name, idx)=>{
return <th key={idx}>{name}</th>;
})}
<th>clip</th>
<th>view</th>
</tr>
</thead>
<tbody>
{this.state.result[this.props.resultName].map((result, resultIdx)=>{
return <tr key={`${resultIdx}-row`} onClick={()=>{navigator.clipboard.writeText(result.shareId.toString());}}>
return <tr className='row' key={`${resultIdx}-row`}>
{this.props.propertyNames.map((name, nameIdx)=>{
return <td key={`${resultIdx}-${nameIdx}`}>
{result[name].toString()}
</td>;
})}
<td className='icon' onClick={()=>{navigator.clipboard.writeText(result.shareId.toString());}}><i className='fa-regular fa-clipboard'></i></td>
<td className='icon'><i className='fa-regular fa-circle-right'></i></td>
</tr>;
})}
</tbody>