Skip to content

Commit

Permalink
docs(Search): fix examples (#1847)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored and levithomason committed Jul 16, 2017
1 parent 6eec9ce commit d57d511
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export default class SearchExampleCategory extends Component {

resetComponent = () => this.setState({ isLoading: false, results: [], value: '' })

handleResultSelect = (e, result) => this.setState({ value: result.title })
handleResultSelect = (e, { result }) => this.setState({ value: result.title })

handleSearchChange = (e, value) => {
handleSearchChange = (e, { value }) => {
this.setState({ isLoading: true, value })

setTimeout(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Label } from 'semantic-ui-react'

import SearchExampleCategory from './SearchExampleCategory'

const categoryRenderer = ({ name }) =>
<Label as={'span'} content={name} />
const categoryRenderer = ({ name }) => <Label as={'span'} content={name} />

categoryRenderer.propTypes = {
name: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default class SearchExampleStandard extends Component {

resetComponent = () => this.setState({ isLoading: false, results: [], value: '' })

handleResultSelect = (e, result) => this.setState({ value: result.title })
handleResultSelect = (e, { result }) => this.setState({ value: result.title })

handleSearchChange = (e, value) => {
handleSearchChange = (e, { value }) => {
this.setState({ isLoading: true, value })

setTimeout(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { Label } from 'semantic-ui-react'

import SearchExampleStandard from './SearchExampleStandard'

const resultRenderer = ({ title, description }) => (
<Label content={title} />
)
const resultRenderer = ({ title, description }) => <Label content={title} />

resultRenderer.propTypes = {
title: PropTypes.string,
Expand Down
1 change: 1 addition & 0 deletions docs/app/Examples/modules/Search/Types/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'

import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'

import SearchExampleStandard from '../Types/SearchExampleStandard'

const SearchExampleAligned = () => <SearchExampleStandard aligned='right' />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react'

import SearchExampleStandard from '../Types/SearchExampleStandard'

const SearchExampleFluid = () => (
<SearchExampleStandard fluid />
)
const SearchExampleFluid = () => <SearchExampleStandard fluid />

export default SearchExampleFluid
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react'
import SearchExampleStandard from '../Types/SearchExampleStandard'

const SearchExampleInput = () => (
<SearchExampleStandard input={{ icon: 'search', iconPosition: 'left' }} />
)
const SearchExampleInput = () => <SearchExampleStandard input={{ icon: 'search', iconPosition: 'left' }} />

export default SearchExampleInput
1 change: 1 addition & 0 deletions docs/app/Examples/modules/Search/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/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'

Expand Down

0 comments on commit d57d511

Please sign in to comment.