Example #1
0
var StackRow = function StackRow(_ref2) {
  var frame = _ref2.frame;

  var Text = require('Text');
  var TouchableHighlight = require('TouchableHighlight');
  var file = frame.file,
      lineNumber = frame.lineNumber;

  var fileParts = file.split('/');
  var fileName = fileParts[fileParts.length - 1];

  return React.createElement(
    TouchableHighlight,
    {
      activeOpacity: 0.5,
      style: styles.openInEditorButton,
      underlayColor: 'transparent',
      onPress: openFileInEditor.bind(null, file, lineNumber), __source: {
        fileName: _jsxFileName,
        lineNumber: 198
      }
    },
    React.createElement(
      Text,
      { style: styles.inspectorCountText, __source: {
          fileName: _jsxFileName,
          lineNumber: 203
        }
      },
      fileName,
      ':',
      lineNumber
    )
  );
};
 render() {
   const style = flattenStyle(this.props.style);
   // $FlowFixMe found when converting React.createClass to ES6
   const selection = this.props.selection;
   let openFileButton;
   const source = this.props.source;
   const {fileName, lineNumber} = source || {};
   if (fileName && lineNumber) {
     const parts = fileName.split('/');
     const fileNameShort = parts[parts.length - 1];
     openFileButton = (
       <TouchableHighlight
         style={styles.openButton}
         onPress={openFileInEditor.bind(null, fileName, lineNumber)}>
         <Text style={styles.openButtonTitle} numberOfLines={1}>
           {fileNameShort}:{lineNumber}
         </Text>
       </TouchableHighlight>
     );
   }
   // Without the `TouchableWithoutFeedback`, taps on this inspector pane
   // would change the inspected element to whatever is under the inspector
   return (
     <TouchableWithoutFeedback>
       <View style={styles.info}>
         <View style={styles.breadcrumb}>
           {mapWithSeparator(
             this.props.hierarchy,
             (item, i) => (
               <TouchableHighlight
                 key={'item-' + i}
                 style={[styles.breadItem, i === selection && styles.selected]}
                 // $FlowFixMe found when converting React.createClass to ES6
                 onPress={() => this.props.setSelection(i)}>
                 <Text style={styles.breadItemText}>
                   {getInstanceName(item)}
                 </Text>
               </TouchableHighlight>
             ),
             (i) => (
               <Text key={'sep-' + i} style={styles.breadSep}>
                 &#9656;
               </Text>
             )
           )}
         </View>
         <View style={styles.row}>
           <View style={styles.col}>
             <StyleInspector style={style} />
             {openFileButton}
           </View>
           {
             // $FlowFixMe found when converting React.createClass to ES6
           <BoxInspector style={style} frame={this.props.frame} />}
         </View>
       </View>
     </TouchableWithoutFeedback>
   );
 }
Example #3
0
const StackRow = ({frame}: StackRowProps) => {
  const Text = require('Text');
  const TouchableHighlight = require('TouchableHighlight');
  const {file, lineNumber} = frame;
  const fileParts = file.split('/');
  const fileName = fileParts[fileParts.length - 1];

  return (
    <TouchableHighlight
      activeOpacity={0.5}
      style={styles.openInEditorButton}
      underlayColor="transparent"
      onPress={openFileInEditor.bind(null, file, lineNumber)}>
      <Text style={styles.inspectorCountText}>
        {fileName}:{lineNumber}
      </Text>
    </TouchableHighlight>
  );
};
    value: function render() {
      var _this2 = this;

      var style = flattenStyle(this.props.style);

      var selection = this.props.selection;
      var openFileButton = void 0;
      var source = this.props.source;

      var _ref = source || {},
          fileName = _ref.fileName,
          lineNumber = _ref.lineNumber;

      if (fileName && lineNumber) {
        var parts = fileName.split('/');
        var fileNameShort = parts[parts.length - 1];
        openFileButton = React.createElement(
          TouchableHighlight,
          {
            style: styles.openButton,
            onPress: openFileInEditor.bind(null, fileName, lineNumber), __source: {
              fileName: _jsxFileName,
              lineNumber: 63
            }
          },
          React.createElement(
            Text,
            { style: styles.openButtonTitle, numberOfLines: 1, __source: {
                fileName: _jsxFileName,
                lineNumber: 66
              }
            },
            fileNameShort,
            ':',
            lineNumber
          )
        );
      }

      return React.createElement(
        TouchableWithoutFeedback,
        {
          __source: {
            fileName: _jsxFileName,
            lineNumber: 75
          }
        },
        React.createElement(
          View,
          { style: styles.info, __source: {
              fileName: _jsxFileName,
              lineNumber: 76
            }
          },
          React.createElement(
            View,
            { style: styles.breadcrumb, __source: {
                fileName: _jsxFileName,
                lineNumber: 77
              }
            },
            mapWithSeparator(this.props.hierarchy, function (item, i) {
              return React.createElement(
                TouchableHighlight,
                {
                  key: 'item-' + i,
                  style: [styles.breadItem, i === selection && styles.selected],

                  onPress: function onPress() {
                    return _this2.props.setSelection(i);
                  }, __source: {
                    fileName: _jsxFileName,
                    lineNumber: 81
                  }
                },
                React.createElement(
                  Text,
                  { style: styles.breadItemText, __source: {
                      fileName: _jsxFileName,
                      lineNumber: 86
                    }
                  },
                  getInstanceName(item)
                )
              );
            }, function (i) {
              return React.createElement(
                Text,
                { key: 'sep-' + i, style: styles.breadSep, __source: {
                    fileName: _jsxFileName,
                    lineNumber: 92
                  }
                },
                '\u25B8'
              );
            })
          ),
          React.createElement(
            View,
            { style: styles.row, __source: {
                fileName: _jsxFileName,
                lineNumber: 98
              }
            },
            React.createElement(
              View,
              { style: styles.col, __source: {
                  fileName: _jsxFileName,
                  lineNumber: 99
                }
              },
              React.createElement(StyleInspector, { style: style, __source: {
                  fileName: _jsxFileName,
                  lineNumber: 100
                }
              }),
              openFileButton
            ),
            React.createElement(BoxInspector, { style: style, frame: this.props.frame, __source: {
                fileName: _jsxFileName,
                lineNumber: 105
              }
            })
          )
        )
      );
    }