Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline

Manav Rathi3baa699d798c
diff --git a/web/apps/photos/src/components/Search/SearchBar/index.tsx b/web/apps/photos/src/components/Search/SearchBar/index.tsx
index 3d3a9cf252..be8ba65d5b 100644
--- a/web/apps/photos/src/components/Search/SearchBar/index.tsx
+++ b/web/apps/photos/src/components/Search/SearchBar/index.tsx
@@ -18,6 +18,7 @@ import { labelForSuggestionType } from "@/new/photos/services/search/ui";
import type { LocationTag } from "@/new/photos/services/user-entity";
import { EnteFile } from "@/new/photos/types/file";
import {
+ CenteredFlex,
FlexWrapper,
FluidContainer,
FreeFlowText,
@@ -32,6 +33,7 @@ import LocationIcon from "@mui/icons-material/LocationOn";
import SearchIcon from "@mui/icons-material/Search";
import {
Box,
+ css,
Divider,
IconButton,
Stack,
@@ -40,6 +42,7 @@ import {
} from "@mui/material";
import CollectionCard from "components/Collections/CollectionCard";
import { ResultPreviewTile } from "components/Collections/styledComponents";
+import { IMAGE_CONTAINER_MAX_WIDTH, MIN_COLUMNS } from "constants/gallery";
import { t } from "i18next";
import memoize from "memoize-one";
import pDebounce from "p-debounce";
@@ -55,11 +58,6 @@ import {
} from "services/searchService";
import { Collection } from "types/collection";
import { SelectStyles } from "../../../styles/search";
-import {
- SearchBarWrapper,
- SearchInputWrapper,
- SearchMobileBox,
-} from "./styledComponents";
const { Option, ValueContainer, Menu } = components;
@@ -93,6 +91,13 @@ export default function SearchBar({
);
}
+const SearchBarWrapper = styled(FlexWrapper)`
+ padding: 0 24px;
+ @media (max-width: ${IMAGE_CONTAINER_MAX_WIDTH * MIN_COLUMNS}px) {
+ padding: 0 4px;
+ }
+`;
+
interface SearchInputProps {
isOpen: boolean;
updateSearch: UpdateSearch;
@@ -270,6 +275,21 @@ export const SearchInput: React.FC<SearchInputProps> = (props) => {
);
};
+const SearchInputWrapper = styled(CenteredFlex, {
+ shouldForwardProp: (propName) => propName != "isOpen",
+})<{ isOpen: boolean }>`
+ background: ${({ theme }) => theme.colors.background.base};
+ max-width: 484px;
+ margin: auto;
+ ${(props) =>
+ !props.isOpen &&
+ css`
+ @media (max-width: 624px) {
+ display: none;
+ }
+ `}
+`;
+
const OptionWithInfo = (props) => (
<Option {...props}>
<LabelWithInfo data={props.data} />
@@ -427,3 +447,13 @@ function SearchBarMobile({ show, showSearchInput }) {
</SearchMobileBox>
);
}
+
+const SearchMobileBox = styled(FluidContainer)`
+ display: flex;
+ cursor: pointer;
+ align-items: center;
+ justify-content: flex-end;
+ @media (min-width: 625px) {
+ display: none;
+ }
+`;
diff --git a/web/apps/photos/src/components/Search/SearchBar/styledComponents.tsx b/web/apps/photos/src/components/Search/SearchBar/styledComponents.tsx
deleted file mode 100644
index d33c7c9490..0000000000
--- a/web/apps/photos/src/components/Search/SearchBar/styledComponents.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import {
- CenteredFlex,
- FlexWrapper,
- FluidContainer,
-} from "@ente/shared/components/Container";
-import { css, styled } from "@mui/material";
-import { IMAGE_CONTAINER_MAX_WIDTH, MIN_COLUMNS } from "constants/gallery";
-
-export const SearchBarWrapper = styled(FlexWrapper)`
- padding: 0 24px;
- @media (max-width: ${IMAGE_CONTAINER_MAX_WIDTH * MIN_COLUMNS}px) {
- padding: 0 4px;
- }
-`;
-
-export const SearchMobileBox = styled(FluidContainer)`
- display: flex;
- cursor: pointer;
- align-items: center;
- justify-content: flex-end;
- @media (min-width: 625px) {
- display: none;
- }
-`;
-
-export const SearchInputWrapper = styled(CenteredFlex, {
- shouldForwardProp: (propName) => propName != "isOpen",
-})<{ isOpen: boolean }>`
- background: ${({ theme }) => theme.colors.background.base};
- max-width: 484px;
- margin: auto;
- ${(props) =>
- !props.isOpen &&
- css`
- @media (max-width: 624px) {
- display: none;
- }
- `}
-`;