Skip to content

Commit

Permalink
Add Tabs documentation page
Browse files Browse the repository at this point in the history
  • Loading branch information
farazcsk committed Oct 5, 2017
1 parent accade3 commit ffa59b6
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
11 changes: 11 additions & 0 deletions styleguide/components/Navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,17 @@ const Navigation = ({ className, onLinkClick }) => (
Panels
</NavLink>
</li>
<li className={ css.linkListItem }>
<NavLink
exact
activeClassName={ css.linkActive }
className={ css.link }
to="/patterns/tabs"
onClick={ onLinkClick }
>
Tabs
</NavLink>
</li>
<li className={ css.linkListItem }>
<NavLink
exact
Expand Down
2 changes: 2 additions & 0 deletions styleguide/screens/Patterns/Patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Markdown from './Markdown/Markdown';
import Medallion from './Medallion/Medallion';
import Pagination from './Pagination/Pagination';
import Panels from './Panels/Panels';
import Tabs from './Tabs/Tabs';
import TabBar from './TabBar/TabBar';

const Patterns = () => (
Expand All @@ -29,6 +30,7 @@ const Patterns = () => (
<Route path="/patterns/medallion" component={ Medallion } />
<Route path="/patterns/pagination" component={ Pagination } />
<Route path="/patterns/panels" component={ Panels } />
<Route path="/patterns/tabs" component={ Tabs } />
<Route path="/patterns/tab-bar" component={ TabBar } />
</Switch>
);
Expand Down
50 changes: 50 additions & 0 deletions styleguide/screens/Patterns/Tabs/Tabs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from 'react';
import cx from 'classnames';
import dedent from 'dedent';

import Specimen from '../../../components/Specimen/Specimen';
import { D, H, T, A, C } from '../../../components/Scaffold/Scaffold';

import Tabs from '../../../../components/Tabs/Tabs';
import Tab from '../../../../components/Tabs/Tab';

import m from '../../../../globals/modifiers.css';

const TabsDocumentation = () => (
<div>
<H level={ 1 }>Loader</H>
<T elm="p" className={ cx(m.mtr, m.largeI, m.demi) }>
<C>Tabs</C> provide an easy way to navigate between views on a single page,
where content is related. For cases when you need page level tabs,
<A href="/patterns/tab-bar">TabBar</A>.
</T>
<D>
<Specimen
classNames={ {
specimenContainer: m.par,
} }
code={ dedent`
<Tabs>
<Tab label="One">
Barry Chuckle
</Tab>
<Tab label="Two">
Paul Chuckle
</Tab>
</Tabs>
` }
>
<Tabs>
<Tab label="One">
Barry Chuckle
</Tab>
<Tab label="Two">
Paul Chuckle
</Tab>
</Tabs>
</Specimen>
</D>
</div>
);

export default TabsDocumentation;
9 changes: 9 additions & 0 deletions styleguide/screens/Patterns/Tabs/Tabs.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import { render } from 'react-dom';

import Tabs from './Tabs';

it('renders without crashing', () => {
const div = document.createElement('div');
render(<Tabs />, div);
});

0 comments on commit ffa59b6

Please sign in to comment.