diff --git a/frontend/components/Editor/components/Heading.js b/frontend/components/Editor/components/Heading.js index 0652e59a..9aa1431f 100644 --- a/frontend/components/Editor/components/Heading.js +++ b/frontend/components/Editor/components/Heading.js @@ -32,6 +32,7 @@ const Anchor = styled.a` } `; +// $FlowIssue I don't know const titleStyles = component => styled(component)` position: relative; diff --git a/frontend/components/Markdown/Markdown.js b/frontend/components/Markdown/Markdown.js deleted file mode 100644 index 3923a63b..00000000 --- a/frontend/components/Markdown/Markdown.js +++ /dev/null @@ -1,77 +0,0 @@ -// @flow -import React from 'react'; -import { State, Document, Editor } from 'slate'; -import MarkdownSerializer from '../Editor/serializer'; -import type { State as StateType } from '../Editor/types'; -import schema from '../Editor/schema'; -import styles from '../Editor/Editor.scss'; - -type Props = { - text: string, - className: string, - limit: number, -}; - -function filterDocumentState({ state, characterLimit, nodeLimit }) { - const { document } = state; - if (document.text.length <= characterLimit) { - return state; - } - - let totalCharacters = 0; - let totalNodes = 0; - const nodes = document.nodes.filter(childNode => { - if (childNode.text.length + totalCharacters <= characterLimit) { - totalCharacters += childNode.text.length; - - if (totalNodes++ <= nodeLimit) { - return true; - } - } - return false; - }); - - return State.create({ - document: Document.create({ - ...document, - nodes: nodes, - }), - }); -} - -class Markdown extends React.Component { - props: Props; - - state: { - state: StateType, - }; - - constructor(props: Props) { - super(props); - const state = MarkdownSerializer.deserialize(props.text); - const options = { - state, - characterLimit: props.limit, - nodeLimit: 5, - }; - - this.state = { - state: filterDocumentState(options), - }; - } - - render() { - return ( - - - - ); - } -} - -export default Markdown; diff --git a/frontend/components/Markdown/index.js b/frontend/components/Markdown/index.js deleted file mode 100644 index ae494d3a..00000000 --- a/frontend/components/Markdown/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// @flow -import Markdown from './Markdown'; -export default Markdown; diff --git a/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js b/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js index 6b3c8df1..36e7dbc4 100644 --- a/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js +++ b/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js @@ -7,7 +7,7 @@ import { color } from 'styles/constants'; type Props = { id: string, - name: string, + name: ?string, secret: string, onDelete: Function, };