-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds frontend support for notifications (#334)
* adds frontend support for notifications * js lint fixes
- Loading branch information
1 parent
4923be0
commit bdaaaf6
Showing
5 changed files
with
83 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import { connect } from "react-redux"; | ||
import "react-dom"; | ||
|
||
import { withShortcut } from "react-keybind"; | ||
import Modal from "react-modal"; | ||
import clsx from "clsx"; | ||
|
||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons"; | ||
|
||
function Notifications(props) { | ||
const { notificationText } = window; | ||
|
||
const [hidden, setHidden] = useState(notificationText === ""); | ||
|
||
return ( | ||
<div className={clsx("notifications", { hidden })}> | ||
<div className="notifications-container"> | ||
<div className="notification-icon"> | ||
<FontAwesomeIcon icon={faExclamationTriangle} /> | ||
</div> | ||
<div className="notification-body">{notificationText}</div> | ||
<div | ||
className="notification-close-btn" | ||
onClick={function () { | ||
setHidden(true); | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default connect((x) => x, {})(Notifications); |
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