This file contains hidden or 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 fs from "fs"; | |
import path from "path"; | |
import { parse } from "react-docgen"; | |
import buildMarkdown from "./buildMarkdown"; | |
async function generate(options = {}) { | |
const { component: componentObject } = options; |
This file contains hidden or 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 PropTypes from "prop-types"; | |
import React from "react"; | |
import MarkdownElement from "MarkdownElement"; | |
class MarkdownPage extends React.Component { | |
static propTypes = { | |
path: PropTypes.string.isRequired, | |
req: PropTypes.func.isRequired, | |
reqSource: PropTypes.func |
This file contains hidden or 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 PropTypes from "prop-types"; | |
import React from "react"; | |
class Sandbox extends React.Component { | |
static propTypes = { | |
component: PropTypes.func.isRequired | |
}; | |
render() { | |
const { component: Component } = this.props; |
This file contains hidden or 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 PropTypes from "prop-types"; | |
import React from "react"; | |
import MarkdownElement from "src/modules/components/MarkdownElement"; | |
import Sandbox from "src/modules/components/Sandbox"; | |
class Demo extends React.Component { | |
static propTypes = { | |
demo: PropTypes.object.isRequired | |
}; |
This file contains hidden or 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 marked from "marked"; | |
import PropTypes from "prop-types"; | |
import React from "react"; | |
const renderer = new marked.Renderer(); | |
const markedOptions = { | |
gfm: true, | |
tables: true, | |
breaks: false, |
This file contains hidden or 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
version: 2 | |
jobs: | |
test: | |
docker: | |
- image: circleci/node:10.15.3 | |
- image: circleci/postgres:10.1 | |
steps: | |
# Init |
This file contains hidden or 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 get from 'lodash/get'; | |
import PropTypes from 'prop-types'; | |
import React from 'react'; | |
import { connect } from 'react-redux'; | |
/** | |
* Higher-order component that passes state and props into a predicate that | |
* checks whether the current user has permission to view the page due to paywall restrictions. | |
* | |
* If the predicate function returns true, the component is rendered. |
This file contains hidden or 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 paranoidDeleteCascade from './helpers/paranoidDeleteCascade'; | |
// Patch the paranoid delete functionality of Sequelize | |
sequelize.addHook('afterDestroy', paranoidDeleteCascade(db)); |
This file contains hidden or 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
/** | |
* Given a comment which has polymorphic associations of post and photo. | |
*/ | |
const comments = await models.Comment.findAll({ | |
include: [ | |
{ model: models.Photo }, | |
{ model: models.Post }, | |
], | |
}); |
NewerOlder