-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from CMP26Projects/Alert-Front-End
Alert front end
- Loading branch information
Showing
15 changed files
with
363 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.notificationBox { | ||
margin-bottom: 8rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
import "../../assets/styles/components/NotificationBox.scss"; | ||
import '../../assets/styles/components/NotificationBox.scss' | ||
import { useGetAllAlertsQuery } from '../../redux/slices/alertApiSlice' | ||
import Alert from './Alerts' | ||
|
||
export default function NotificationBox() { | ||
return ( | ||
<div style={{ textAlign: "center", marginBlock: "1rem" }}> | ||
سيتم العمل على هذا القسم قريباً | ||
</div> | ||
); | ||
const { data: alerts, isFetching: isFetchingAlerts } = useGetAllAlertsQuery( | ||
{ status: 'unread', contentType: 'all' } | ||
) | ||
|
||
return ( | ||
<div className="notificationBox"> | ||
{isFetchingAlerts | ||
? 'جاري التحميل' | ||
: alerts?.body?.length === 0 | ||
? 'لا يوجد إشعارات' | ||
: alerts?.body?.map((alert) => { | ||
return ( | ||
<Alert | ||
key={alert.notificationId} | ||
title={'إشعار ' + alert.notificationId} | ||
info={alert.message} | ||
buttontext={'عرض المزيد'} | ||
Onclick={alert.onClick} | ||
showRightBox={true} | ||
color={ | ||
alert.contentType == 'attendance' | ||
? 'red' | ||
: 'mint-green' | ||
} | ||
/> | ||
) | ||
})} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import PageTitle from '../common/PageTitle' | ||
import Alert from '../common/Alerts' | ||
import './notificationPage.scss' | ||
import { useGetAllAlertsQuery } from '../../redux/slices/alertApiSlice' | ||
|
||
export default function SendNotificationPage() { | ||
const { data: alerts, isFetching: isFetchingAlerts } = useGetAllAlertsQuery( | ||
{ status: 'all', contentType: 'all' } | ||
) | ||
|
||
return ( | ||
<div className="notifications container"> | ||
<PageTitle title="الرسائل الواردة" /> | ||
<div className="notificationBox"> | ||
{isFetchingAlerts | ||
? 'جاري التحميل' | ||
: alerts?.body?.length === 0 | ||
? 'لا يوجد إشعارات' | ||
: alerts?.body?.map((alert) => { | ||
return ( | ||
<Alert | ||
key={alert.notificationId} | ||
title={'إشعار ' + alert.notificationId} | ||
info={alert.message} | ||
buttontext={'عرض المزيد'} | ||
Onclick={alert.onClick} | ||
showRightBox={true} | ||
color={ | ||
alert.contentType == 'attendance' | ||
? 'red' | ||
: 'mint-green' | ||
} | ||
/> | ||
) | ||
})} | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.notifications { | ||
.notificationBox { | ||
margin-bottom: 8rem; | ||
} | ||
} |
Oops, something went wrong.