-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(tab): move to completely generic tab
- Loading branch information
1 parent
20c40c8
commit 39c928b
Showing
9 changed files
with
92 additions
and
278 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import React from 'react' | ||
import { Tab } from 'semantic-ui-react' | ||
|
||
const panes = [ | ||
{ menuItem: 'Tab 1', render: () => <Tab.Pane>Tab 1 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 2', render: () => <Tab.Pane>Tab 2 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 3', render: () => <Tab.Pane>Tab 3 Content</Tab.Pane> }, | ||
] | ||
|
||
const TabExampleBasic = () => ( | ||
<Tab> | ||
<Tab.Pane menuItem='Tab 1'>Tab 1 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 2'>Tab 2 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 3'>Tab 3 Content</Tab.Pane> | ||
</Tab> | ||
<Tab panes={panes} /> | ||
) | ||
|
||
export default TabExampleBasic |
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,12 +1,14 @@ | ||
import React from 'react' | ||
import { Tab } from 'semantic-ui-react' | ||
|
||
const panes = [ | ||
{ menuItem: 'Tab 1', render: () => <Tab.Pane attached={false}>Tab 1 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 2', render: () => <Tab.Pane attached={false}>Tab 2 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 3', render: () => <Tab.Pane attached={false}>Tab 3 Content</Tab.Pane> }, | ||
] | ||
|
||
const TabExamplePointing = () => ( | ||
<Tab pointing> | ||
<Tab.Pane menuItem='Tab 1'>Tab 1 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 2'>Tab 2 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 3'>Tab 3 Content</Tab.Pane> | ||
</Tab> | ||
<Tab menu={{ pointing: true }} panes={panes} /> | ||
) | ||
|
||
export default TabExamplePointing |
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,12 +1,14 @@ | ||
import React from 'react' | ||
import { Tab } from 'semantic-ui-react' | ||
|
||
const panes = [ | ||
{ menuItem: 'Tab 1', render: () => <Tab.Pane attached={false}>Tab 1 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 2', render: () => <Tab.Pane attached={false}>Tab 2 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 3', render: () => <Tab.Pane attached={false}>Tab 3 Content</Tab.Pane> }, | ||
] | ||
|
||
const TabExampleSecondary = () => ( | ||
<Tab secondary> | ||
<Tab.Pane menuItem='Tab 1'>Tab 1 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 2'>Tab 2 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 3'>Tab 3 Content</Tab.Pane> | ||
</Tab> | ||
<Tab menu={{ secondary: true }} panes={panes} /> | ||
) | ||
|
||
export default TabExampleSecondary |
12 changes: 7 additions & 5 deletions
12
docs/app/Examples/modules/Tab/Types/TabExampleSecondaryPointing.js
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,12 +1,14 @@ | ||
import React from 'react' | ||
import { Tab } from 'semantic-ui-react' | ||
|
||
const panes = [ | ||
{ menuItem: 'Tab 1', render: () => <Tab.Pane attached={false}>Tab 1 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 2', render: () => <Tab.Pane attached={false}>Tab 2 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 3', render: () => <Tab.Pane attached={false}>Tab 3 Content</Tab.Pane> }, | ||
] | ||
|
||
const TabExampleSecondaryPointing = () => ( | ||
<Tab secondary pointing> | ||
<Tab.Pane menuItem='Tab 1'>Tab 1 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 2'>Tab 2 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 3'>Tab 3 Content</Tab.Pane> | ||
</Tab> | ||
<Tab menu={{ secondary: true, pointing: true }} panes={panes} /> | ||
) | ||
|
||
export default TabExampleSecondaryPointing |
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,12 +1,14 @@ | ||
import React from 'react' | ||
import { Tab } from 'semantic-ui-react' | ||
|
||
const panes = [ | ||
{ menuItem: 'Tab 1', render: () => <Tab.Pane attached={false}>Tab 1 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 2', render: () => <Tab.Pane attached={false}>Tab 2 Content</Tab.Pane> }, | ||
{ menuItem: 'Tab 3', render: () => <Tab.Pane attached={false}>Tab 3 Content</Tab.Pane> }, | ||
] | ||
|
||
const TabExampleText = () => ( | ||
<Tab text> | ||
<Tab.Pane menuItem='Tab 1'>Tab 1 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 2'>Tab 2 Content</Tab.Pane> | ||
<Tab.Pane menuItem='Tab 3'>Tab 3 Content</Tab.Pane> | ||
</Tab> | ||
<Tab menu={{ text: true }} panes={panes} /> | ||
) | ||
|
||
export default TabExampleText |
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
Oops, something went wrong.