Flowtyping

This commit is contained in:
Tom Moor
2017-12-03 11:13:35 -08:00
parent 15e8e50601
commit 802f6e6594
23 changed files with 168 additions and 189 deletions

View File

@@ -2,11 +2,11 @@
import React, { Component } from 'react';
import ImageZoom from 'react-medium-image-zoom';
import styled from 'styled-components';
import type { props } from 'slate-prop-types';
import type { SlateNodeProps } from '../types';
import { color } from 'shared/styles/constants';
class Image extends Component {
props: props;
props: SlateNodeProps;
handleChange = (ev: SyntheticInputEvent) => {
const alt = ev.target.value;
@@ -26,11 +26,12 @@ class Image extends Component {
};
render() {
const { attributes, state, node, readOnly } = this.props;
const { attributes, editor, node, readOnly } = this.props;
const loading = node.data.get('loading');
const caption = node.data.get('alt');
const src = node.data.get('src');
const active = state.isFocused && state.selection.hasEdgeIn(node);
const active =
editor.value.isFocused && editor.value.selection.hasEdgeIn(node);
const showCaption = !readOnly || caption;
return (