diff --git a/src/lib/themes.ts b/src/lib/themes.ts index d7043ad2..76d4fbf2 100644 --- a/src/lib/themes.ts +++ b/src/lib/themes.ts @@ -297,7 +297,7 @@ export const darkTheme: Theme = { textLight: colors.gray3, textInverted: colors.black, link: colors.blue3, - border: colors.black, + border: colors.gray7, borderDark: colors.gray6, icon: colors.gray4, diff --git a/src/view/com/composer/text-input/TextInput.web.tsx b/src/view/com/composer/text-input/TextInput.web.tsx index 68d0d10c..ba628a3f 100644 --- a/src/view/com/composer/text-input/TextInput.web.tsx +++ b/src/view/com/composer/text-input/TextInput.web.tsx @@ -11,6 +11,7 @@ import {Text} from '@tiptap/extension-text' import isEqual from 'lodash.isequal' import {UserAutocompleteModel} from 'state/models/discovery/user-autocomplete' import {createSuggestion} from './web/Autocomplete' +import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle' export interface TextInputRef { focus: () => void @@ -42,41 +43,54 @@ export const TextInput = React.forwardRef( TextInputProps, ref, ) => { - const editor = useEditor({ - extensions: [ - Document, - Link.configure({ - protocols: ['http', 'https'], - autolink: true, - }), - Mention.configure({ - HTMLAttributes: { - class: 'mention', + const modeClass = useColorSchemeStyle( + 'ProseMirror-light', + 'ProseMirror-dark', + ) + + const editor = useEditor( + { + extensions: [ + Document, + Link.configure({ + protocols: ['http', 'https'], + autolink: true, + }), + Mention.configure({ + HTMLAttributes: { + class: 'mention', + }, + suggestion: createSuggestion({autocompleteView}), + }), + Paragraph, + Placeholder.configure({ + placeholder, + }), + Text, + ], + editorProps: { + attributes: { + class: modeClass, }, - suggestion: createSuggestion({autocompleteView}), - }), - Paragraph, - Placeholder.configure({ - placeholder, - }), - Text, - ], - content: richtext.text.toString(), - autofocus: true, - editable: true, - injectCSS: true, - onUpdate({editor: editorProp}) { - const json = editorProp.getJSON() + }, + content: richtext.text.toString(), + autofocus: true, + editable: true, + injectCSS: true, + onUpdate({editor: editorProp}) { + const json = editorProp.getJSON() - const newRt = new RichText({text: editorJsonToText(json).trim()}) - setRichText(newRt) + const newRt = new RichText({text: editorJsonToText(json).trim()}) + setRichText(newRt) - const newSuggestedLinks = new Set(editorJsonToLinks(json)) - if (!isEqual(newSuggestedLinks, suggestedLinks)) { - onSuggestedLinksChanged(newSuggestedLinks) - } + const newSuggestedLinks = new Set(editorJsonToLinks(json)) + if (!isEqual(newSuggestedLinks, suggestedLinks)) { + onSuggestedLinksChanged(newSuggestedLinks) + } + }, }, - }) + [modeClass], + ) React.useImperativeHandle(ref, () => ({ focus: () => {}, // TODO diff --git a/src/view/com/modals/EditProfile.tsx b/src/view/com/modals/EditProfile.tsx index 4fbf7070..e6ef765a 100644 --- a/src/view/com/modals/EditProfile.tsx +++ b/src/view/com/modals/EditProfile.tsx @@ -148,7 +148,7 @@ export function Component({ Display Name Description