tabs: transform to Component for consistency

This commit is contained in:
Guillermo Rauch 2016-07-08 17:33:39 -07:00
parent 64a94788ef
commit 412717ce0e

View file

@ -1,7 +1,18 @@
import React from 'react';
import classes from 'classnames';
export default function ({ data = [], borderColor, active, activeMarkers = [], onChange, onClose }) {
export default class Tabs extends React.Component {
render () {
const {
data = [],
borderColor,
active,
activeMarkers = [],
onChange,
onClose
} = this.props;
return <nav style={{ WebkitAppRegion: 'drag' }}>{
data.length
? 1 === data.length
@ -32,6 +43,8 @@ export default function ({ data = [], borderColor, active, activeMarkers = [], o
}</nav>;
}
}
function onClick (i, onChange, active) {
if (i !== active) {
onChange(i);