2021-04-25 15:22:52 +00:00
|
|
|
import React, { useContext } from "react"
|
2021-04-21 16:21:30 +00:00
|
|
|
import Style from "./PageSettings.module.css"
|
|
|
|
import classNames from "classnames"
|
2021-04-23 00:24:38 +00:00
|
|
|
import BoxHeader from "../components/BoxHeader"
|
2021-04-23 00:26:16 +00:00
|
|
|
import BoxFull from "../components/BoxFull"
|
2021-04-21 16:58:14 +00:00
|
|
|
import SelectTheme from "../components/SelectTheme"
|
2021-04-25 15:22:52 +00:00
|
|
|
import ContextLogin from "../contexts/ContextLogin"
|
|
|
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
|
|
|
|
import { faSignOutAlt, faUser } from "@fortawesome/free-solid-svg-icons"
|
|
|
|
import Button from "../components/Button"
|
|
|
|
import LoggedInUser from "../components/LoggedInUser"
|
|
|
|
import { useHistory } from "react-router"
|
2021-04-21 16:21:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
export default function PageSettings({ children, className, ...props }) {
|
2021-04-25 15:22:52 +00:00
|
|
|
const {logout} = useContext(ContextLogin)
|
|
|
|
const history = useHistory()
|
|
|
|
|
2021-04-21 16:21:30 +00:00
|
|
|
return (
|
|
|
|
<div className={classNames(Style.PageSettings, className)} {...props}>
|
2021-04-25 15:22:52 +00:00
|
|
|
<BoxFull header={"Logged in"}>
|
|
|
|
<div>
|
|
|
|
You are currently logged in as <LoggedInUser/>.
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<Button color={"Red"} onClick={e => {
|
|
|
|
logout()
|
|
|
|
history.push("/login")
|
|
|
|
}} icon={faSignOutAlt}>Logout</Button>
|
|
|
|
</div>
|
|
|
|
</BoxFull>
|
2021-04-23 00:24:38 +00:00
|
|
|
<BoxHeader>
|
2021-04-21 16:58:14 +00:00
|
|
|
Switch theme: <SelectTheme/>
|
2021-04-23 00:24:38 +00:00
|
|
|
</BoxHeader>
|
2021-04-23 00:26:16 +00:00
|
|
|
<BoxFull header={"Alert settings"}>
|
2021-04-25 15:22:52 +00:00
|
|
|
🚧 Not implemented.
|
|
|
|
</BoxFull>
|
|
|
|
<BoxFull header={"Change your email address"}>
|
|
|
|
🚧 Not implemented.
|
2021-04-23 00:26:16 +00:00
|
|
|
</BoxFull>
|
|
|
|
<BoxFull header={"Change your password"}>
|
2021-04-25 15:22:52 +00:00
|
|
|
🚧 Not implemented.
|
2021-04-23 00:26:16 +00:00
|
|
|
</BoxFull>
|
2021-04-21 16:21:30 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|