diff --git a/src/components/catalog/CatalogClassicView.tsx b/src/components/catalog/CatalogClassicView.tsx index 1ee04f2..9df060e 100644 --- a/src/components/catalog/CatalogClassicView.tsx +++ b/src/components/catalog/CatalogClassicView.tsx @@ -252,7 +252,8 @@ const CatalogClassicViewInner: FC<{}> = () =>
) to a tab so other views
+// (e.g. the profile "Change Badges" button) can deep-link to a specific tab.
+const TAB_BY_CODE: Record = {
+ furni: TAB_FURNITURE, furniture: TAB_FURNITURE,
+ pets: TAB_PETS, badges: TAB_BADGES,
+ prefixes: TAB_PREFIXES, bots: TAB_BOTS
+};
const UNSEEN_CATEGORIES = [ UnseenItemCategory.FURNI, UnseenItemCategory.PET, UnseenItemCategory.BADGE, UnseenItemCategory.PREFIX, UnseenItemCategory.BOT ];
const TAB_ICONS: Record = {
[TAB_FURNITURE]: ,
@@ -94,12 +101,14 @@ export const InventoryView: FC<{}> = props =>
{
case 'show':
setIsVisible(true);
+ if(parts[2] && TAB_BY_CODE[parts[2]]) setCurrentTab(TAB_BY_CODE[parts[2]]);
return;
case 'hide':
setIsVisible(false);
return;
case 'toggle':
setIsVisible(prevValue => !prevValue);
+ if(parts[2] && TAB_BY_CODE[parts[2]]) setCurrentTab(TAB_BY_CODE[parts[2]]);
return;
}
},
diff --git a/src/components/navigator/NavigatorView.tsx b/src/components/navigator/NavigatorView.tsx
index b93b8d5..8daf79b 100644
--- a/src/components/navigator/NavigatorView.tsx
+++ b/src/components/navigator/NavigatorView.tsx
@@ -22,7 +22,7 @@ export const NavigatorView: FC<{}> = props =>
{
const { topLevelContext, topLevelContexts, navigatorData, navigatorSearches } = useNavigatorData();
const { searchResult, isFetching } = useNavigatorSearch();
- const { isVisible, isCreatorOpen, isRoomInfoOpen, isRoomLinkOpen, isOpenSavesSearches, needsInit } = useNavigatorUiState();
+ const { isVisible, isCreatorOpen, isRoomInfoOpen, isRoomLinkOpen, isOpenSavesSearches, needsInit, currentTabCode } = useNavigatorUiState();
const elementRef = useRef(null);
useNitroEvent(RoomSessionEvent.CREATED, event =>
@@ -122,7 +122,7 @@ export const NavigatorView: FC<{}> = props =>
{ topLevelContexts && topLevelContexts.length > 0 && topLevelContexts.map((context, index) =>
useNavigatorUiStore.getState().setTab(context.code) }>
{ LocalizeText('navigator.toplevelview.' + context.code) }
) }
diff --git a/src/components/user-profile/RelationshipsContainerView.tsx b/src/components/user-profile/RelationshipsContainerView.tsx
index 4de625a..204eb2b 100644
--- a/src/components/user-profile/RelationshipsContainerView.tsx
+++ b/src/components/user-profile/RelationshipsContainerView.tsx
@@ -1,6 +1,6 @@
import { RelationshipStatusEnum, RelationshipStatusInfoMessageParser } from '@nitrots/nitro-renderer';
import { FC } from 'react';
-import { GetUserProfile, LocalizeText } from '../../api';
+import { CreateLinkEvent, GetUserProfile, LocalizeText } from '../../api';
import { Flex, LayoutAvatarImageView } from '../../common';
interface RelationshipsContainerViewProps
@@ -29,7 +29,7 @@ export const RelationshipsContainerView: FC = p
- (relationshipInfo && (relationshipInfo.randomFriendId >= 1) && GetUserProfile(relationshipInfo.randomFriendId)) }>
+
((relationshipInfo && (relationshipInfo.randomFriendId >= 1)) ? GetUserProfile(relationshipInfo.randomFriendId) : CreateLinkEvent('friends/toggle')) }>
{ (!relationshipInfo || (relationshipInfo.friendCount === 0)) &&
LocalizeText('extendedprofile.add.friends') }
{ (relationshipInfo && (relationshipInfo.friendCount >= 1)) &&
@@ -37,7 +37,7 @@ export const RelationshipsContainerView: FC = p
{ (relationshipInfo && (relationshipInfo.friendCount >= 1)) &&
-
+
}
diff --git a/src/components/user-profile/UserContainerView.tsx b/src/components/user-profile/UserContainerView.tsx
index 73b3ca2..e4e6b43 100644
--- a/src/components/user-profile/UserContainerView.tsx
+++ b/src/components/user-profile/UserContainerView.tsx
@@ -60,18 +60,12 @@ export const UserContainerView: FC = props =>
prefixText={ userProfile.prefixText }
username={ userProfile.username } />
{ userProfile.motto || '\u00A0' }
-
-
+
+ { LocalizeText('extendedprofile.created').replace(/%\w+%/g, '').trim() } { userProfile.registration }
+
+
+ { LocalizeText('extendedprofile.last.login').replace(/%\w+%/g, '').trim() } { FriendlyTime.format(userProfile.secondsSinceLastVisit, '.ago', 2) }
+
{ LocalizeText('extendedprofile.achievementscore') } { userProfile.achievementPoints }
@@ -100,10 +94,10 @@ export const UserContainerView: FC = props =>
{ isOwnProfile &&
- }
@@ -148,11 +142,11 @@ export const UserContainerView: FC = props =>
{ LocalizeText('inventory.badges') }
{ totalBadges }
-
+ CreateLinkEvent('achievements/toggle') }>
{ LocalizeText('extendedprofile.achievementscore') }
{ userProfile.achievementPoints }
-
+