feat: two way collab

This commit is contained in:
vilm3r
2022-06-23 18:36:56 -05:00
parent f17c4b8a1d
commit 819d8210ea
9 changed files with 219 additions and 106 deletions

View File

@@ -6,14 +6,13 @@ import { Button } from "../components/button"
import { Card } from "../components/card"
import { SendView } from "../views/send"
import { ReceiveView } from "../views/receive"
import { NostrEventType, NostrType } from "../types"
import { NostrKeysType } from "../types"
type HomeProps = {
nostr: NostrType
event: NostrEventType
keys: NostrKeysType
}
export default function Home({ nostr, event }: HomeProps) {
export default function Home({ keys }: HomeProps) {
const [clientType, setClientType] = useState("")
const LandingView = () => (
@@ -46,9 +45,9 @@ export default function Home({ nostr, event }: HomeProps) {
const Page = () => {
switch (true) {
case clientType === "send":
return <SendView nostr={nostr} />
return <SendView keys={keys} />
case clientType === "receive":
return <ReceiveView nostr={nostr} event={event} />
return <ReceiveView keys={keys} />
default:
return <LandingView />
}