diff --git a/app/src/components/Layout/TitleBar.tsx b/app/src/components/Layout/TitleBar.tsx index b048663..b795227 100644 --- a/app/src/components/Layout/TitleBar.tsx +++ b/app/src/components/Layout/TitleBar.tsx @@ -103,7 +103,7 @@ class TitleBar extends React.Component { value={topicFilter} onChange={this.onFilterChange} placeholder="Search…" - endAdornment={
} + endAdornment={
} classes={{ root: classes.inputRoot, input: classes.inputInput }} /> diff --git a/app/src/components/helper/ClearAdornment.tsx b/app/src/components/helper/ClearAdornment.tsx index c4dfe7a..aee829f 100644 --- a/app/src/components/helper/ClearAdornment.tsx +++ b/app/src/components/helper/ClearAdornment.tsx @@ -1,28 +1,30 @@ import * as React from 'react' import Clear from '@material-ui/icons/Clear' -import { IconButton } from '@material-ui/core' +import { IconButton, Theme } from '@material-ui/core' +import { withTheme } from '@material-ui/core/styles' interface Props { value?: string action: any style?: React.CSSProperties + variant?: 'primary' + theme: Theme } /** * Clear button for text input fields */ -class ClearAdornment extends React.Component { - public render() { - if (this.props.value) { - return ( - - - - ) - } - +function ClearAdornment(props: Props) { + if (!props.value) { return null } + + const color = props.variant === 'primary' ? props.theme.palette.primary.contrastText : undefined + return ( + + + + ) } -export default ClearAdornment +export default withTheme(ClearAdornment)