Skip to content

Commit

Permalink
remove props
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaladin committed Dec 13, 2023
1 parent ad91aff commit e90423b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/react-ui/SearchHeader/SearchHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { type MouseEvent } from 'react';
import {
Typography, Stack, IconButton, InputBase, useTheme, type TypographyProps
Typography, Stack, IconButton, InputBase, useTheme
} from '@mui/material';
import { Variant } from '@mui/material/styles/createTypography';
import { Search, Clear } from '@mui/icons-material';
Expand All @@ -9,9 +9,11 @@ import { Search, Clear } from '@mui/icons-material';
* The SearchHeader component props.
* @public
*/
export type SearchHeaderProps = TypographyProps & {
export type SearchHeaderProps = {
onSubmit?: (searchTerm: string) => void,
placeholder: string
placeholder: string,
variant: Variant,
children: React.ReactNode
}

/**
Expand Down Expand Up @@ -67,7 +69,7 @@ export function SearchHeader({
<InputBase
startAdornment={(
<IconButton onClick={handleClearClick}>
<Clear color="primary" sx={{ fontSize: fontSize }} />
<Clear color="primary" />
</IconButton>
)}
autoFocus
Expand All @@ -77,13 +79,10 @@ export function SearchHeader({
onChange={(e) => setSearchTerm(e.target.value)}
onKeyDown={handleSubmit}
onBlur={handleInputBlur}
sx={{
fontSize: fontSize
}}
/>
) : (
<Stack spacing={1} direction="row" alignItems="center">
<Typography variant={variant} {...rest}>{children}</Typography>
<Typography variant={variant}>{children}</Typography>
{onSubmit && (
<IconButton onClick={handleSearchClick}>
<Search sx={{ fontSize: fontSize }} />
Expand Down

0 comments on commit e90423b

Please sign in to comment.