From 50cd26d00da14da39a20d0da9e46032a031bb722 Mon Sep 17 00:00:00 2001 From: Nivedita <141390434+Nivedita-Chhokar@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:49:54 +0530 Subject: [PATCH] fix: update Chat section title to 'Chats' (#3216) --- public/locales/en/translation.json | 1 + public/locales/fr/translation.json | 1 + public/locales/hi/translation.json | 1 + public/locales/sp/translation.json | 1 + public/locales/zh/translation.json | 1 + .../UserPortal/UserScreen/UserScreen.spec.tsx | 19 +++++++++++++++++++ .../UserPortal/UserScreen/UserScreen.tsx | 1 + 7 files changed, 25 insertions(+) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index a6cb90d3d1..fc445a708e 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -1262,6 +1262,7 @@ "endOfResults": "endOfResults" }, "userChat": { + "title": "Chats", "add": "Add", "chat": "Chat", "search": "Search", diff --git a/public/locales/fr/translation.json b/public/locales/fr/translation.json index 416d00c4b4..0ac5728872 100644 --- a/public/locales/fr/translation.json +++ b/public/locales/fr/translation.json @@ -1262,6 +1262,7 @@ "endOfResults": "Fin des résultats" }, "userChat": { + "title": "Discussions", "add": "Ajouter", "chat": "Chat", "contacts": "Contacts", diff --git a/public/locales/hi/translation.json b/public/locales/hi/translation.json index 6abb8abefc..d791c0d9e8 100644 --- a/public/locales/hi/translation.json +++ b/public/locales/hi/translation.json @@ -1262,6 +1262,7 @@ "endOfResults": "परिणाम समाप्त" }, "userChat": { + "title": "चैट्स", "add": "जोड़ें", "chat": "बात करना", "contacts": "संपर्क", diff --git a/public/locales/sp/translation.json b/public/locales/sp/translation.json index 79d7436c39..814da7334b 100644 --- a/public/locales/sp/translation.json +++ b/public/locales/sp/translation.json @@ -1265,6 +1265,7 @@ "createAdvertisement": "Crear publicidad" }, "userChat": { + "title": "Chats", "add": "Agregar", "chat": "Charlar", "search": "Buscar", diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index 32a4f953be..2a8a2753a8 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -1262,6 +1262,7 @@ "endOfResults": "结果结束" }, "userChat": { + "title": "聊天", "add": "添加", "chat": "聊天", "contacts": "联系方式", diff --git a/src/screens/UserPortal/UserScreen/UserScreen.spec.tsx b/src/screens/UserPortal/UserScreen/UserScreen.spec.tsx index 65c5e6a650..95a1f633da 100644 --- a/src/screens/UserPortal/UserScreen/UserScreen.spec.tsx +++ b/src/screens/UserPortal/UserScreen/UserScreen.spec.tsx @@ -130,6 +130,25 @@ describe('UserScreen tests with LeftDrawer functionality', () => { expect(titleElement).toHaveTextContent('People'); }); + it('renders the correct title for chat', () => { + mockLocation = '/user/chat/123'; + + render( + + + + + + + + + , + ); + + const titleElement = screen.getByRole('heading', { level: 1 }); + expect(titleElement).toHaveTextContent('Chats'); + }); + it('toggles LeftDrawer correctly based on window size and user interaction', () => { render( diff --git a/src/screens/UserPortal/UserScreen/UserScreen.tsx b/src/screens/UserPortal/UserScreen/UserScreen.tsx index 39b422858f..5a877865c3 100644 --- a/src/screens/UserPortal/UserScreen/UserScreen.tsx +++ b/src/screens/UserPortal/UserScreen/UserScreen.tsx @@ -17,6 +17,7 @@ const map: InterfaceMapType = { people: 'people', events: 'userEvents', donate: 'donate', + chat: 'userChat', campaigns: 'userCampaigns', pledges: 'userPledges', volunteer: 'userVolunteer',