1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

iOS: Fixes #6318: Remove white border around Beta Editor (#6326)

This commit is contained in:
Henry Heino 2022-04-11 03:57:49 -07:00 committed by GitHub
parent 5962b0813e
commit 58bf93a112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ import Setting from '@joplin/lib/models/Setting';
import shim from '@joplin/lib/shim';
import { themeStyle } from '@joplin/lib/theme';
const React = require('react');
const { forwardRef, useImperativeHandle, useEffect, useState, useCallback, useRef } = require('react');
const { forwardRef, useImperativeHandle, useEffect, useMemo, useState, useCallback, useRef } = require('react');
const { WebView } = require('react-native-webview');
const { editorFont } = require('../global-style');
@ -183,6 +183,17 @@ function fontFamilyFromSettings() {
// return css;
// }
function useCss(themeId: number): string {
return useMemo(() => {
const theme = themeStyle(themeId);
return `
:root {
background-color: ${theme.backgroundColor};
}
`;
}, [themeId]);
}
function useHtml(css: string): string {
const [html, setHtml] = useState('');
@ -262,8 +273,8 @@ function NoteEditor(props: Props, ref: any) {
}
`;
// const css = useCss(props.themeId);
const html = useHtml('');
const css = useCss(props.themeId);
const html = useHtml(css);
useImperativeHandle(ref, () => {
return {