From cc1780bd01dca69c00ced2d1c2280958f5d8bd03 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Fri, 28 Feb 2025 09:34:59 +0000 Subject: [PATCH] refactor: extract ActivityListItem into separate component - Move activity list item markup from HomeView to new component - Improve code organization and reusability - Pass required props for claim handling and image viewing - Maintain existing functionality while reducing component complexity - Clean up unused commented code in HomeView This refactor improves code maintainability by extracting the activity feed item logic into its own component. --- src/components/ActivityListItem.vue | 185 +++++++++++++++++++++++ src/types/index.ts | 20 +++ src/views/HomeView.vue | 226 ++-------------------------- 3 files changed, 216 insertions(+), 215 deletions(-) create mode 100644 src/components/ActivityListItem.vue create mode 100644 src/types/index.ts diff --git a/src/components/ActivityListItem.vue b/src/components/ActivityListItem.vue new file mode 100644 index 0000000..37b84a2 --- /dev/null +++ b/src/components/ActivityListItem.vue @@ -0,0 +1,185 @@ + + + \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..fcb53b1 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,20 @@ +export interface GiveRecordWithContactInfo { + jwtId: string; + fullClaim: any; // Replace with proper type + giver: { + known: boolean; + displayName: string; + profileImageUrl?: string; + }; + receiver: { + known: boolean; + displayName: string; + profileImageUrl?: string; + }; + providerPlanName?: string; + recipientProjectName?: string; + description?: string; + subDescription?: string; + image?: string; + timestamp: string; +} \ No newline at end of file diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 781c66d..a5eea85 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -250,221 +250,15 @@
@@ -506,6 +300,7 @@ import TopMessage from "../components/TopMessage.vue"; import UserNameDialog from "../components/UserNameDialog.vue"; import ChoiceButtonDialog from "../components/ChoiceButtonDialog.vue"; import ImageViewer from "../components/ImageViewer.vue"; +import ActivityListItem from "../components/ActivityListItem.vue"; import { AppString, NotificationIface, @@ -572,6 +367,7 @@ interface GiveRecordWithContactInfo extends GiveSummaryRecord { TopMessage, UserNameDialog, ImageViewer, + ActivityListItem, }, }) export default class HomeView extends Vue {