uiwjs / react-markdown-editor

A markdown editor with preview, implemented with React.js and TypeScript.
https://uiwjs.github.io/react-markdown-editor
MIT License
337 stars 34 forks source link

Disable full screen option #197

Closed niiixx closed 1 year ago

niiixx commented 1 year ago

Is there a way of disabling the fullscreen option on the right side? Couldn't find one.

image
jaywcjlove commented 1 year ago

https://codesandbox.io/embed/react-markdown-editor-https-github-com-uiwjs-react-markdown-editor-issues-197-fe1nm5?fontsize=14&hidenavigation=1&theme=dark

@niiixx Upgrade v5.11.0

import MarkdownEditor from "@uiw/react-markdown-editor";
import "@wcj/dark-mode";
import { useState } from "react";
import "./styles.css";

const code = `# title\n\nHello World!\n\n`;

export default function App() {
  const [markdownVal, setMarkdownVal] = useState(code);
  console.log("markdownVal:", markdownVal);
  return (
    <div>
      <dark-mode light="Light" dark="Dark"></dark-mode>
      <h3>Auto</h3>
      <div className="App">
        <MarkdownEditor
          value={markdownVal}
          toolbarsFilter={(tool) => {
            if (tool && tool.name === "fullscreen") {
              return false;
            }
            return true;
          }}
          onChange={(value) => {
            setMarkdownVal(value);
          }}
        />
      </div>
    </div>
  );
}
niiixx commented 1 year ago

Ty! 😄