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(Search): fix examples #1847

Merged
merged 1 commit into from
Jul 16, 2017
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 @@ -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} />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be one line.

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) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgotten change.

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