mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-18 14:38:40 -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 React from 'react';
|
||||||
import classes from 'classnames';
|
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' }}>{
|
return <nav style={{ WebkitAppRegion: 'drag' }}>{
|
||||||
data.length
|
data.length
|
||||||
? 1 === data.length
|
? 1 === data.length
|
||||||
|
|
@ -30,6 +41,8 @@ export default function ({ data = [], borderColor, active, activeMarkers = [], o
|
||||||
</ul>
|
</ul>
|
||||||
: null
|
: null
|
||||||
}</nav>;
|
}</nav>;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClick (i, onChange, active) {
|
function onClick (i, onChange, active) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue