From abe1401a6d58fd3a5f42ca3194d894bec822162a Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Tue, 5 Mar 2024 16:15:11 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20style:=20adjust=20the=20style=20?= =?UTF-8?q?of=20project=20search=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/SearchBar.tsx | 2 +- .../components/projects/ProjectSearchBar.tsx | 119 +++++++++--------- .../frontend/src/layouts/ProjectSearch.tsx | 66 +++++----- 3 files changed, 96 insertions(+), 91 deletions(-) diff --git a/packages/frontend/src/components/SearchBar.tsx b/packages/frontend/src/components/SearchBar.tsx index d597f2c1..4e37c20d 100644 --- a/packages/frontend/src/components/SearchBar.tsx +++ b/packages/frontend/src/components/SearchBar.tsx @@ -15,7 +15,7 @@ const SearchBar: React.ForwardRefRenderFunction< value={value} type="search" placeholder={placeholder} - appearance={'borderless'} + appearance="borderless" {...props} /> diff --git a/packages/frontend/src/components/projects/ProjectSearchBar.tsx b/packages/frontend/src/components/projects/ProjectSearchBar.tsx index 56249356..c2d986f2 100644 --- a/packages/frontend/src/components/projects/ProjectSearchBar.tsx +++ b/packages/frontend/src/components/projects/ProjectSearchBar.tsx @@ -3,17 +3,12 @@ import { useCombobox } from 'downshift'; import { Project } from 'gql-client'; import { useDebounce } from 'usehooks-ts'; -import { - List, - ListItem, - ListItemPrefix, - Card, - Typography, - Avatar, -} from '@material-tailwind/react'; - -import SearchBar from '../SearchBar'; -import { useGQLClient } from '../../context/GQLClientContext'; +import SearchBar from 'components/SearchBar'; +import { useGQLClient } from 'context/GQLClientContext'; +import { cn } from 'utils/classnames'; +import { InfoRoundFilledIcon } from 'components/shared/CustomIcon'; +import { Avatar } from 'components/shared/Avatar'; +import { getInitials } from 'utils/geInitials'; interface ProjectsSearchProps { onChange?: (data: Project) => void; @@ -67,59 +62,59 @@ const ProjectSearchBar = ({ onChange }: ProjectsSearchProps) => { return (
- - - {items.length ? ( - <> -
- - Suggestions - -
- {items.map((item, index) => ( - - - - -
- - {item.name} - - - {item.organization.name} - -
-
- ))} - - ) : ( -
- - ^ No projects matching this name - + {items.length ? ( + <> +
+

+ Suggestions +

- )} - - + {items.map((item, index) => ( +
+ +
+

+ {item.name} +

+

+ {item.organization.name} +

+
+
+ ))} + + ) : ( +
+
+ +
+

+ No projects matching this name +

+
+ )} +
); }; diff --git a/packages/frontend/src/layouts/ProjectSearch.tsx b/packages/frontend/src/layouts/ProjectSearch.tsx index c471ab5d..a6a36199 100644 --- a/packages/frontend/src/layouts/ProjectSearch.tsx +++ b/packages/frontend/src/layouts/ProjectSearch.tsx @@ -4,12 +4,14 @@ import { User } from 'gql-client'; // import { Tooltip } from '@material-tailwind/react'; -import HorizontalLine from '../components/HorizontalLine'; -import ProjectSearchBar from '../components/projects/ProjectSearchBar'; -import { useGQLClient } from '../context/GQLClientContext'; -import { formatAddress } from '../utils/format'; +import HorizontalLine from 'components/HorizontalLine'; +import ProjectSearchBar from 'components/projects/ProjectSearchBar'; +import { useGQLClient } from 'context/GQLClientContext'; import { NotificationBellIcon, PlusIcon } from 'components/shared/CustomIcon'; import { Button } from 'components/shared/Button'; +import { Avatar } from 'components/shared/Avatar'; +import { getInitials } from 'utils/geInitials'; +import { formatAddress } from '../utils/format'; const ProjectSearch = () => { const navigate = useNavigate(); @@ -32,10 +34,11 @@ const ProjectSearch = () => { }, []); return ( -
-
-
-
+
+ {/* Header */} +
+
+
{ navigate( @@ -44,30 +47,37 @@ const ProjectSearch = () => { }} />
- - - {user?.name ? ( - - ) : null} +
+ + + {user?.name && ( + + )} +
-
+ + {/* Content */} +
-
-
+ + ); };