Skip to content

fix(site): fix search menu for creating workspace and templates filter #11674

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

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix style types
  • Loading branch information
BrunoQuaresma committed Jan 17, 2024
commit 9f8174addd86bbab2f63effee79e92c6e2c16824
4 changes: 2 additions & 2 deletions site/src/components/Filter/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
Search,
SearchEmpty,
SearchInput,
searchContentStyles,
searchStyles,
} from "components/Menu/Search";

export type PresetFilter = {
Expand Down Expand Up @@ -591,7 +591,7 @@ function SearchMenu<TOption extends BaseOption>({
onQueryChange("");
}}
css={{
"& .MuiPaper-root": searchContentStyles,
"& .MuiPaper-root": searchStyles.content,
}}
// Disabled this so when we clear the filter and do some sorting in the
// search items it does not look strange. Github removes exit transitions
Expand Down
10 changes: 6 additions & 4 deletions site/src/components/Menu/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ export const SearchEmpty: FC<HTMLAttributes<HTMLDivElement>> = ({
);
};

export const searchContentStyles = {
width: 320,
padding: 0,
borderRadius: 4,
export const searchStyles = {
content: {
width: 320,
padding: 0,
borderRadius: 4,
},
} satisfies Record<string, Interpolation<Theme>>;
4 changes: 2 additions & 2 deletions site/src/pages/WorkspacesPage/WorkspacesButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
PopoverContent,
PopoverTrigger,
} from "components/Popover/Popover";
import { SearchEmpty, searchContentStyles } from "components/Menu/Search";
import { SearchEmpty, searchStyles } from "components/Menu/Search";

const ICON_SIZE = 18;

Expand Down Expand Up @@ -64,7 +64,7 @@ export const WorkspacesButton: FC<WorkspacesButtonProps> = ({
<PopoverContent
horizontal="right"
css={{
".MuiPaper-root": searchContentStyles,
".MuiPaper-root": searchStyles.content,
}}
>
<SearchBox
Expand Down