-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
falcon-ui: Added initial Tabs to HomePage
- Loading branch information
Showing
5 changed files
with
129 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,48 @@ | ||
// @flow | ||
import * as React from 'react'; | ||
import React, { Children, Component } from 'react'; | ||
|
||
type Props = { | ||
children: React.ReactNode, | ||
className: string, | ||
defaultFocus: boolean, | ||
defaultIndex: number, | ||
disabledTabClassName: string, | ||
onSelect: (index: number, lastIndex: number, event: Event) => ?boolean, | ||
selectedIndex: number, | ||
selectedTabClassName: string, | ||
selectedTabPanelClassName: string | ||
selectedTabPanelClassName: string, | ||
width: number, | ||
onSelect: (index: number, lastIndex: number, event: Event) => ?boolean | ||
}; | ||
|
||
export default class Tabs extends React.Component<Props> { | ||
export default class Tabs extends Component<Props> { | ||
renderChildren = () => | ||
React.Children.map(this.props.children, child => | ||
// console.log('In Tab.js'); | ||
// console.dir(child); | ||
React.cloneElement(child, {}) | ||
); | ||
|
||
3; | ||
|
||
gettabWidth(): number { | ||
const tabsContentWidth = | ||
this.tabContentEl.clientWidth - this.options.tabOverlapDistance; | ||
const width = | ||
tabsContentWidth / this.tabEls.length + this.options.tabOverlapDistance; | ||
return Math.max( | ||
this.options.minWidth, | ||
Math.min(this.options.maxWidth, width) | ||
); | ||
} | ||
|
||
renderSelectedTab = (i: number) => {}; | ||
|
||
render() { | ||
return <div />; | ||
return ( | ||
<div className="chrome-tabs" style={{ width: this.props.width }}> | ||
<div className="chrome-tabs-content">{this.renderChildren()}</div> | ||
<div className="chrome-tabs-bottom-bar" /> | ||
</div> | ||
); | ||
} | ||
} |