diff options
Diffstat (limited to 'src/client/util/RTFMarkup.tsx')
-rw-r--r-- | src/client/util/RTFMarkup.tsx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/client/util/RTFMarkup.tsx b/src/client/util/RTFMarkup.tsx index 35b1579df..05fb849fd 100644 --- a/src/client/util/RTFMarkup.tsx +++ b/src/client/util/RTFMarkup.tsx @@ -6,23 +6,16 @@ import { SettingsManager } from './SettingsManager'; @observer export class RTFMarkup extends React.Component<{}> { + // eslint-disable-next-line no-use-before-define static Instance: RTFMarkup; @observable private isOpen = false; // whether the SharingManager modal is open or not - @action - public open = () => (this.isOpen = true); - - @action - public close = () => (this.isOpen = false); - constructor(props: {}) { super(props); makeObservable(this); RTFMarkup.Instance = this; } - @observable _stats: { [key: string]: any } | undefined = undefined; - /** * @returns the main interface of the SharingManager. */ @@ -30,11 +23,11 @@ export class RTFMarkup extends React.Component<{}> { return ( <div style={{ background: SettingsManager.userBackgroundColor, color: SettingsManager.userColor, textAlign: 'initial', height: '100%' }}> <p> - <b style={{ fontSize: 'larger' }}>{`(@wiki:phrase)`}</b> + <b style={{ fontSize: 'larger' }}>(@wiki:phrase)</b> {` display wikipedia page for entered text (terminate with carriage return)`} </p> <p> - <b style={{ fontSize: 'larger' }}>{`(( any text ))`}</b> + <b style={{ fontSize: 'larger' }}>(( any text ))</b> {` submit text to Chat GPT to have results appended afterward`} </p> <p> @@ -129,13 +122,23 @@ export class RTFMarkup extends React.Component<{}> { ); } + @action + public open = () => { + this.isOpen = true; + }; + + @action + public close = () => { + this.isOpen = false; + }; + render() { return ( <MainViewModal dialogueBoxStyle={{ backgroundColor: SettingsManager.userBackgroundColor, alignContent: 'normal', color: SettingsManager.userColor, padding: '16px' }} contents={this.cheatSheet} isDisplayed={this.isOpen} - interactive={true} + interactive closeOnExternalClick={this.close} /> ); |