Skip to content

Commit

Permalink
docs (Search): update layout for search example to accommodate code (#…
Browse files Browse the repository at this point in the history
…2948)

Fake data used in a pre tag in search example makes content overflow
& leaves a place for improvement. The example at SUI doesn't face
such problems because the state is not displayed in examples.
  • Loading branch information
crashuniverse authored and levithomason committed Jun 25, 2018
1 parent caee404 commit 7da1dd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
12 changes: 7 additions & 5 deletions docs/src/examples/modules/Search/Types/SearchExampleCategory.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash'
import faker from 'faker'
import React, { Component } from 'react'
import { Search, Grid, Header } from 'semantic-ui-react'
import { Search, Grid, Header, Segment } from 'semantic-ui-react'

const getResults = () =>
_.times(5, () => ({
Expand Down Expand Up @@ -76,10 +76,12 @@ export default class SearchExampleCategory extends Component {
/>
</Grid.Column>
<Grid.Column width={8}>
<Header>State</Header>
<pre>{JSON.stringify(this.state, null, 2)}</pre>
<Header>Options</Header>
<pre>{JSON.stringify(source, null, 2)}</pre>
<Segment>
<Header>State</Header>
<pre style={{ overflowX: 'auto' }}>{JSON.stringify(this.state, null, 2)}</pre>
<Header>Options</Header>
<pre style={{ overflowX: 'auto' }}>{JSON.stringify(source, null, 2)}</pre>
</Segment>
</Grid.Column>
</Grid>
)
Expand Down
16 changes: 9 additions & 7 deletions docs/src/examples/modules/Search/Types/SearchExampleStandard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash'
import faker from 'faker'
import React, { Component } from 'react'
import { Search, Grid, Header } from 'semantic-ui-react'
import { Search, Grid, Header, Segment } from 'semantic-ui-react'

const source = _.times(5, () => ({
title: faker.company.companyName(),
Expand Down Expand Up @@ -40,7 +40,7 @@ export default class SearchExampleStandard extends Component {

return (
<Grid>
<Grid.Column width={8}>
<Grid.Column width={6}>
<Search
loading={isLoading}
onResultSelect={this.handleResultSelect}
Expand All @@ -50,11 +50,13 @@ export default class SearchExampleStandard extends Component {
{...this.props}
/>
</Grid.Column>
<Grid.Column width={8}>
<Header>State</Header>
<pre>{JSON.stringify(this.state, null, 2)}</pre>
<Header>Options</Header>
<pre>{JSON.stringify(source, null, 2)}</pre>
<Grid.Column width={10}>
<Segment>
<Header>State</Header>
<pre style={{ overflowX: 'auto' }}>{JSON.stringify(this.state, null, 2)}</pre>
<Header>Options</Header>
<pre style={{ overflowX: 'auto' }}>{JSON.stringify(source, null, 2)}</pre>
</Segment>
</Grid.Column>
</Grid>
)
Expand Down

0 comments on commit 7da1dd0

Please sign in to comment.