Skip to content

Commit 78d2965

Browse files
authored
Recent Activity Navigation (#1037)
* Removed navigation button on recent activity card * fixed linter issue
1 parent c4c8cf7 commit 78d2965

File tree

2 files changed

+3
-63
lines changed

2 files changed

+3
-63
lines changed

src/components/Cards/ActivityCard.tsx

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ import {
66
getActivityOperationIcon,
77
getStatusColor,
88
} from "@/utils/helpers";
9-
import { Box, Button, Card, Group, Stack, Text, Tooltip } from "@mantine/core";
9+
import { Box, Card, Group, Stack, Text, Tooltip } from "@mantine/core";
1010
import { ProfileAvatar } from "../Common";
1111
import { useAuth } from "@/utils/AuthContext";
12-
import { Link } from "react-router-dom";
1312
import { UserActivity } from "@/types/activity";
14-
import { FiCornerDownRight } from "react-icons/fi";
1513

1614
interface ActivityItemProps {
1715
activity: UserActivity;
@@ -60,65 +58,6 @@ export function ActivityItem({ activity }: ActivityItemProps) {
6058
<Text size="sm" mt={4}>
6159
{getActivityDescription(activity.description ?? "")}
6260
</Text>
63-
64-
<Group gap="xs">
65-
{activity.a_project_id && (
66-
<Button
67-
variant="light"
68-
size="xs"
69-
color="blue"
70-
component={Link}
71-
to={`/projects/${activity.a_project_id}`}
72-
>
73-
<Group gap={4}>
74-
<FiCornerDownRight />
75-
View Project
76-
</Group>
77-
</Button>
78-
)}
79-
{activity.a_db_id && (
80-
<Button
81-
variant="light"
82-
size="xs"
83-
color="blue"
84-
component={Link}
85-
to={`/profile/${activity.a_db_id}`}
86-
>
87-
<Group gap={4}>
88-
<FiCornerDownRight />
89-
View Database
90-
</Group>
91-
</Button>
92-
)}
93-
{activity.a_app_id && (
94-
<Button
95-
variant="light"
96-
size="xs"
97-
color="blue"
98-
component={Link}
99-
to={`/projects/${activity.a_project_id}/apps/${activity.a_app_id}`}
100-
>
101-
<Group gap={4}>
102-
<FiCornerDownRight />
103-
View App
104-
</Group>
105-
</Button>
106-
)}
107-
{activity.operation === "Follow" && activity.a_user_id && (
108-
<Button
109-
variant="light"
110-
size="xs"
111-
color="blue"
112-
component={Link}
113-
to={`/profile/${activity.a_user_id}`}
114-
>
115-
<Group gap={4}>
116-
<FiCornerDownRight />
117-
View Profile
118-
</Group>
119-
</Button>
120-
)}
121-
</Group>
12261
</Stack>
12362
</Card>
12463
);

src/utils/helpers.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,8 @@ export const getActivityOperationIcon = (activity: UserActivity) => {
645645
// User activity relative date helper
646646
export function formatRelativeDate(dateString: string) {
647647
try {
648-
return formatDistanceToNowStrict(parseISO(dateString), { addSuffix: true });
648+
const normalized = dateString.endsWith("Z") ? dateString : `${dateString}Z`;
649+
return formatDistanceToNowStrict(parseISO(normalized), { addSuffix: true });
649650
} catch {
650651
return dateString;
651652
}

0 commit comments

Comments
 (0)