feat: copy notes toast (wip) and light theme tooltips

This commit is contained in:
David Ralph
2021-04-22 22:10:04 +01:00
parent 4128fbae46
commit b28614340c
15 changed files with 35 additions and 9 deletions

View File

@@ -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;
}

View File

@@ -81,5 +81,9 @@
.download {
text-decoration: underline;
cursor: pointer;
&:hover {
opacity: 0.8;
}
}
}

View File

@@ -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>
);
}

View File

@@ -36,8 +36,9 @@
textarea {
border: none;
width: 200px;
resize: none;
background: none;
width: 200px;
height: 100px;
margin: 10px;
}

View File

@@ -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 {

View File

@@ -42,7 +42,7 @@
}
}
.saveNote {
.copyNote {
@extend %settingsButton;
background-color: map-get($button-colours, 'other');

View File

@@ -360,7 +360,8 @@
}
},
"toasts": {
"quote": "Kopierte Zitate",
"quote": "Kopierte zitate",
"note": "Kopierte notizen",
"reset": "Reset successfully",
"installed": "Erfolgreich installiert",
"uninstalled": "Erfolgreich entfernt",

View File

@@ -361,6 +361,7 @@
},
"toasts": {
"quote": "Quote copied",
"note": "Notes copied",
"reset": "Reset successfully",
"installed": "Successfully installed",
"uninstalled": "Successfully removed",

View File

@@ -361,6 +361,7 @@
},
"toasts": {
"quote": "Quote copied",
"note": "Notes copied",
"reset": "Reset successfully",
"installed": "Successfully installed",
"uninstalled": "Successfully removed",

View File

@@ -361,6 +361,7 @@
},
"toasts": {
"quote": "Cita copiada",
"note": "Notes copied",
"reset": "Restablecido correctamente",
"installed": "Instalado correctamente",
"uninstalled": "Retirado correctamente",

View File

@@ -361,6 +361,7 @@
},
"toasts": {
"quote": "Citation copiée",
"note": "Remarques copiée",
"reset": "Réinitialisé avec succès",
"installed": "Installé avec succès",
"uninstalled": "Enlevé avec succès",

View File

@@ -361,6 +361,7 @@
},
"toasts": {
"quote": "Het citaat is gekopieerd",
"note": "Notes copied",
"reset": "Het herstellen is voltooid",
"installed": "De installatie is voltooid",
"uninstalled": "Het verwijderen is voltooid",

View File

@@ -361,6 +361,7 @@
},
"toasts": {
"quote": "Sitat kopiert",
"note": "Notes copied",
"reset": "Tilbakestillte vellykket",
"installed": "Installert",
"uninstalled": "Fjernet",

View File

@@ -361,6 +361,7 @@
},
"toasts": {
"quote": "Цитата скопирована!",
"note": "Notes copied",
"reset": "Сброшено!",
"installed": "Успешно установлено",
"uninstalled": "Успешно удалено",

View File

@@ -361,6 +361,7 @@
},
"toasts": {
"quote": "名言已复制",
"note": "Notes copied",
"reset": "重置成功",
"installed": "安装成功",
"uninstalled": "卸载成功",