2023-01-22 11:17:50 +00:00
|
|
|
import { useEffect } from "react";
|
2023-02-07 20:04:50 +00:00
|
|
|
import { useDispatch, useSelector } from "react-redux";
|
2023-02-11 20:05:46 +00:00
|
|
|
import { HexKey } from "@snort/nostr";
|
2023-01-20 11:11:50 +00:00
|
|
|
import { markNotificationsRead } from "State/Login";
|
|
|
|
import { RootState } from "State/Store";
|
2023-01-22 11:17:50 +00:00
|
|
|
import Timeline from "Element/Timeline";
|
2023-03-03 11:45:47 +00:00
|
|
|
import { TaskList } from "Tasks/TaskList";
|
2023-01-02 11:15:13 +00:00
|
|
|
|
2022-12-30 23:35:02 +00:00
|
|
|
export default function NotificationsPage() {
|
2023-02-07 20:04:50 +00:00
|
|
|
const dispatch = useDispatch();
|
2023-02-09 12:26:54 +00:00
|
|
|
const pubkey = useSelector<RootState, HexKey | undefined>(s => s.login.publicKey);
|
2023-01-02 11:15:13 +00:00
|
|
|
|
2023-02-07 20:04:50 +00:00
|
|
|
useEffect(() => {
|
|
|
|
dispatch(markNotificationsRead());
|
|
|
|
}, []);
|
2023-01-02 11:15:13 +00:00
|
|
|
|
2023-02-07 20:04:50 +00:00
|
|
|
return (
|
|
|
|
<>
|
2023-03-03 11:45:47 +00:00
|
|
|
<div className="main-content">
|
|
|
|
<TaskList />
|
|
|
|
</div>
|
2023-02-07 20:04:50 +00:00
|
|
|
{pubkey && (
|
|
|
|
<Timeline
|
|
|
|
subject={{
|
|
|
|
type: "ptag",
|
2023-02-07 19:47:57 +00:00
|
|
|
items: [pubkey],
|
|
|
|
discriminator: pubkey.slice(0, 12),
|
2023-02-07 20:04:50 +00:00
|
|
|
}}
|
|
|
|
postsOnly={false}
|
|
|
|
method={"TIME_RANGE"}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|