From af2cb318c7323acff94d3b500cd7abc2d5b76929 Mon Sep 17 00:00:00 2001 From: YarikMix <43493788+YarikMix@users.noreply.github.com> Date: Wed, 8 May 2024 11:29:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5=20=D1=86=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20=D1=84=D0=BE=D1=80=D0=BC?= =?UTF-8?q?=D0=B0=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ColorPicker/ColorPicker.tsx | 59 ++++++++++++++++++- public/src/modules/stores/NotesStore.ts | 12 +--- 2 files changed, 57 insertions(+), 14 deletions(-) diff --git a/public/src/components/ColorPicker/ColorPicker.tsx b/public/src/components/ColorPicker/ColorPicker.tsx index b60d4cb9..f874898f 100644 --- a/public/src/components/ColorPicker/ColorPicker.tsx +++ b/public/src/components/ColorPicker/ColorPicker.tsx @@ -3,14 +3,12 @@ import './ColorPicker.sass'; export class ColorPicker extends ScReact.Component { handleSelectText = (item: { label: any; color: any; }) => { - document.execCommand('foreColor', false, item.color) this.props.onSel('color', item.color); this.props.handleClose(); }; handleSelectBackground = (item: { label: any; color: any; }) => { - document.execCommand('backColor', false, item.color) this.props.onSel('backgroundColor', item.color); this.props.handleClose(); @@ -31,6 +29,30 @@ export class ColorPicker extends ScReact.Component { label: 'Синий', color: 'rgb(37, 99, 235)' }, + { + label: 'Фиолетовый', + color: 'rgb(147, 51, 234)' + }, + { + label: 'Желтый', + color: 'rgb(234, 179, 8)' + }, + { + label: 'Зеленый', + color: 'rgb(0, 138, 0)' + }, + { + label: 'Оранжевый', + color: 'rgb(255, 165, 0)' + }, + { + label: 'Розовый', + color: 'rgb(186, 64, 129)' + }, + { + label: 'Серый', + color: 'rgb(168, 162, 158)' + } ], bg: [ { @@ -45,6 +67,38 @@ export class ColorPicker extends ScReact.Component { label: 'Синий', color: '#1a3d5c' }, + { + label: 'Фиолетовый', + color: '#3f2c4b' + }, + { + label: 'Желтый', + color: '#5c4b1a' + }, + { + label: 'Зеленый', + color: '#1a5c20' + }, + { + label: 'Оранжевый', + color: '#5c3a1a' + }, + { + label: 'Розовый', + color: '#5c1a3a' + }, + { + label: 'Серый', + color: '#3a3a3a' + }, + { + label: 'Синий', + color: '#1a3d5c' + }, + { + label: 'Синий', + color: '#1a3d5c' + }, ] }; @@ -55,7 +109,6 @@ export class ColorPicker extends ScReact.Component {
{data.text.map(item => (
{ - this.handleSelectText(item); }}>
diff --git a/public/src/modules/stores/NotesStore.ts b/public/src/modules/stores/NotesStore.ts index 3112fdde..87ad4c8f 100644 --- a/public/src/modules/stores/NotesStore.ts +++ b/public/src/modules/stores/NotesStore.ts @@ -217,11 +217,10 @@ class NotesStore extends BaseStore { this.ws.onMessage((event) => { let data = JSON.parse(event.data) + // if (data.username == AppUserStore.state.username) { // return // } - - console.log(data) if (data.type == "opened") { const collaborator = { @@ -367,19 +366,10 @@ class NotesStore extends BaseStore { async saveNote(data) { try { - // const data = { - // id: this.state.selectedNote.id, - // note: AppNoteStore.state.note, - // parent: this.state.selectedNote.data.parent - // - // } - const {csrf} = await AppNoteRequests.Update(data, AppUserStore.state.JWT, AppUserStore.state.csrf); AppDispatcher.dispatch(UserActions.UPDATE_CSRF, csrf); - localStorage.setItem("selectedNote", JSON.stringify(data)) - } catch { AppToasts.error('Что-то пошло не так'); }