moonstream/frontend/pages/stream/index.js

69 wiersze
2.0 KiB
JavaScript

2021-08-13 11:35:31 +00:00
import React, { useContext, useEffect } from "react";
2021-07-19 11:50:35 +00:00
import { getLayout } from "../../src/layouts/EntriesLayout";
2021-08-13 11:01:38 +00:00
import StreamEntryDetails from "../../src/components/SteamEntryDetails";
import UIContext from "../../src/core/providers/UIProvider/context";
import {
Box,
Heading,
Text,
Stack,
UnorderedList,
ListItem,
} from "@chakra-ui/react";
2021-08-18 16:57:14 +00:00
import RouteButton from "../../src/components/RouteButton";
2021-07-19 11:50:35 +00:00
const Entry = () => {
2021-08-18 14:08:19 +00:00
console.count("render stream!");
2021-08-13 11:01:38 +00:00
const ui = useContext(UIContext);
2021-08-13 11:35:31 +00:00
useEffect(() => {
if (typeof window !== "undefined") {
if (ui.currentTransaction) {
document.title = `Stream details: ${ui.currentTransaction.hash}`;
} else {
document.title = `Stream`;
}
}
}, [ui.currentTransaction]);
2021-08-13 11:01:38 +00:00
if (ui.currentTransaction) {
return <StreamEntryDetails />;
} else
return (
<Box px="7%" pt={12}>
<>
<Stack direction="column">
<Heading>Stream view</Heading>
<Text>
In this view you can follow events that happen on your subscribed
addresses
</Text>
<UnorderedList pl={4}>
<ListItem>
Click filter icon on right top corner to filter by specific
address across your subscriptions
</ListItem>
<ListItem>
On event cards you can click at right corner to see detailed
view!
</ListItem>
<ListItem>
For any adress of interest here you can copy it and subscribe at
subscription screen
</ListItem>
</UnorderedList>
2021-08-18 16:57:14 +00:00
<RouteButton
variant="solid"
size="md"
colorScheme="suggested"
href="/welcome"
>
Learn how to use moonstream
</RouteButton>
2021-08-13 11:01:38 +00:00
</Stack>
</>
</Box>
);
2021-07-19 11:50:35 +00:00
};
Entry.getLayout = getLayout;
export default Entry;