Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Switch Footer from PropTypes to flow props (#2805)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkbw authored and jasonLaster committed May 4, 2017
1 parent 74cf974 commit d3dd50e
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/components/Editor/Footer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from "react";
import { DOM as dom, PropTypes } from "react";
import React, { Component, DOM as dom } from "react";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import actions from "../../actions";
Expand All @@ -10,17 +9,32 @@ import {
getPaneCollapse
} from "../../selectors";
import Svg from "../shared/Svg";
import ImPropTypes from "react-immutable-proptypes";

import classnames from "classnames";
import { isEnabled } from "devtools-config";
import { isPretty } from "../../utils/source";
import { shouldShowFooter, shouldShowPrettyPrint } from "../../utils/editor";
import _PaneToggleButton from "../shared/Button/PaneToggle";
const PaneToggleButton = React.createFactory(_PaneToggleButton);

import type { SourceRecord, SourceTextMap } from "../../reducers/sources";

import "./Footer.css";

class SourceFooter extends Component {
props: {
selectedSource: SourceRecord,
selectSource: (string, ?Object) => any,
sourceText: SourceTextMap,
editor: any,
togglePrettyPrint: string => any,
toggleBlackBox: () => any,
recordCoverage: () => any,
togglePaneCollapse: () => any,
endPanelCollapsed: boolean,
horizontal: boolean
};

prettyPrintButton() {
const { selectedSource, sourceText, togglePrettyPrint } = this.props;
const sourceLoaded =
Expand Down Expand Up @@ -152,19 +166,6 @@ class SourceFooter extends Component {
}
}

SourceFooter.propTypes = {
selectedSource: ImPropTypes.map,
togglePrettyPrint: PropTypes.func,
toggleBlackBox: PropTypes.func,
recordCoverage: PropTypes.func,
sourceText: ImPropTypes.map,
selectSource: PropTypes.func,
editor: PropTypes.object,
endPanelCollapsed: PropTypes.bool,
togglePaneCollapse: PropTypes.func,
horizontal: PropTypes.bool
};

SourceFooter.displayName = "SourceFooter";

export default connect(
Expand Down

0 comments on commit d3dd50e

Please sign in to comment.