diff --git a/.eslintignore b/.eslintignore index a4e57ce702..f878989320 100644 --- a/.eslintignore +++ b/.eslintignore @@ -575,6 +575,7 @@ packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/expo packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportDebugReport.js packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportProfile.js packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/makeImportExportCacheDirectory.js +packages/app-mobile/components/screens/ConfigScreen/SectionDescription.js packages/app-mobile/components/screens/ConfigScreen/SectionHeader.js packages/app-mobile/components/screens/ConfigScreen/SectionSelector.js packages/app-mobile/components/screens/ConfigScreen/SettingComponent.js diff --git a/.gitignore b/.gitignore index c079946474..1fce8b43c2 100644 --- a/.gitignore +++ b/.gitignore @@ -555,6 +555,7 @@ packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/expo packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportDebugReport.js packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/exportProfile.js packages/app-mobile/components/screens/ConfigScreen/NoteExportSection/utils/makeImportExportCacheDirectory.js +packages/app-mobile/components/screens/ConfigScreen/SectionDescription.js packages/app-mobile/components/screens/ConfigScreen/SectionHeader.js packages/app-mobile/components/screens/ConfigScreen/SectionSelector.js packages/app-mobile/components/screens/ConfigScreen/SettingComponent.js diff --git a/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx b/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx index 3bb23933dc..20aa6795c8 100644 --- a/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx +++ b/packages/app-desktop/gui/ConfigScreen/ConfigScreen.tsx @@ -149,7 +149,7 @@ class ConfigScreenComponent extends React.Component { // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied public renderSectionDescription(section: any) { - const description = Setting.sectionDescription(section.name); + const description = Setting.sectionDescription(section.name, AppType.Desktop); if (!description) return null; const theme = themeStyle(this.props.themeId); diff --git a/packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.tsx b/packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.tsx index 9ac0b56dce..79e4bab9e0 100644 --- a/packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.tsx +++ b/packages/app-mobile/components/screens/ConfigScreen/ConfigScreen.tsx @@ -32,6 +32,7 @@ import PluginService, { PluginSettings } from '@joplin/lib/services/plugins/Plug import PluginStates, { getSearchText as getPluginStatesSearchText } from './plugins/PluginStates'; import PluginUploadButton, { canInstallPluginsFromFile, buttonLabel as pluginUploadButtonSearchText } from './plugins/PluginUploadButton'; import NoteImportButton, { importButtonDefaultTitle, importButtonDescription } from './NoteExportSection/NoteImportButton'; +import SectionDescription from './SectionDescription'; interface ConfigScreenState { // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied @@ -354,6 +355,15 @@ class ConfigScreenComponent extends BaseScreenComponent, + ); + } const matchesSearchQuery = (relatedText: string|string[]) => { let searchThrough; diff --git a/packages/app-mobile/components/screens/ConfigScreen/SectionDescription.tsx b/packages/app-mobile/components/screens/ConfigScreen/SectionDescription.tsx new file mode 100644 index 0000000000..1f1310381c --- /dev/null +++ b/packages/app-mobile/components/screens/ConfigScreen/SectionDescription.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import { ViewStyle } from 'react-native'; +import { Banner } from 'react-native-paper'; + +interface Props { + content: string; +} + +const style: ViewStyle = { marginBottom: 10 }; + +const SectionDescription: React.FC = props => { + return ( + + {props.content} + + ); +}; +export default SectionDescription; diff --git a/packages/lib/models/Setting.ts b/packages/lib/models/Setting.ts index 857a0fe451..52da7d7d1f 100644 --- a/packages/lib/models/Setting.ts +++ b/packages/lib/models/Setting.ts @@ -2784,9 +2784,13 @@ class Setting extends BaseModel { return name; } - public static sectionDescription(name: string) { - if (name === 'markdownPlugins') return _('These plugins enhance the Markdown renderer with additional features. Please note that, while these features might be useful, they are not standard Markdown and thus most of them will only work in Joplin. Additionally, some of them are *incompatible* with the WYSIWYG editor. If you open a note that uses one of these plugins in that editor, you will lose the plugin formatting. It is indicated below which plugins are compatible or not with the WYSIWYG editor.'); - if (name === 'general') return _('Notes and settings are stored in: %s', toSystemSlashes(this.value('profileDir'), process.platform)); + public static sectionDescription(name: string, appType: AppType) { + if (name === 'markdownPlugins' && appType === AppType.Desktop) { + return _('These plugins enhance the Markdown renderer with additional features. Please note that, while these features might be useful, they are not standard Markdown and thus most of them will only work in Joplin. Additionally, some of them are *incompatible* with the WYSIWYG editor. If you open a note that uses one of these plugins in that editor, you will lose the plugin formatting. It is indicated below which plugins are compatible or not with the WYSIWYG editor.'); + } + if (name === 'general' && appType === AppType.Desktop) { + return _('Notes and settings are stored in: %s', toSystemSlashes(this.value('profileDir'), process.platform)); + } if (this.customSections_[name] && this.customSections_[name].description) return this.customSections_[name].description;