Skip to content

Commit

Permalink
GAL-4169 rename Activity tab to Posts (#1980)
Browse files Browse the repository at this point in the history
* rename Activity tab to Posts

* include web changes
  • Loading branch information
kaitoo1 authored Oct 2, 2023
1 parent edd0cb2 commit 87a5fcc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 24 deletions.
11 changes: 3 additions & 8 deletions apps/mobile/src/components/ProfileView/ProfileView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ export function ProfileView({ queryRef, shouldShowBackButton }: ProfileViewProps
<View className="flex flex-row items-center justify-between pt-4">
<View className="flex flex-row">
<ConnectedProfilePicture queryRef={query} />

<ProfileViewUsername queryRef={query} />
</View>

<EditProfileButton queryRef={query} />
</View>
</View>
Expand All @@ -96,18 +94,15 @@ export function ProfileView({ queryRef, shouldShowBackButton }: ProfileViewProps
<Tabs.Tab name="Featured">
<ProfileViewFeaturedTab queryRef={query} />
</Tabs.Tab>

<Tabs.Tab name="Galleries">
<ProfileViewGalleriesTab queryRef={query} />
</Tabs.Tab>

<Tabs.Tab name="Posts">
<ProfileViewActivityTab queryRef={query} />
</Tabs.Tab>
<Tabs.Tab name="Followers">
<ProfileViewFollowersTab queryRef={query} />
</Tabs.Tab>

<Tabs.Tab name="Activity">
<ProfileViewActivityTab queryRef={query} />
</Tabs.Tab>
</GalleryTabsContainer>
</View>
</View>
Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/src/components/ProfileView/ProfileViewHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ export function ProfileViewHeader({ queryRef, selectedRoute, onRouteChange }: Pr
counter: totalGalleries,
},
{
name: 'Followers',
counter: totalFollowers,
name: 'Posts',
},
{
name: 'Activity',
name: 'Followers',
counter: totalFollowers,
},
];
}, [totalGalleries, totalFollowers]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ITEMS_PER_PAGE, MAX_PIECES_DISPLAYED_PER_FEED_EVENT } from '~/component
import { NOTES_PER_PAGE } from '~/components/Feed/Socialize/CommentsModal/CommentsModal';
import { GalleryNavbar } from '~/contexts/globalLayout/GlobalNavbar/GalleryNavbar/GalleryNavbar';
import { StandardSidebar } from '~/contexts/globalLayout/GlobalSidebar/StandardSidebar';
import { activityQuery } from '~/generated/activityQuery.graphql';
import { postsQuery } from '~/generated/postsQuery.graphql';
import { MetaTagProps } from '~/pages/_app';
import GalleryRoute from '~/scenes/_Router/GalleryRoute';
import UserActivityPage from '~/scenes/UserActivityPage/UserActivityPage';
Expand All @@ -16,8 +16,8 @@ import GalleryViewEmitter from '~/shared/components/GalleryViewEmitter';
import { PreloadQueryArgs } from '~/types/PageComponentPreloadQuery';
import { openGraphMetaTags } from '~/utils/openGraphMetaTags';

const activityQueryNode = graphql`
query activityQuery(
const postsQueryNode = graphql`
query postsQuery(
$username: String!
$interactionsFirst: Int!
$interactionsAfter: String
Expand All @@ -41,11 +41,11 @@ const NON_EXISTENT_FEED_EVENT_ID = 'some-non-existent-feed-event-id';

type UserActivityProps = MetaTagProps & {
username: string;
preloadedQuery: PreloadedQuery<activityQuery>;
preloadedQuery: PreloadedQuery<postsQuery>;
};

export default function UserFeed({ username, preloadedQuery }: UserActivityProps) {
const query = usePreloadedQuery<activityQuery>(activityQueryNode, preloadedQuery);
const query = usePreloadedQuery<postsQuery>(postsQueryNode, preloadedQuery);

return (
<GalleryRoute
Expand All @@ -63,9 +63,9 @@ export default function UserFeed({ username, preloadedQuery }: UserActivityProps

UserFeed.preloadQuery = ({ relayEnvironment, query }: PreloadQueryArgs) => {
if (query.username && typeof query.username === 'string' && !Array.isArray(query.eventId)) {
return loadQuery<activityQuery>(
return loadQuery<postsQuery>(
relayEnvironment,
activityQueryNode,
postsQueryNode,
{
topEventId: query.eventId ?? NON_EXISTENT_FEED_EVENT_ID,
username: query.username,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Notifications/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function Notification({ notificationRef, queryRef, toggleSubView }: Notif
showCaret: false,
handleClick: function navigateToUserActivityWithFeedEventAtTop() {
if (username && eventId) {
push({ pathname: '/[username]/activity', query: { username, eventId } });
push({ pathname: '/[username]/posts', query: { username, eventId } });
}
hideDrawer();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function GalleryNavLinks({ username, queryRef }: Props) {
const featuredRoute: Route = { pathname: '/[username]', query: { username } };
const galleriesRoute: Route = { pathname: '/[username]/galleries', query: { username } };
const followersRoute: Route = { pathname: '/[username]/followers', query: { username } };
const activityRoute: Route = { pathname: '/[username]/activity', query: { username } };
const postsRoute: Route = { pathname: '/[username]/posts', query: { username } };

return (
<HStack gap={8}>
Expand All @@ -71,10 +71,10 @@ export function GalleryNavLinks({ username, queryRef }: Props) {

<NavbarLink
// @ts-expect-error We're not using the legacy Link
href={route(activityRoute)}
active={pathname === activityRoute.pathname}
href={route(postsRoute)}
active={pathname === postsRoute.pathname}
>
Activity
Posts
</NavbarLink>

<NavbarLink
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/scenes/UserActivityPage/UserActivityFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function UserActivityFeed({ userRef, queryRef }: Props) {
return (
<EmptyState
title={"It's quiet in here"}
description="This user doesn't seem to have any activity yet."
description="This user doesn't seem to have any posts yet."
/>
);
}
Expand Down

0 comments on commit 87a5fcc

Please sign in to comment.