mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-18 22:48:41 -09:00
tabs: transform to Component for consistency
This commit is contained in:
parent
64a94788ef
commit
412717ce0e
1 changed files with 42 additions and 29 deletions
15
app/tabs.js
15
app/tabs.js
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue