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('Что-то пошло не так'); }