Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(Breadcrumb): rework and clarify component examples #3488

Merged
merged 1 commit into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const sections = [
{ key: 'info', content: 'Personal Information', active: true },
]

const BreadcrumbExampleDividerProps = () => <Breadcrumb divider='/' sections={sections} />
const BreadcrumbExampleDividerShorthand = () => (
<Breadcrumb divider='/' sections={sections} />
)

export default BreadcrumbExampleDividerProps
export default BreadcrumbExampleDividerShorthand

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const sections = [
{ key: 'search', content: 'Search', active: true },
]

const BreadcrumbExampleSectionProps = () => <Breadcrumb sections={sections} />
const BreadcrumbExampleSectionShorthand = () => (
<Breadcrumb sections={sections} />
)

export default BreadcrumbExampleSectionProps
export default BreadcrumbExampleSectionShorthand
16 changes: 11 additions & 5 deletions docs/src/examples/collections/Breadcrumb/Content/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'

import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection'
import ShorthandExample from 'docs/src/components/ComponentDoc/ShorthandExample'

const BreadcrumbContentExamples = () => (
<div>
Expand All @@ -9,20 +11,24 @@ const BreadcrumbContentExamples = () => (
title='Divider'
description={[
'A breadcrumb can contain a divider to show the relationship between sections,',
'this can be formatted as an icon or text.',
'this can be formatted as text.',
].join(' ')}
examplePath='collections/Breadcrumb/Content/BreadcrumbExampleDivider'
/>
<ComponentExample examplePath='collections/Breadcrumb/Content/BreadcrumbExampleDividerProps' />
<ComponentExample examplePath='collections/Breadcrumb/Content/BreadcrumbExampleIconDivider' />
<ComponentExample examplePath='collections/Breadcrumb/Content/BreadcrumbExampleIconDividerProps' />
<ShorthandExample examplePath='collections/Breadcrumb/Content/BreadcrumbExampleDividerShorthand' />

<ComponentExample
title='Divider as icon'
description='It can be also formatted as icon.'
examplePath='collections/Breadcrumb/Content/BreadcrumbExampleIconDivider'
/>

<ComponentExample
title='Section'
description='A breadcrumb can contain sections that can either be formatted as a link or text.'
examplePath='collections/Breadcrumb/Content/BreadcrumbExampleSection'
/>
<ComponentExample examplePath='collections/Breadcrumb/Content/BreadcrumbExampleSectionProps' />
<ComponentExample examplePath='collections/Breadcrumb/Content/BreadcrumbExampleSectionShorthand' />

<ComponentExample
title='Link'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { Breadcrumb } from 'semantic-ui-react'

const BreadcrumbExampleStandard = () => (
const BreadcrumbExample = () => (
<Breadcrumb>
<Breadcrumb.Section link>Home</Breadcrumb.Section>
<Breadcrumb.Divider />
Expand All @@ -11,4 +11,4 @@ const BreadcrumbExampleStandard = () => (
</Breadcrumb>
)

export default BreadcrumbExampleStandard
export default BreadcrumbExample

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const sections = [
{ key: 'Shirt', content: 'T-Shirt', active: true },
]

const BreadcrumbExampleProps = () => <Breadcrumb icon='right angle' sections={sections} />
const BreadcrumbExampleShorthand = () => (
<Breadcrumb icon='right angle' sections={sections} />
)

export default BreadcrumbExampleProps
export default BreadcrumbExampleShorthand
7 changes: 4 additions & 3 deletions docs/src/examples/collections/Breadcrumb/Types/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from 'react'

import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection'
import ShorthandExample from 'docs/src/components/ComponentDoc/ShorthandExample'

const BreadcrumbTypesExamples = () => (
<div>
<ExampleSection title='Types'>
<ComponentExample
title='Breadcrumb'
description='A standard breadcrumb.'
examplePath='collections/Breadcrumb/Types/BreadcrumbExampleStandard'
examplePath='collections/Breadcrumb/Types/BreadcrumbExample'
/>
<ComponentExample examplePath='collections/Breadcrumb/Types/BreadcrumbExampleDivider' />
<ComponentExample examplePath='collections/Breadcrumb/Types/BreadcrumbExampleProps' />
<ShorthandExample examplePath='collections/Breadcrumb/Types/BreadcrumbExampleShorthand' />
</ExampleSection>
</div>
)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react'
import { Breadcrumb, Divider } from 'semantic-ui-react'

const sizes = ['mini', 'tiny', 'small', 'large', 'big', 'huge', 'massive']

const BreadcrumbExampleSize = () => (
<React.Fragment>
{sizes.map(size => (
<React.Fragment key={size}>
<Breadcrumb size={size}>
<Breadcrumb.Section link>Home</Breadcrumb.Section>
<Breadcrumb.Divider icon='right chevron' />
<Breadcrumb.Section link>Registration</Breadcrumb.Section>
<Breadcrumb.Divider icon='right chevron' />
<Breadcrumb.Section active>Personal Information</Breadcrumb.Section>
</Breadcrumb>
<Divider hidden />
</React.Fragment>
))}
</React.Fragment>
)

export default BreadcrumbExampleSize

This file was deleted.

This file was deleted.

9 changes: 2 additions & 7 deletions docs/src/examples/collections/Breadcrumb/Variations/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'

import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection'

Expand All @@ -8,14 +9,8 @@ const BreadcrumbVariationsExamples = () => (
<ComponentExample
title='Size'
description='A breadcrumb can vary in size.'
examplePath='collections/Breadcrumb/Variations/BreadcrumbExampleMiniSize'
examplePath='collections/Breadcrumb/Variations/BreadcrumbExampleSize'
/>
<ComponentExample examplePath='collections/Breadcrumb/Variations/BreadcrumbExampleTinySize' />
<ComponentExample examplePath='collections/Breadcrumb/Variations/BreadcrumbExampleSmallSize' />
<ComponentExample examplePath='collections/Breadcrumb/Variations/BreadcrumbExampleLargeSize' />
<ComponentExample examplePath='collections/Breadcrumb/Variations/BreadcrumbExampleBigSize' />
<ComponentExample examplePath='collections/Breadcrumb/Variations/BreadcrumbExampleHugeSize' />
<ComponentExample examplePath='collections/Breadcrumb/Variations/BreadcrumbExampleMassiveSize' />
</ExampleSection>
</div>
)
Expand Down