From 0ff667122036615a63f26fdca8a56ad2b799e8fc Mon Sep 17 00:00:00 2001 From: Aliwoto Date: Mon, 19 Aug 2024 01:36:20 +0330 Subject: [PATCH] Minor improvements. Signed-off-by: Aliwoto --- src/components/menus/sideMenu.tsx | 12 +++++++++++- src/pages/searchUserPage.tsx | 28 +++++++++++++++++----------- src/translations/appTranslation.ts | 8 +++++++- src/translations/faTranslation.ts | 7 ++++++- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/components/menus/sideMenu.tsx b/src/components/menus/sideMenu.tsx index 75cedf4..138fcf3 100644 --- a/src/components/menus/sideMenu.tsx +++ b/src/components/menus/sideMenu.tsx @@ -79,13 +79,23 @@ const SideMenu: React.FC = ({...props}) => { href='/createUser' > + + + + + + + diff --git a/src/pages/searchUserPage.tsx b/src/pages/searchUserPage.tsx index 668a8de..18125d9 100644 --- a/src/pages/searchUserPage.tsx +++ b/src/pages/searchUserPage.tsx @@ -18,11 +18,12 @@ import DashboardContainer from '../components/containers/dashboardContainer'; import { timeAgo } from '../utils/timeUtils'; import { CurrentAppTranslation } from '../translations/appTranslation'; -const RenderUsersList = (users: SearchedUserInfo[] | undefined) => { +const RenderUsersList = (users: SearchedUserInfo[] | undefined, forEdit: boolean = false) => { if (!users || users.length === 0) { return ( - {CurrentAppTranslation.NoResultsFoundText} + {forEdit ? CurrentAppTranslation.EnterSearchForEdit : + CurrentAppTranslation.NoResultsFoundText} ); } @@ -42,12 +43,20 @@ const RenderUsersList = (users: SearchedUserInfo[] | undefined) => { }> - {`${CurrentAppTranslation.user_id}: ${user.user_id}`} - {`${CurrentAppTranslation.email}: ${user.email}`} + + {`${CurrentAppTranslation.user_id}: ${user.user_id}`} + + + {`${CurrentAppTranslation.email}: ${user.email}`} + - {`${CurrentAppTranslation.full_name}: ${user.full_name}`} - {`${CurrentAppTranslation.created_at}: ${timeAgo(user.created_at!)}`} + + {`${CurrentAppTranslation.full_name}: ${user.full_name}`} + + + {`${CurrentAppTranslation.created_at}: ${timeAgo(user.created_at!)}`} + @@ -61,6 +70,7 @@ const SearchUserPage = () => { const urlSearch = new URLSearchParams(window.location.search); const providedQuery = urlSearch.get('query'); const providedPage = urlSearch.get('page'); + const forEdit = (urlSearch.get('edit') ?? "false") === "true"; const [query, setQuery] = useState(providedQuery ?? ''); const [users, setUsers] = useState([]); @@ -147,11 +157,7 @@ const SearchUserPage = () => { }}> - ) : ( - - {RenderUsersList(users)} - - )} + ) : RenderUsersList(users, forEdit)}