From f3276dd8fe6637bb3f8ccc1a2fd35a1f91a792c1 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:21:12 -0300 Subject: [PATCH] feat: add texts for no invites, no friends and no blocks --- src/locales/en/translation.json | 6 +++++- src/locales/pt/translation.json | 6 +++++- .../user-friend-modal-add-friend.tsx | 17 +++++++---------- .../user-friend-modal-list.tsx | 1 + .../user-friend-modal/user-friend-modal.css.ts | 12 ++++++++++++ .../user-friend-modal/user-friend-modal.tsx | 13 ++++--------- .../user-block-list.tsx | 1 + 7 files changed, 35 insertions(+), 21 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 5dce5893..db64ed3c 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -268,6 +268,10 @@ "friends_only": "Friends only", "privacy": "Privacy", "blocked_users": "Blocked users", - "unblock": "Unblock" + "unblock": "Unblock", + "no_friends_added": "You still don't have added friends", + "pending": "Pending", + "no_pending_invites": "You have no pending invites", + "no_blocked_users": "You have no blocked users" } } diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index 97c59b47..5cb6fd2f 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -268,6 +268,10 @@ "friends_only": "Apenas amigos", "public": "Público", "blocked_users": "Usuários bloqueados", - "unblock": "Desbloquear" + "unblock": "Desbloquear", + "no_friends_added": "Você ainda não possui amigos adicionados", + "pending": "Pendentes", + "no_pending_invites": "Você não possui convites de amizade pendentes", + "no_blocked_users": "Você não tem nenhum usuário bloqueado" } } diff --git a/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal-add-friend.tsx b/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal-add-friend.tsx index 0725674e..b6e6aaea 100644 --- a/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal-add-friend.tsx +++ b/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal-add-friend.tsx @@ -40,20 +40,16 @@ export const UserFriendModalAddFriend = ({ }); }; - const resetAndClose = () => { - setFriendCode(""); - closeModal(); - }; - const handleClickRequest = (userId: string) => { - resetAndClose(); + closeModal(); navigate(`/user/${userId}`); }; const handleClickSeeProfile = () => { - resetAndClose(); - // TODO: add validation for this input? - navigate(`/user/${friendCode}`); + closeModal(); + if (friendCode.length === 8) { + navigate(`/user/${friendCode}`); + } }; const handleCancelFriendRequest = (userId: string) => { @@ -122,7 +118,8 @@ export const UserFriendModalAddFriend = ({ gap: `${SPACING_UNIT * 2}px`, }} > -

Pendentes

+

{t("pending")}

+ {friendRequests.length === 0 &&

{t("no_pending_invites")}

} {friendRequests.map((request) => { return ( + {friends.length === 0 &&

{t("no_friends_added")}

} {friends.map((friend) => { return ( -

Meu código de amigo:

+

Seu código de amigo: