mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
copy button needs to be just an icon
This commit is contained in:
parent
4a63057336
commit
2d63b0ab6e
1 changed files with 2 additions and 3 deletions
|
@ -22,15 +22,14 @@ interface ViewSourceModalProps {
|
|||
}
|
||||
|
||||
// TODO: change the copy button's text on copy, without having typescript scream at me.
|
||||
// will i need to make a component for the copy button and change its state? hmm
|
||||
// will i need to make a component for the copy button and change its state???
|
||||
const copyButtonOnClick = (evt: MemDBEvent) => {
|
||||
navigator.clipboard.writeText(JSON.stringify(evt, null, 4))
|
||||
}
|
||||
|
||||
// TODO check with tulir that he in fact uses material design icons. i got the copy icon from google's site
|
||||
const ViewSourceModal = ({ evt }: ViewSourceModalProps) => {
|
||||
return <div className="view-source-modal">
|
||||
<button onClick={() => {copyButtonOnClick(evt)}}><CopyIcon/> Copy</button>
|
||||
<button onClick={() => {copyButtonOnClick(evt)}}><CopyIcon/></button>
|
||||
<JSONView data={evt} />
|
||||
</div>
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue