Constructor
new Notification(props) → {React.Component}
Parameters:
Name | Type | Description |
---|---|---|
props |
Object | Props including userId and closePanel function. |
- Source:
Returns:
A component displaying user notifications.
- Type
- React.Component
Methods
(static) createNewFollowerEvent(notification) → {Object}
Creates a new follower event from a notification.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Object | The notification object. |
- Source:
Returns:
A formatted event object for a new follower.
- Type
- Object
(static) createSharedFlashcardEvent(notification) → {Object}
Creates a data object for a shared flashcard notification.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Object | The notification object containing flashcard information. |
- Source:
Returns:
A formatted event object for a shared flashcard notification.
- Type
- Object
(static) createSharedQuizEvent(notification) → {Object}
Creates a data object for a shared quiz notification.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Object | The notification object containing quiz information. |
- Source:
Returns:
A formatted event object for a shared quiz notification.
- Type
- Object
(static) handleChangePage(event, newPage)
Handles the pagination change.
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | The event object. |
newPage |
number | The new page number. |
- Source:
(static) parseNotifications(notifications) → {Array}
Parses and processes an array of notification objects.
Parameters:
Name | Type | Description |
---|---|---|
notifications |
Array | An array of notification objects to be processed. |
- Source:
Returns:
An array of formatted notification data objects.
- Type
- Array
(static) timeAgo(timestamp) → {string}
Converts a timestamp to a string indicating time elapsed.
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
number | The timestamp to convert. |
- Source:
Returns:
A string representation of the time elapsed since the timestamp.
- Type
- string
(static) useEffect()
useEffect hook for fetching notifications when the component mounts.
- Source: