1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Chore: Mobile: Refactor note-screen-shared utility lib

This commit is contained in:
Laurent Cozic 2023-02-18 15:31:59 +00:00
parent 1139317788
commit 5c1eda3392
5 changed files with 8 additions and 8 deletions

View File

@ -32,7 +32,7 @@ import convertToScreenCoordinates from '../../../utils/convertToScreenCoordinate
import { MarkupToHtml } from '@joplin/renderer';
const { clipboard } = require('electron');
const debounce = require('debounce');
const shared = require('@joplin/lib/components/shared/note-screen-shared.js');
import shared from '@joplin/lib/components/shared/note-screen-shared';
const Menu = bridge().Menu;
const MenuItem = bridge().MenuItem;
import { reg } from '@joplin/lib/registry';

View File

@ -17,7 +17,7 @@ const urlUtils = require('@joplin/lib/urlUtils');
const ReactTooltip = require('react-tooltip');
const { urlDecode } = require('@joplin/lib/string-utils');
const { connect } = require('react-redux');
const shared = require('@joplin/lib/components/shared/note-screen-shared.js');
import shared from '@joplin/lib/components/shared/note-screen-shared';
interface Props {
themeId: number;

View File

@ -1,5 +1,5 @@
import { useCallback } from 'react';
const shared = require('@joplin/lib/components/shared/note-screen-shared');
import shared from '@joplin/lib/components/shared/note-screen-shared';
export default function useOnMessage(onCheckboxChange: Function, noteBody: string, onMarkForDownload: Function, onJoplinLinkClick: Function, onResourceLongPress: Function) {
return useCallback((event: any) => {

View File

@ -37,7 +37,7 @@ const { themeStyle, editorFont } = require('../global-style.js');
const { dialogs } = require('../../utils/dialogs.js');
const DialogBox = require('react-native-dialogbox').default;
const ImageResizer = require('react-native-image-resizer').default;
const shared = require('@joplin/lib/components/shared/note-screen-shared.js');
import shared from '@joplin/lib/components/shared/note-screen-shared';
import { ImagePickerResponse, launchImageLibrary } from 'react-native-image-picker';
import SelectDateTimeDialog from '../SelectDateTimeDialog';
import ShareExtension from '../../utils/ShareExtension.js';
@ -496,7 +496,7 @@ class NoteScreenComponent extends BaseScreenComponent {
makeSaveAction() {
return async () => {
return shared.saveNoteButton_press(this);
return shared.saveNoteButton_press(this, null, null);
};
}
@ -512,7 +512,7 @@ class NoteScreenComponent extends BaseScreenComponent {
}
async saveNoteButton_press(folderId: string = null) {
await shared.saveNoteButton_press(this, folderId);
await shared.saveNoteButton_press(this, folderId, null);
Keyboard.dismiss();
}

View File

@ -20,7 +20,7 @@ interface Shared {
isModified?: (comp: any)=> boolean;
initState?: (comp: any)=> void;
toggleIsTodo_onPress?: (comp: any)=> void;
toggleCheckboxRange?: (ipcMessage: string, noteBody: string)=> void;
toggleCheckboxRange?: (ipcMessage: string, noteBody: string)=> any;
toggleCheckbox?: (ipcMessage: string, noteBody: string)=> void;
installResourceHandling?: (refreshResourceHandler: any)=> void;
uninstallResourceHandling?: (refreshResourceHandler: any)=> void;
@ -329,4 +329,4 @@ shared.uninstallResourceHandling = function(refreshResourceHandler: any) {
DecryptionWorker.instance().off('resourceDecrypted', refreshResourceHandler);
};
module.exports = shared;
export default shared;