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-01-22 11:17:50 +00:00
|
|
|
import { HexKey } from "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-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();
|
|
|
|
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 (
|
|
|
|
<>
|
|
|
|
{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"}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|