Create providers directory; Markdown provider
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import React, { PropTypes } from "react"
|
||||
import OriCollapse from "react-collapse"
|
||||
import _Markdown from "react-remarkable"
|
||||
|
||||
function xclass(...args) {
|
||||
return args.filter(a => !!a).join(" ").trim()
|
||||
}
|
||||
|
||||
export const Markdown = _Markdown
|
||||
|
||||
export class Container extends React.Component {
|
||||
render() {
|
||||
let { fullscreen, full, ...rest } = this.props
|
||||
|
||||
10
src/core/components/providers/Markdown.js
Normal file
10
src/core/components/providers/Markdown.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import Remarkable from "react-remarkable"
|
||||
import React from "react"
|
||||
|
||||
|
||||
export default ({ source }) => {
|
||||
return <Remarkable
|
||||
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
|
||||
source={source}
|
||||
></Remarkable>
|
||||
}
|
||||
6
src/core/components/providers/README.md
Normal file
6
src/core/components/providers/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Providers
|
||||
|
||||
Providers are generic bridges to third-party components. They provide two benefits:
|
||||
|
||||
1. ability for plugins to override third-party components, because providers are loaded through `getComponent`
|
||||
2. allows us to avoid painting ourselves into a corner with a third-party component
|
||||
Reference in New Issue
Block a user