Skip to content

Commit

Permalink
fix semantic search
Browse files Browse the repository at this point in the history
  • Loading branch information
sickelap committed Sep 3, 2024
1 parent 4dee657 commit 93b74ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
3 changes: 1 addition & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
- burger button toggle menu work
- fix public user list and public photos for authenticated user
- refactor tree with latest mantine tree (and remove existing one)
- fix faces rendering
- fix triple-dots menu
- fix semantic search
- fix site search sections colors for dark theme
20 changes: 4 additions & 16 deletions src/components/SiteSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import {
CloseButton,
Combobox,
Group,
InputBase,
Loader,
Text,
useCombobox,
useComputedColorScheme,
} from "@mantine/core";
import { Combobox, Group, InputBase, Loader, Text, useCombobox } from "@mantine/core";
import { useViewportSize } from "@mantine/hooks";
import { IconAlbum, IconMap, IconSearch, IconTag, IconUser } from "@tabler/icons-react";
import { IconAlbum, IconMap, IconSearch, IconTag, IconUser, IconX } from "@tabler/icons-react";
import React from "react";
import { useTranslation } from "react-i18next";
import { push } from "redux-first-history";
Expand Down Expand Up @@ -43,22 +34,19 @@ export function SiteSearch() {
const dispatch = useAppDispatch();
const searchWidth = width ? width - width / 1.8 : 200;
const [value, setValue] = React.useState("");
const theme = useComputedColorScheme();

function getSearchRightIcon() {
const color = theme === "dark" ? "white" : "black";
if (isLoading) return <Loader color={color} size="xs" type="dots" />;
if (isLoading) return <Loader size="xs" type="dots" />;
if (value) {
return (
<CloseButton
<IconX
size="sm"
onMouseDown={event => event.preventDefault()}
onClick={() => {
setValue("");
filterOptions("");
}}
aria-label="Clear value"
color={color}
/>
);
}
Expand Down

0 comments on commit 93b74ee

Please sign in to comment.