2023-01-20 17:07:14 +00:00
|
|
|
import "./Index.css";
|
2023-02-08 21:10:26 +00:00
|
|
|
import { FormattedMessage } from "react-intl";
|
2023-01-27 21:10:14 +00:00
|
|
|
import { useDispatch } from "react-redux";
|
|
|
|
import { useNavigate } from "react-router-dom";
|
2023-03-02 17:47:15 +00:00
|
|
|
import Icon from "Icons/Icon";
|
2023-01-27 21:10:14 +00:00
|
|
|
import { logout } from "State/Login";
|
|
|
|
|
2023-02-08 21:10:26 +00:00
|
|
|
import messages from "./messages";
|
|
|
|
|
2023-01-20 17:07:14 +00:00
|
|
|
const SettingsIndex = () => {
|
2023-02-07 20:04:50 +00:00
|
|
|
const dispatch = useDispatch();
|
|
|
|
const navigate = useNavigate();
|
2023-01-20 17:07:14 +00:00
|
|
|
|
2023-02-07 20:04:50 +00:00
|
|
|
function handleLogout() {
|
|
|
|
dispatch(logout());
|
2023-02-28 19:33:47 +00:00
|
|
|
window.location.href = "/";
|
2023-02-07 20:04:50 +00:00
|
|
|
}
|
2023-01-27 21:10:14 +00:00
|
|
|
|
2023-02-07 20:04:50 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div className="settings-nav">
|
|
|
|
<div className="settings-row" onClick={() => navigate("profile")}>
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="profile" />
|
|
|
|
<FormattedMessage {...messages.Profile} />
|
|
|
|
<Icon name="arrowFront" />
|
2023-01-20 17:07:14 +00:00
|
|
|
</div>
|
2023-02-07 20:04:50 +00:00
|
|
|
<div className="settings-row" onClick={() => navigate("relays")}>
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="relay" />
|
2023-02-08 21:10:26 +00:00
|
|
|
<FormattedMessage {...messages.Relays} />
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="arrowFront" />
|
2023-02-07 20:04:50 +00:00
|
|
|
</div>
|
|
|
|
<div className="settings-row" onClick={() => navigate("preferences")}>
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="gear" />
|
2023-02-08 21:10:26 +00:00
|
|
|
<FormattedMessage {...messages.Preferences} />
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="arrowFront" />
|
2023-02-07 20:04:50 +00:00
|
|
|
</div>
|
2023-03-02 15:23:53 +00:00
|
|
|
<div className="settings-row" onClick={() => navigate("wallet")}>
|
2023-03-02 18:46:15 +00:00
|
|
|
<Icon name="bitcoin" />
|
2023-03-02 15:23:53 +00:00
|
|
|
<FormattedMessage defaultMessage="Wallet" />
|
2023-03-02 18:46:15 +00:00
|
|
|
<Icon name="arrowFront" />
|
2023-03-02 15:23:53 +00:00
|
|
|
</div>
|
2023-02-07 20:04:50 +00:00
|
|
|
<div className="settings-row" onClick={() => navigate("/donate")}>
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="heart" />
|
2023-02-09 12:57:52 +00:00
|
|
|
<FormattedMessage {...messages.Donate} />
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="arrowFront" />
|
2023-02-07 20:04:50 +00:00
|
|
|
</div>
|
|
|
|
<div className="settings-row" onClick={handleLogout}>
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="logout" />
|
2023-02-08 21:10:26 +00:00
|
|
|
<FormattedMessage {...messages.LogOut} />
|
2023-03-02 17:59:16 +00:00
|
|
|
<Icon name="arrowFront" />
|
2023-02-07 20:04:50 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
2023-01-20 17:07:14 +00:00
|
|
|
|
2023-02-05 22:44:31 +00:00
|
|
|
export default SettingsIndex;
|