2022-12-18 14:51:47 +00:00
|
|
|
import { useSelector } from "react-redux";
|
2023-01-04 13:23:05 +00:00
|
|
|
import { Link } from "react-router-dom";
|
2022-12-29 22:23:41 +00:00
|
|
|
import { NoteCreator } from "../element/NoteCreator";
|
2023-01-04 13:23:05 +00:00
|
|
|
import Timeline from "../element/Timeline";
|
2022-12-18 14:51:47 +00:00
|
|
|
|
|
|
|
export default function RootPage() {
|
2023-01-02 11:59:03 +00:00
|
|
|
const [loggedOut, pubKey, follows] = useSelector(s => [s.login.loggedOut, s.login.publicKey, s.login.follows]);
|
|
|
|
|
2022-12-29 22:23:41 +00:00
|
|
|
function followHints() {
|
|
|
|
if (follows?.length === 0 && pubKey) {
|
2023-01-04 13:23:05 +00:00
|
|
|
return <>
|
|
|
|
Hmm nothing here.. Checkout <Link to={"/new"}>New users page</Link> to follow some recommended nostrich's!
|
|
|
|
</>
|
2022-12-29 22:23:41 +00:00
|
|
|
}
|
2022-12-18 14:51:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2022-12-29 22:23:41 +00:00
|
|
|
{pubKey ? <NoteCreator /> : null}
|
|
|
|
{followHints()}
|
2023-01-04 13:23:05 +00:00
|
|
|
<Timeline pubkeys={follows} global={loggedOut === true} />
|
2022-12-18 14:51:47 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|