Skip to content

Commit

Permalink
chore: remove expandOnFocus prop
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgeron committed Sep 17, 2024
1 parent c65dfb0 commit ee24d82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ import { styles } from './styles';
type SearchFormProps = {
className: string;
autoFocus?: boolean;
expandOnFocus?: boolean;
};

export function SearchForm({
className,
autoFocus,
expandOnFocus,
}: SearchFormProps) {
export function SearchForm({ className, autoFocus }: SearchFormProps) {
const classes = styles();
const [results, action] = useFormState(
(_: GQLSearchResult | null, formData: FormData) => {
Expand All @@ -30,7 +25,6 @@ export function SearchForm({
className={className}
searchResult={results}
autoFocus={autoFocus}
expandOnFocus={expandOnFocus}
/>
</form>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,16 @@ export const SearchContext = createContext<{

type SearchWidgetProps = {
autoFocus?: boolean;
expandOnFocus?: boolean;
};

export const SearchWidget = ({
autoFocus,
expandOnFocus,
}: SearchWidgetProps) => {
export const SearchWidget = ({ autoFocus }: SearchWidgetProps) => {
const classes = styles();
const dropdownRef = useRef<HTMLDivElement>(null);

return (
<SearchContext.Provider value={{ dropdownRef }}>
<Flex className="items-center gap-0 laptop:gap-4 justify-center flex-1 self-start">
<SearchForm
className={classes.searchSize()}
autoFocus={autoFocus}
expandOnFocus={expandOnFocus}
/>
<SearchForm className={classes.searchSize()} autoFocus={autoFocus} />
</Flex>
</SearchContext.Provider>
);
Expand Down

0 comments on commit ee24d82

Please sign in to comment.