Created
July 25, 2019 10:51
-
-
Save yoavniran/771085beb35ac0ab4b700e7b8b2f8199 to your computer and use it in GitHub Desktop.
right-to-left markdown widget for netlify-cms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CMS from "netlify-cms-app"; | |
import RTLMarkdownWidget from "./widgets/RTLMarkdownWidget/RTLMarkdownWidget"; | |
//... | |
CMS.registerWidget(RTLMarkdownWidget.name, RTLMarkdownWidget.ControlComponent, RTLMarkdownWidget.PreviewComponent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import NetlifyCmsWidgetMarkdown from "netlify-cms-widget-markdown"; | |
const name = "rtlmarkdown"; | |
const PreviewComponent = NetlifyCmsWidgetMarkdown.previewComponent; | |
const OrgControlComponent = NetlifyCmsWidgetMarkdown.controlComponent; | |
const ControlComponent = React.forwardRef((props, ref) => { | |
return <div dir="rtl"> | |
<OrgControlComponent {...props} ref={ref} /> | |
</div>; | |
}); | |
export default { | |
name, | |
ControlComponent, | |
PreviewComponent, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment