From b28614340c1bc5e8fd860cd2aedeae8163645989 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Thu, 22 Apr 2021 22:10:04 +0100 Subject: [PATCH] feat: copy notes toast (wip) and light theme tooltips --- src/components/helpers/tooltip/tooltip.scss | 11 ++++++++--- .../widgets/background/scss/_photoinformation.scss | 4 ++++ src/components/widgets/navbar/Notes.jsx | 11 +++++++++-- src/components/widgets/navbar/scss/_notes.scss | 3 ++- src/components/widgets/weather/weather.scss | 2 +- src/scss/modules/_buttons.scss | 2 +- src/translations/de_DE.json | 3 ++- src/translations/en_GB.json | 1 + src/translations/en_US.json | 1 + src/translations/es.json | 1 + src/translations/fr.json | 1 + src/translations/nl.json | 1 + src/translations/no.json | 1 + src/translations/ru.json | 1 + src/translations/zh_CN.json | 1 + 15 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/components/helpers/tooltip/tooltip.scss b/src/components/helpers/tooltip/tooltip.scss index 7df9098b..92947945 100644 --- a/src/components/helpers/tooltip/tooltip.scss +++ b/src/components/helpers/tooltip/tooltip.scss @@ -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; } diff --git a/src/components/widgets/background/scss/_photoinformation.scss b/src/components/widgets/background/scss/_photoinformation.scss index 25227da8..418a150f 100644 --- a/src/components/widgets/background/scss/_photoinformation.scss +++ b/src/components/widgets/background/scss/_photoinformation.scss @@ -81,5 +81,9 @@ .download { text-decoration: underline; cursor: pointer; + + &:hover { + opacity: 0.8; + } } } diff --git a/src/components/widgets/navbar/Notes.jsx b/src/components/widgets/navbar/Notes.jsx index afe74414..1d94d6b5 100644 --- a/src/components/widgets/navbar/Notes.jsx +++ b/src/components/widgets/navbar/Notes.jsx @@ -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 { - + ); } diff --git a/src/components/widgets/navbar/scss/_notes.scss b/src/components/widgets/navbar/scss/_notes.scss index 49656481..d1aba468 100644 --- a/src/components/widgets/navbar/scss/_notes.scss +++ b/src/components/widgets/navbar/scss/_notes.scss @@ -36,8 +36,9 @@ textarea { border: none; - width: 200px; resize: none; + background: none; + width: 200px; height: 100px; margin: 10px; } diff --git a/src/components/widgets/weather/weather.scss b/src/components/widgets/weather/weather.scss index 3b87621c..62b042a8 100644 --- a/src/components/widgets/weather/weather.scss +++ b/src/components/widgets/weather/weather.scss @@ -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 { diff --git a/src/scss/modules/_buttons.scss b/src/scss/modules/_buttons.scss index b8a90027..a3c75e09 100644 --- a/src/scss/modules/_buttons.scss +++ b/src/scss/modules/_buttons.scss @@ -42,7 +42,7 @@ } } -.saveNote { +.copyNote { @extend %settingsButton; background-color: map-get($button-colours, 'other'); diff --git a/src/translations/de_DE.json b/src/translations/de_DE.json index 5947e440..471d630b 100644 --- a/src/translations/de_DE.json +++ b/src/translations/de_DE.json @@ -360,7 +360,8 @@ } }, "toasts": { - "quote": "Kopierte Zitate", + "quote": "Kopierte zitate", + "note": "Kopierte notizen", "reset": "Reset successfully", "installed": "Erfolgreich installiert", "uninstalled": "Erfolgreich entfernt", diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index 90bf0458..d0f6b11c 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -361,6 +361,7 @@ }, "toasts": { "quote": "Quote copied", + "note": "Notes copied", "reset": "Reset successfully", "installed": "Successfully installed", "uninstalled": "Successfully removed", diff --git a/src/translations/en_US.json b/src/translations/en_US.json index fb4c6aae..2bd8d929 100644 --- a/src/translations/en_US.json +++ b/src/translations/en_US.json @@ -361,6 +361,7 @@ }, "toasts": { "quote": "Quote copied", + "note": "Notes copied", "reset": "Reset successfully", "installed": "Successfully installed", "uninstalled": "Successfully removed", diff --git a/src/translations/es.json b/src/translations/es.json index 00cb9d88..ea117080 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -361,6 +361,7 @@ }, "toasts": { "quote": "Cita copiada", + "note": "Notes copied", "reset": "Restablecido correctamente", "installed": "Instalado correctamente", "uninstalled": "Retirado correctamente", diff --git a/src/translations/fr.json b/src/translations/fr.json index 5ed059b6..eb023784 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -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", diff --git a/src/translations/nl.json b/src/translations/nl.json index 1c8b61d0..e2062851 100644 --- a/src/translations/nl.json +++ b/src/translations/nl.json @@ -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", diff --git a/src/translations/no.json b/src/translations/no.json index b251d080..9e08d774 100644 --- a/src/translations/no.json +++ b/src/translations/no.json @@ -361,6 +361,7 @@ }, "toasts": { "quote": "Sitat kopiert", + "note": "Notes copied", "reset": "Tilbakestillte vellykket", "installed": "Installert", "uninstalled": "Fjernet", diff --git a/src/translations/ru.json b/src/translations/ru.json index 238696b5..08fda575 100644 --- a/src/translations/ru.json +++ b/src/translations/ru.json @@ -361,6 +361,7 @@ }, "toasts": { "quote": "Цитата скопирована!", + "note": "Notes copied", "reset": "Сброшено!", "installed": "Успешно установлено", "uninstalled": "Успешно удалено", diff --git a/src/translations/zh_CN.json b/src/translations/zh_CN.json index 7a3157b0..e3b23ff3 100644 --- a/src/translations/zh_CN.json +++ b/src/translations/zh_CN.json @@ -361,6 +361,7 @@ }, "toasts": { "quote": "名言已复制", + "note": "Notes copied", "reset": "重置成功", "installed": "安装成功", "uninstalled": "卸载成功",