mirror of
https://github.com/mue/mue.git
synced 2026-07-07 14:17:09 +02:00
feat: copy notes toast (wip) and light theme tooltips
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
|
||||
.tooltipTitle {
|
||||
width: 60px;
|
||||
background-color: #000000;
|
||||
color: #ffffff;
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
font-size: 0.6rem;
|
||||
border-radius: 6px;
|
||||
@@ -24,5 +24,10 @@
|
||||
|
||||
.tooltip:hover .tooltipTitle {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.dark .tooltip {
|
||||
background-color: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@@ -81,5 +81,9 @@
|
||||
.download {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,10 @@ import React from 'react';
|
||||
import TextareaAutosize from '@material-ui/core/TextareaAutosize';
|
||||
import CopyIcon from '@material-ui/icons/FileCopyRounded';
|
||||
import NotesIcon from '@material-ui/icons/AssignmentRounded';
|
||||
|
||||
import Pin from './Pin';
|
||||
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
export default class Notes extends React.PureComponent {
|
||||
constructor() {
|
||||
super();
|
||||
@@ -32,6 +33,12 @@ export default class Notes extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
// todo: fix this
|
||||
copy() {
|
||||
navigator.clipboard.writeText(this.state.notes);
|
||||
toast(window.language.toasts.copy);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const noteContainer = document.getElementById('noteContainer');
|
||||
|
||||
@@ -53,7 +60,7 @@ export default class Notes extends React.PureComponent {
|
||||
</div>
|
||||
<TextareaAutosize rowsMax={50} placeholder={this.language.placeholder} value={this.state.notes} onChange={this.setNotes}/>
|
||||
<button onClick={this.pin} className='pinNote'><Pin/></button>
|
||||
<button onClick={() => navigator.clipboard.writeText(this.state.notes)} className='saveNote'><CopyIcon/></button>
|
||||
<button onClick={this.copy} className='copyNote'><CopyIcon/></button>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,8 +36,9 @@
|
||||
|
||||
textarea {
|
||||
border: none;
|
||||
width: 200px;
|
||||
resize: none;
|
||||
background: none;
|
||||
width: 200px;
|
||||
height: 100px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
cursor: initial;
|
||||
user-select: none;
|
||||
padding: 20px;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 20px;
|
||||
|
||||
span {
|
||||
|
||||
Reference in New Issue
Block a user