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

Switch Footer from PropTypes to flow props #2805

Merged
merged 1 commit into from
May 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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