Skip to main content

Activities

This package is a part of the "self-contained" domain in the cross-platform-components mono repo.

ActivityItem

ActivityItem Component for displaying an activity for an activity feed.

This package includes:

  • The main activity item component that accepts an activity data object (You can use this component to build a feed of Activities)
  • The function helpers that create activity object structures.

The type structure of the activity object that is accepted by the ActivityItem is as follows:

dateTime: Date
daysSinceCreation?: number
description: React.ReactChild
expandedContent?: React.ReactChild,
iconColor?: string
link?: string
fetchDetails?: any,
title: React.ReactChild
type: ActivityTypes

There are helper functions exported and available through this package in order to create the above object structure. They can be found in shared/activities/src/ActivityItem/components/activity-item-types

Here is an example of the activity parameter those functions accept

dateTime: Date
daysSinceCreation?: number
id: string
occurredAt?: string
personName: string
staticData: object (This is varied between activity types such as call, note, sent email etc...)
dynamicData: object (This is varied between activity types such as call, note, sent email etc...)
type: string

The current supported activity item types are:

  • Note
  • Call
  • Sent Email
  • Email Reply
  • Meeting Booked

Additionally there are CRM / Opportunity activity types:

  • Stage Change
  • Amount Change
  • Closed Date Change

Adding a new activity type

When adding a new activity type be sure to add a helper function file for the creation of the activity object that the ActivityItem accepts. Those should be added here: self-contained/activities/src/ActivityItem/components/activity-item-types

If new components are needed such as buttons or further info block please create new components and conditionally use.