Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
refactor: add friend notification interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pupixipup committed Mar 3, 2024
1 parent 86b5f19 commit 44f4bf9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/src/widgets/sidebar/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './notification';
17 changes: 17 additions & 0 deletions client/src/widgets/sidebar/interfaces/notification.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { IUserResponse, Identifiable, Timestamps } from '@teameights/types';

interface INotificationBase extends Identifiable, Timestamps {
receiver: IUserResponse;
type: 'system' | 'friend_request';
read: boolean;
createdAt: Date;
updatedAt: Date;
}

export interface IFriendNotification extends INotificationBase {
type: 'friend_request';
data: {
status: string;
creator: IUserResponse;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import React from 'react';
import { SidebarSystemNotification } from './system-notification';

import styles from './notification-item.module.scss';
import { NotificationType } from '@teameights/types';
import { SidebarFriendNotification } from './friend-notification';
import { ISystemNotification } from '@teameights/types';
import { IFriendNotification } from '../../interfaces';

export interface NotificationProps {
/**
* The notification object.
*/
notification: NotificationType;
notification: ISystemNotification | IFriendNotification;
/**
* A function to close the notifications modal.
*/
Expand Down

0 comments on commit 44f4bf9

Please sign in to comment.