-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a notification for new turn starting
- Loading branch information
Showing
5 changed files
with
57 additions
and
3 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 |
---|---|---|
|
@@ -4,3 +4,8 @@ | |
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.faIcon { | ||
margin-top: 2px; | ||
color: var(--foreground-color); | ||
} |
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,30 @@ | ||
import { Alert } from "@mui/material" | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { faHourglass } from '@fortawesome/free-regular-svg-icons' | ||
import ActionLog from "@/classes/ActionLog" | ||
import styles from "./ActionLog.module.css" | ||
|
||
interface NotificationProps { | ||
notification: ActionLog | ||
} | ||
|
||
// Notification for when a senator dies during the mortality phase | ||
const NewTurnNotification = ({ notification } : NotificationProps) => { | ||
// Get notification-specific data | ||
const turnIndex = notification.data?.turn_index ?? null | ||
|
||
const getIcon = () => ( | ||
<div className={`${styles.icon} ${styles.faIcon}`}> | ||
<FontAwesomeIcon icon={faHourglass} /> | ||
</div> | ||
) | ||
|
||
return ( | ||
<Alert icon={getIcon()} style={{backgroundColor: 'var(--background-color-neutral)'}}> | ||
<b>New Turn</b> | ||
<p>Turn {turnIndex} has started.</p> | ||
</Alert> | ||
) | ||
} | ||
|
||
export default NewTurnNotification |