Skip to content

Commit

Permalink
fix: handle add friend modal wording in lite version (#1579)
Browse files Browse the repository at this point in the history
* fix: handle add friend modal wording in lite version

* fix: key in id language

Co-authored-by: Irman Nur Muhammad Alamsyah <[email protected]>
  • Loading branch information
abdulhakim2902 and irmannmal authored Nov 22, 2022
1 parent b2fe3fb commit 0c6f4b3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 14 deletions.
8 changes: 5 additions & 3 deletions src/components/ProfileHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,17 @@ export const ProfileHeaderComponent: React.FC<Props> = props => {
const handleNotFullAccess = () => {
confirm({
title: i18n.t('LiteVersion.LimitTitleFriends'),
description: i18n.t('LiteVersion.LimitDescFriends'),
description: i18n.t('LiteVersion.LimitDescFriends', {username: person.username}),
icon: 'warning',
confirmationText: i18n.t('LiteVersion.ConnectWallet'),
cancellationText: i18n.t('LiteVersion.MaybeLater'),
cancellationText: i18n.t('LiteVersion.ViewTimelines'),
onConfirm: () => {
router.push({pathname: '/wallet', query: {type: 'manage'}});
},
onCancel: () => {
undefined;
router.replace({pathname: `/profile/${person.id}`, query: {tab: 'experience'}}, undefined, {
shallow: true,
});
},
});
};
Expand Down
13 changes: 13 additions & 0 deletions src/components/UserMenu/UserMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, {useState, useEffect} from 'react';
import {useSelector} from 'react-redux';

import {useRouter} from 'next/router';

import {useMediaQuery, useTheme} from '@material-ui/core';
import Paper from '@material-ui/core/Paper';

Expand All @@ -23,18 +25,29 @@ export const UserMenu: React.FC<UserMenuProps> = props => {
const {selected, excludes = []} = props;
const {detail: profileDetail} = useSelector<RootState, ProfileState>(state => state.profileState);

const router = useRouter();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('xs'));

const styles = useStyles();
const tabs = useUserTabs(excludes);
const tab = router.query.tab as string;

const [activeTab, setActiveTab] = useState<UserMenuTabs>(selected);

useEffect(() => {
setActiveTab(selected);
}, [profileDetail?.id]);

useEffect(() => {
if (tab === 'experience') {
setActiveTab(tab as UserMenuTabs);
router.replace({pathname: `/profile/${profileDetail.id}`, query: {}}, undefined, {
shallow: true,
});
}
}, [router.query]);

return (
<Paper square className={styles.root}>
<TabsComponent<UserMenuTabs>
Expand Down
8 changes: 4 additions & 4 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
},
"Type_Filter": {
"All": "All",
"Friend": "Friend",
"Friend": "Friends",
"Trending": "Trending",
"Experience": "Timeline"
},
Expand Down Expand Up @@ -1188,9 +1188,9 @@
"LimitDescProfile":"is using lite version of Myriad. You can only send a friend request to users with active wallet.",
"LimitTitleExperience":"Create Timeline Limit Reached!",
"LimitTitleFriends":"Unable to Add Friend",
"LimitDescExperience":"You are currently using lite version of Myriad. You can only create up to 5 timeline! Connect Web 3.0 Wallet to create more experience",
"LimitDescFriends":"Connect Web 3.0 Wallet to send friend request.",
"MaybeLater":"Maybe Later",
"LimitDescExperience":"You are currently using lite version of Myriad. You can only create up to 5 timelines! Connect Web 3.0 Wallet to create more timeline",
"LimitDescFriends":"Oops! You need to connect your wallet to do that. Alternatively, you can follow timelines curated by {{username}}",
"ViewTimelines":"View timelines",
"ConnectWallet":"Connect Web 3.0 Wallet",
"DisclaimerEditProfile":"You are currently using lite version of Myriad. You can edit only the display name. Connect Web 3.0 Wallet to have all access in editing your profile",
"LimitTitlePost":"You have {{count}} the remaining posts",
Expand Down
8 changes: 4 additions & 4 deletions src/locale/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -1180,13 +1180,13 @@
"Cancel":"Batal",
"Confirm":"Konfirmasi",
"CreateAccountEmail":"Buat Akun Baru",
"LimitDescProfile":"menggunakan Myriad versi lite. Anda hanya dapat mengirim permintaan pertemanan kepada pengguna dengan dompet aktif.",
"CreateAccountEmailDesc":"Anda akan membuat akun baru. Anda masih dapat menambahkan dompet kripto nanti.",
"LimitDescProfile":"menggunakan Myriad versi lite. Anda hanya dapat mengirim permintaan pertemanan kepada pengguna dengan dompet aktif.",
"LimitTitleExperience":"Batas Buat Pengalaman Tercapai!",
"LimitTitleFriends":"Tidak bisa menambah teman",
"Experience":"Anda sedang menggunakan Myriad versi lite. Anda hanya dapat membuat hingga 5 pengalaman! Hubungkan Dompet Web 3.0 untuk menciptakan lebih banyak pengalaman",
"Friends":"Hubungkan Web 3.0 Wallet untuk mengirim permintaan pertemanan.",
"MaybeLater":"Mungkin Nanti",
"LimitDescExperience":"Anda sedang menggunakan Myriad versi lite. Anda hanya dapat membuat hingga 5 linimasa! Hubungkan Dompet Web 3.0 untuk menciptakan lebih banyak linimasa",
"LimitDescFriends":"Ups! Anda perlu menghubungkan dompet Anda untuk melakukan itu. Atau, Anda dapat mengikuti linimasa yang dikuratori oleh {{username}}",
"ViewTimelines":"Tampilkan linimasa",
"ConnectWallet":"Hubungkan Dompet Web 3.0",
"DisclaimerEditProfile":"Saat ini Anda menggunakan Myriad versi lite. Anda hanya dapat mengedit nama tampilan. Hubungkan Web 3.0 Wallet untuk memiliki semua akses dalam mengedit profil Anda",
"LimitTitlePost":"Anda memiliki {{count}} pos yang tersisa",
Expand Down
6 changes: 3 additions & 3 deletions src/locale/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1167,9 +1167,9 @@
"LimitDescProfile":"использует облегченную версию Myriad. Вы можете отправить запрос на добавление в друзья только пользователям с активным кошельком.",
"LimitTitleExperience":"Невозможно добавить друга",
"LimitTitleFriends":"Не могу добавить друзей",
"Experience":"В настоящее время вы используете облегченную версию Myriad. Вы можете создать только до 5 опыта! Подключите кошелек Web 3.0, чтобы получить больше возможностей",
"Friends":"Подключите кошелек Web 3.0, чтобы отправить запрос на добавление в друзья.",
"MaybeLater":"Может быть позже",
"LimitDescExperience":"В настоящее время вы используете облегченную версию Myriad. Вы можете создать только до 5 опыта! Подключите кошелек Web 3.0, чтобы получить больше опыта",
"LimitDescFriends":"Ой! Для этого вам нужно подключить свой кошелек. Кроме того, вы можете следить за временными рамками, созданными {{username}}",
"ViewTimelines":"Посмотреть сроки",
"ConnectWallet":"Подключить веб-кошелек 3.0",
"DisclaimerEditProfile":"В настоящее время вы используете облегченную версию Myriad. Вы можете редактировать только отображаемое имя. Подключите кошелек Web 3.0, чтобы иметь полный доступ к редактированию своего профиля",
"LimitTitlePost":"У вас {{count}} оставшихся сообщений",
Expand Down

0 comments on commit 0c6f4b3

Please sign in to comment.