From d7401d70a78586c9e46a83ecdcd49d0169599d60 Mon Sep 17 00:00:00 2001 From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com> Date: Sat, 9 Mar 2024 03:15:13 -0800 Subject: [PATCH] Chore: Mobile: Migrate `global-style.js` to TypeScript (#10091) --- .eslintignore | 1 + .gitignore | 1 + packages/app-mobile/components/FolderPicker.tsx | 2 +- packages/app-mobile/components/ModalDialog.js | 2 +- .../components/NoteBodyViewer/hooks/useSource.ts | 2 +- .../app-mobile/components/NoteEditor/NoteEditor.tsx | 2 +- packages/app-mobile/components/NoteList.tsx | 4 ++-- .../components/ProfileSwitcher/ProfileSwitcher.tsx | 2 +- packages/app-mobile/components/ScreenHeader.tsx | 2 +- packages/app-mobile/components/app-nav.tsx | 2 +- packages/app-mobile/components/base-screen.ts | 2 +- .../components/{global-style.js => global-style.ts} | 12 ++++++------ packages/app-mobile/components/note-item.js | 2 +- .../components/screens/ConfigScreen/ConfigScreen.tsx | 2 +- .../screens/ConfigScreen/SettingComponent.tsx | 2 +- .../screens/ConfigScreen/configScreenStyles.ts | 2 +- packages/app-mobile/components/screens/LogScreen.tsx | 2 +- packages/app-mobile/components/screens/Note.tsx | 2 +- .../app-mobile/components/screens/NoteTagsDialog.js | 2 +- packages/app-mobile/components/screens/Notes.tsx | 2 +- .../components/screens/UpgradeSyncTargetScreen.tsx | 2 +- .../app-mobile/components/screens/dropbox-login.js | 2 +- .../components/screens/encryption-config.tsx | 2 +- .../app-mobile/components/screens/onedrive-login.js | 2 +- packages/app-mobile/components/screens/search.tsx | 2 +- packages/app-mobile/components/screens/status.js | 2 +- packages/app-mobile/components/screens/tags.js | 2 +- .../app-mobile/components/side-menu-content-note.js | 2 +- packages/app-mobile/components/side-menu-content.tsx | 2 +- packages/app-mobile/root.tsx | 2 +- packages/app-mobile/utils/createRootStyle.ts | 2 +- 31 files changed, 37 insertions(+), 35 deletions(-) rename packages/app-mobile/components/{global-style.js => global-style.ts} (92%) diff --git a/.eslintignore b/.eslintignore index babcb0788..6ba5f5e91 100644 --- a/.eslintignore +++ b/.eslintignore @@ -538,6 +538,7 @@ packages/app-mobile/components/biometrics/biometricAuthenticate.js packages/app-mobile/components/biometrics/sensorInfo.js packages/app-mobile/components/getResponsiveValue.test.js packages/app-mobile/components/getResponsiveValue.js +packages/app-mobile/components/global-style.js packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.js packages/app-mobile/components/screens/ConfigScreen/FileSystemPathSelector.js packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportDebugReportButton.js diff --git a/.gitignore b/.gitignore index 6a8b7a886..530ee075d 100644 --- a/.gitignore +++ b/.gitignore @@ -518,6 +518,7 @@ packages/app-mobile/components/biometrics/biometricAuthenticate.js packages/app-mobile/components/biometrics/sensorInfo.js packages/app-mobile/components/getResponsiveValue.test.js packages/app-mobile/components/getResponsiveValue.js +packages/app-mobile/components/global-style.js packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.js packages/app-mobile/components/screens/ConfigScreen/FileSystemPathSelector.js packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/ExportDebugReportButton.js diff --git a/packages/app-mobile/components/FolderPicker.tsx b/packages/app-mobile/components/FolderPicker.tsx index 4839d9d90..a93c6f2eb 100644 --- a/packages/app-mobile/components/FolderPicker.tsx +++ b/packages/app-mobile/components/FolderPicker.tsx @@ -3,7 +3,7 @@ const React = require('react'); import { FunctionComponent } from 'react'; import { _ } from '@joplin/lib/locale'; import Folder, { FolderEntityWithChildren } from '@joplin/lib/models/Folder'; -const { themeStyle } = require('./global-style.js'); +import { themeStyle } from './global-style'; import Dropdown, { DropdownListItem, OnValueChangedListener } from './Dropdown'; import { FolderEntity } from '@joplin/lib/services/database/types'; diff --git a/packages/app-mobile/components/ModalDialog.js b/packages/app-mobile/components/ModalDialog.js index 65495d30a..483515a53 100644 --- a/packages/app-mobile/components/ModalDialog.js +++ b/packages/app-mobile/components/ModalDialog.js @@ -1,6 +1,6 @@ const React = require('react'); const { Text, View, StyleSheet, Button } = require('react-native'); -const { themeStyle } = require('./global-style.js'); +const { themeStyle } = require('./global-style'); const { _ } = require('@joplin/lib/locale'); import Modal from './Modal'; diff --git a/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts b/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts index ca2b1c6be..ef6d61fdc 100644 --- a/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts +++ b/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts @@ -1,7 +1,7 @@ import { useEffect, useState, useMemo, useRef } from 'react'; import shim from '@joplin/lib/shim'; import Setting from '@joplin/lib/models/Setting'; -const { themeStyle } = require('../../global-style.js'); +import { themeStyle } from '../../global-style'; import markupLanguageUtils from '@joplin/lib/markupLanguageUtils'; import useEditPopup from './useEditPopup'; import Logger from '@joplin/utils/Logger'; diff --git a/packages/app-mobile/components/NoteEditor/NoteEditor.tsx b/packages/app-mobile/components/NoteEditor/NoteEditor.tsx index c207db87c..0c8015d1c 100644 --- a/packages/app-mobile/components/NoteEditor/NoteEditor.tsx +++ b/packages/app-mobile/components/NoteEditor/NoteEditor.tsx @@ -9,7 +9,7 @@ import * as React from 'react'; import { forwardRef, useImperativeHandle } from 'react'; import { useMemo, useState, useCallback, useRef } from 'react'; import { LayoutChangeEvent, NativeSyntheticEvent, View, ViewStyle } from 'react-native'; -const { editorFont } = require('../global-style'); +import { editorFont } from '../global-style'; import { EditorControl, EditorSettings, SelectionRange } from './types'; import { _ } from '@joplin/lib/locale'; diff --git a/packages/app-mobile/components/NoteList.tsx b/packages/app-mobile/components/NoteList.tsx index da17aa267..223ad18ce 100644 --- a/packages/app-mobile/components/NoteList.tsx +++ b/packages/app-mobile/components/NoteList.tsx @@ -9,10 +9,10 @@ import { AppState } from '../utils/types'; const { _ } = require('@joplin/lib/locale'); const { NoteItem } = require('./note-item.js'); -const { themeStyle } = require('./global-style.js'); +import { themeStyle } from './global-style'; interface NoteListProps { - themeId: string; + themeId: number; dispatch: (action: any)=> void; notesSource: string; items: NoteEntity[]; diff --git a/packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.tsx b/packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.tsx index 4aea0e3f8..ab8dc5bec 100644 --- a/packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.tsx +++ b/packages/app-mobile/components/ProfileSwitcher/ProfileSwitcher.tsx @@ -10,7 +10,7 @@ import { Alert } from 'react-native'; import { _ } from '@joplin/lib/locale'; import { deleteProfileById } from '@joplin/lib/services/profileConfig'; import { saveProfileConfig, switchProfile } from '../../services/profiles'; -const { themeStyle } = require('../global-style'); +import { themeStyle } from '../global-style'; interface Props { themeId: number; diff --git a/packages/app-mobile/components/ScreenHeader.tsx b/packages/app-mobile/components/ScreenHeader.tsx index 99662eaf0..1a0f2a896 100644 --- a/packages/app-mobile/components/ScreenHeader.tsx +++ b/packages/app-mobile/components/ScreenHeader.tsx @@ -11,7 +11,7 @@ import { _, _n } from '@joplin/lib/locale'; import Setting from '@joplin/lib/models/Setting'; import Note from '@joplin/lib/models/Note'; import Folder from '@joplin/lib/models/Folder'; -const { themeStyle } = require('./global-style.js'); +import { themeStyle } from './global-style'; import { OnValueChangedListener } from './Dropdown'; const { dialogs } = require('../utils/dialogs.js'); const DialogBox = require('react-native-dialogbox').default; diff --git a/packages/app-mobile/components/app-nav.tsx b/packages/app-mobile/components/app-nav.tsx index 85ba4c8d8..98c67e8e5 100644 --- a/packages/app-mobile/components/app-nav.tsx +++ b/packages/app-mobile/components/app-nav.tsx @@ -5,7 +5,7 @@ const { SearchScreen } = require('./screens/search.js'); import { Component } from 'react'; import { KeyboardAvoidingView, Keyboard, Platform, View, KeyboardEvent, Dimensions, EmitterSubscription } from 'react-native'; import { AppState } from '../utils/types'; -const { themeStyle } = require('./global-style.js'); +import { themeStyle } from './global-style'; interface State { autoCompletionBarExtraHeight: number; diff --git a/packages/app-mobile/components/base-screen.ts b/packages/app-mobile/components/base-screen.ts index c2b2e6e1e..86aa9d253 100644 --- a/packages/app-mobile/components/base-screen.ts +++ b/packages/app-mobile/components/base-screen.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { StyleSheet } from 'react-native'; -const { themeStyle } = require('./global-style.js'); +import { themeStyle } from './global-style'; const rootStyles_: Record = {}; diff --git a/packages/app-mobile/components/global-style.js b/packages/app-mobile/components/global-style.ts similarity index 92% rename from packages/app-mobile/components/global-style.js rename to packages/app-mobile/components/global-style.ts index c97cabaeb..4808a9611 100644 --- a/packages/app-mobile/components/global-style.js +++ b/packages/app-mobile/components/global-style.ts @@ -14,9 +14,9 @@ const baseStyle = { lineHeight: '1.6em', }; -const themeCache_ = {}; +const themeCache_: any = {}; -function addExtraStyles(style) { +function addExtraStyles(style: any) { style.marginRight = style.margin; style.marginLeft = style.margin; style.marginTop = style.margin; @@ -75,9 +75,9 @@ function addExtraStyles(style) { return style; } -function editorFont(fontId) { +function editorFont(fontId: any) { // IMPORTANT: The font mapping must match the one in Setting.js - const fonts = { + const fonts: any = { [Setting.FONT_DEFAULT]: null, [Setting.FONT_MENLO]: 'Menlo', [Setting.FONT_COURIER_NEW]: 'Courier New', @@ -91,7 +91,7 @@ function editorFont(fontId) { return fonts[fontId]; } -function themeStyle(theme) { +function themeStyle(theme: number) { if (!theme) { console.warn('Theme not set! Defaulting to Light theme.'); theme = Setting.THEME_LIGHT; @@ -105,4 +105,4 @@ function themeStyle(theme) { return themeCache_[cacheKey]; } -module.exports = { themeStyle, editorFont }; +export { themeStyle, editorFont }; diff --git a/packages/app-mobile/components/note-item.js b/packages/app-mobile/components/note-item.js index a99fd334a..b7615c98b 100644 --- a/packages/app-mobile/components/note-item.js +++ b/packages/app-mobile/components/note-item.js @@ -5,7 +5,7 @@ const { Text, TouchableOpacity, View, StyleSheet } = require('react-native'); const { Checkbox } = require('./checkbox.js'); const Note = require('@joplin/lib/models/Note').default; const time = require('@joplin/lib/time').default; -const { themeStyle } = require('./global-style.js'); +const { themeStyle } = require('./global-style'); const { _ } = require('@joplin/lib/locale'); class NoteItemComponent extends Component { diff --git a/packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.tsx b/packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.tsx index 8b41257ef..751c9bc90 100644 --- a/packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.tsx +++ b/packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.tsx @@ -13,7 +13,7 @@ import { connect } from 'react-redux'; import ScreenHeader from '../../ScreenHeader'; import { _ } from '@joplin/lib/locale'; import BaseScreenComponent from '../../base-screen'; -const { themeStyle } = require('../../global-style.js'); +import { themeStyle } from '../../global-style'; import * as shared from '@joplin/lib/components/shared/config/config-shared'; import SyncTargetRegistry from '@joplin/lib/SyncTargetRegistry'; import biometricAuthenticate from '../../biometrics/biometricAuthenticate'; diff --git a/packages/app-mobile/components/screens/ConfigScreen/SettingComponent.tsx b/packages/app-mobile/components/screens/ConfigScreen/SettingComponent.tsx index 87b381d71..64f170ba1 100644 --- a/packages/app-mobile/components/screens/ConfigScreen/SettingComponent.tsx +++ b/packages/app-mobile/components/screens/ConfigScreen/SettingComponent.tsx @@ -9,7 +9,7 @@ import Slider from '@react-native-community/slider'; import SettingsToggle from './SettingsToggle'; import FileSystemPathSelector from './FileSystemPathSelector'; import shim from '@joplin/lib/shim'; -const { themeStyle } = require('../../global-style.js'); +import { themeStyle } from '../../global-style'; interface Props { settingId: string; diff --git a/packages/app-mobile/components/screens/ConfigScreen/configScreenStyles.ts b/packages/app-mobile/components/screens/ConfigScreen/configScreenStyles.ts index a811770f2..55df0ea43 100644 --- a/packages/app-mobile/components/screens/ConfigScreen/configScreenStyles.ts +++ b/packages/app-mobile/components/screens/ConfigScreen/configScreenStyles.ts @@ -1,5 +1,5 @@ import { TextStyle, ViewStyle, StyleSheet } from 'react-native'; -const { themeStyle } = require('../../global-style.js'); +import { themeStyle } from '../../global-style'; type SidebarButtonStyle = ViewStyle & { height: number }; diff --git a/packages/app-mobile/components/screens/LogScreen.tsx b/packages/app-mobile/components/screens/LogScreen.tsx index 4788dd2e5..b0db7ce02 100644 --- a/packages/app-mobile/components/screens/LogScreen.tsx +++ b/packages/app-mobile/components/screens/LogScreen.tsx @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import { reg } from '@joplin/lib/registry.js'; import { ScreenHeader } from '../ScreenHeader'; import time from '@joplin/lib/time'; -const { themeStyle } = require('../global-style.js'); +import { themeStyle } from '../global-style'; import Logger from '@joplin/utils/Logger'; import { BaseScreenComponent } from '../base-screen'; import { _ } from '@joplin/lib/locale'; diff --git a/packages/app-mobile/components/screens/Note.tsx b/packages/app-mobile/components/screens/Note.tsx index f46908f11..030150ad9 100644 --- a/packages/app-mobile/components/screens/Note.tsx +++ b/packages/app-mobile/components/screens/Note.tsx @@ -35,7 +35,7 @@ import { _, currentLocale } from '@joplin/lib/locale'; import { reg } from '@joplin/lib/registry'; import ResourceFetcher from '@joplin/lib/services/ResourceFetcher'; import { BaseScreenComponent } from '../base-screen'; -const { themeStyle, editorFont } = require('../global-style.js'); +import { themeStyle, editorFont } from '../global-style'; const { dialogs } = require('../../utils/dialogs.js'); const DialogBox = require('react-native-dialogbox').default; import ImageResizer from '@bam.tech/react-native-image-resizer'; diff --git a/packages/app-mobile/components/screens/NoteTagsDialog.js b/packages/app-mobile/components/screens/NoteTagsDialog.js index d1bf15ffd..0078eb150 100644 --- a/packages/app-mobile/components/screens/NoteTagsDialog.js +++ b/packages/app-mobile/components/screens/NoteTagsDialog.js @@ -4,7 +4,7 @@ const { StyleSheet, View, Text, FlatList, TouchableOpacity, TextInput } = requir const { connect } = require('react-redux'); const Tag = require('@joplin/lib/models/Tag').default; const { _ } = require('@joplin/lib/locale'); -const { themeStyle } = require('../global-style.js'); +const { themeStyle } = require('../global-style'); const Icon = require('react-native-vector-icons/Ionicons').default; const ModalDialog = require('../ModalDialog'); const naturalCompare = require('string-natural-compare'); diff --git a/packages/app-mobile/components/screens/Notes.tsx b/packages/app-mobile/components/screens/Notes.tsx index ae5f705c8..e9970b3b0 100644 --- a/packages/app-mobile/components/screens/Notes.tsx +++ b/packages/app-mobile/components/screens/Notes.tsx @@ -7,7 +7,7 @@ import Folder from '@joplin/lib/models/Folder'; import Tag from '@joplin/lib/models/Tag'; import Note from '@joplin/lib/models/Note'; import Setting from '@joplin/lib/models/Setting'; -const { themeStyle } = require('../global-style.js'); +import { themeStyle } from '../global-style'; import { ScreenHeader } from '../ScreenHeader'; import { _ } from '@joplin/lib/locale'; import ActionButton from '../ActionButton'; diff --git a/packages/app-mobile/components/screens/UpgradeSyncTargetScreen.tsx b/packages/app-mobile/components/screens/UpgradeSyncTargetScreen.tsx index c2a6ab5f3..349cde906 100644 --- a/packages/app-mobile/components/screens/UpgradeSyncTargetScreen.tsx +++ b/packages/app-mobile/components/screens/UpgradeSyncTargetScreen.tsx @@ -4,7 +4,7 @@ import { _ } from '@joplin/lib/locale'; const { View, Text, ScrollView } = require('react-native'); const { connect } = require('react-redux'); -const { themeStyle } = require('../global-style.js'); +import { themeStyle } from '../global-style'; import ScreenHeader from '../ScreenHeader'; function UpgradeSyncTargetScreen(props: any) { diff --git a/packages/app-mobile/components/screens/dropbox-login.js b/packages/app-mobile/components/screens/dropbox-login.js index 1d744a8fd..ed8cd1138 100644 --- a/packages/app-mobile/components/screens/dropbox-login.js +++ b/packages/app-mobile/components/screens/dropbox-login.js @@ -8,7 +8,7 @@ const { BaseScreenComponent } = require('../base-screen'); const DialogBox = require('react-native-dialogbox').default; const { dialogs } = require('../../utils/dialogs.js'); const Shared = require('@joplin/lib/components/shared/dropbox-login-shared'); -const { themeStyle } = require('../global-style.js'); +const { themeStyle } = require('../global-style'); class DropboxLoginScreenComponent extends BaseScreenComponent { constructor() { diff --git a/packages/app-mobile/components/screens/encryption-config.tsx b/packages/app-mobile/components/screens/encryption-config.tsx index 02fd9b17d..d64a38821 100644 --- a/packages/app-mobile/components/screens/encryption-config.tsx +++ b/packages/app-mobile/components/screens/encryption-config.tsx @@ -2,7 +2,7 @@ const React = require('react'); const { TextInput, TouchableOpacity, Linking, View, StyleSheet, Text, Button, ScrollView } = require('react-native'); const { connect } = require('react-redux'); import ScreenHeader from '../ScreenHeader'; -const { themeStyle } = require('../global-style.js'); +import { themeStyle } from '../global-style'; const DialogBox = require('react-native-dialogbox').default; const { dialogs } = require('../../utils/dialogs.js'); import EncryptionService from '@joplin/lib/services/e2ee/EncryptionService'; diff --git a/packages/app-mobile/components/screens/onedrive-login.js b/packages/app-mobile/components/screens/onedrive-login.js index 2acb29f8f..ad96f5815 100644 --- a/packages/app-mobile/components/screens/onedrive-login.js +++ b/packages/app-mobile/components/screens/onedrive-login.js @@ -9,7 +9,7 @@ const { reg } = require('@joplin/lib/registry.js'); const { _ } = require('@joplin/lib/locale'); const { BaseScreenComponent } = require('../base-screen'); const parseUri = require('@joplin/lib/parseUri'); -const { themeStyle } = require('../global-style.js'); +const { themeStyle } = require('../global-style'); const shim = require('@joplin/lib/shim').default; class OneDriveLoginScreenComponent extends BaseScreenComponent { diff --git a/packages/app-mobile/components/screens/search.tsx b/packages/app-mobile/components/screens/search.tsx index dc0fdcebd..5bcaec1f9 100644 --- a/packages/app-mobile/components/screens/search.tsx +++ b/packages/app-mobile/components/screens/search.tsx @@ -8,7 +8,7 @@ import { _ } from '@joplin/lib/locale'; import Note from '@joplin/lib/models/Note'; const { NoteItem } = require('../note-item.js'); const { BaseScreenComponent } = require('../base-screen'); -const { themeStyle } = require('../global-style.js'); +import { themeStyle } from '../global-style'; const DialogBox = require('react-native-dialogbox').default; import SearchEngineUtils from '@joplin/lib/services/search/SearchEngineUtils'; import SearchEngine from '@joplin/lib/services/search/SearchEngine'; diff --git a/packages/app-mobile/components/screens/status.js b/packages/app-mobile/components/screens/status.js index 68a107700..5bc7d849e 100644 --- a/packages/app-mobile/components/screens/status.js +++ b/packages/app-mobile/components/screens/status.js @@ -7,7 +7,7 @@ const { ScreenHeader } = require('../ScreenHeader'); const ReportService = require('@joplin/lib/services/ReportService').default; const { _ } = require('@joplin/lib/locale'); const { BaseScreenComponent } = require('../base-screen'); -const { themeStyle } = require('../global-style.js'); +const { themeStyle } = require('../global-style'); class StatusScreenComponent extends BaseScreenComponent { static navigationOptions() { diff --git a/packages/app-mobile/components/screens/tags.js b/packages/app-mobile/components/screens/tags.js index d5efdc4cf..d3550daa5 100644 --- a/packages/app-mobile/components/screens/tags.js +++ b/packages/app-mobile/components/screens/tags.js @@ -3,7 +3,7 @@ const React = require('react'); const { View, Text, FlatList, StyleSheet, TouchableOpacity } = require('react-native'); const { connect } = require('react-redux'); const Tag = require('@joplin/lib/models/Tag').default; -const { themeStyle } = require('../global-style.js'); +const { themeStyle } = require('../global-style'); const { ScreenHeader } = require('../ScreenHeader'); const { _ } = require('@joplin/lib/locale'); const { BaseScreenComponent } = require('../base-screen'); diff --git a/packages/app-mobile/components/side-menu-content-note.js b/packages/app-mobile/components/side-menu-content-note.js index 60d60d91e..7ed700756 100644 --- a/packages/app-mobile/components/side-menu-content-note.js +++ b/packages/app-mobile/components/side-menu-content-note.js @@ -3,7 +3,7 @@ const Component = React.Component; const { TouchableOpacity, Text, StyleSheet, ScrollView, View } = require('react-native'); const { connect } = require('react-redux'); const Icon = require('react-native-vector-icons/Ionicons').default; -const { themeStyle } = require('./global-style.js'); +const { themeStyle } = require('./global-style'); // We need this to suppress the useless warning // https://github.com/oblador/react-native-vector-icons/issues/1465 diff --git a/packages/app-mobile/components/side-menu-content.tsx b/packages/app-mobile/components/side-menu-content.tsx index e937da150..0a89c7a3c 100644 --- a/packages/app-mobile/components/side-menu-content.tsx +++ b/packages/app-mobile/components/side-menu-content.tsx @@ -7,7 +7,7 @@ import Folder from '@joplin/lib/models/Folder'; import Synchronizer from '@joplin/lib/Synchronizer'; import NavService from '@joplin/lib/services/NavService'; import { _ } from '@joplin/lib/locale'; -const { themeStyle } = require('./global-style.js'); +import { themeStyle } from './global-style'; import { renderFolders } from '@joplin/lib/components/shared/side-menu-shared'; import { FolderEntity, FolderIcon, FolderIconType } from '@joplin/lib/services/database/types'; import { AppState } from '../utils/types'; diff --git a/packages/app-mobile/root.tsx b/packages/app-mobile/root.tsx index d89ddfcb6..b6e458f40 100644 --- a/packages/app-mobile/root.tsx +++ b/packages/app-mobile/root.tsx @@ -76,7 +76,7 @@ const { FileApiDriverLocal } = require('@joplin/lib/file-api-driver-local'); import ResourceFetcher from '@joplin/lib/services/ResourceFetcher'; import SearchEngine from '@joplin/lib/services/search/SearchEngine'; import WelcomeUtils from '@joplin/lib/WelcomeUtils'; -const { themeStyle } = require('./components/global-style.js'); +import { themeStyle } from './components/global-style'; import SyncTargetRegistry from '@joplin/lib/SyncTargetRegistry'; const SyncTargetFilesystem = require('@joplin/lib/SyncTargetFilesystem.js'); const SyncTargetNextcloud = require('@joplin/lib/SyncTargetNextcloud.js'); diff --git a/packages/app-mobile/utils/createRootStyle.ts b/packages/app-mobile/utils/createRootStyle.ts index 61122d7c3..adbc51229 100644 --- a/packages/app-mobile/utils/createRootStyle.ts +++ b/packages/app-mobile/utils/createRootStyle.ts @@ -1,4 +1,4 @@ -const { themeStyle } = require('../components/global-style'); +import { themeStyle } from '../components/global-style'; export default (themeId: number) => { const theme = themeStyle(themeId);