0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 22:12:39 +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>

View File

@@ -39,8 +39,16 @@
}
.lockTable{
td:hover {
cursor: default;
.row:hover {
background-color: #ccc;
color: #000;
}
.icon {
cursor: pointer;
&:hover{
text-shadow: 0px 0px 6px black;
}
}
}