-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refacto * fix website build * build package nostr_sdk * fix vercel * change package json * fix afk lib * delete config expo on afk * add lib package jsx * change tsconfig * fix dist build * tsconfig + add zutsand in web * tsconfig + add zutsand in web * add zutsand * umd react * add package afk_nostr_sdk + fix config turbo & tsconfig * lint fix
- Loading branch information
Showing
50 changed files
with
991 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import './index.css'; | ||
import type { Metadata } from 'next'; | ||
|
||
import type {Metadata} from 'next'; | ||
|
||
import Providers from './providers'; | ||
|
||
export const metadata: Metadata = { | ||
title: 'afk community portal', | ||
description: 'afk community portal', | ||
}; | ||
import { AppProps } from 'next/app'; | ||
import {AppProps} from 'next/app'; | ||
|
||
function MyApp({ Component, pageProps }: AppProps) { | ||
return ( | ||
<Providers> | ||
<Component {...pageProps} /> | ||
</Providers> | ||
); | ||
function MyApp({Component, pageProps}: AppProps) { | ||
return ( | ||
<Providers> | ||
<Component {...pageProps} /> | ||
</Providers> | ||
); | ||
} | ||
|
||
export default MyApp; | ||
export default MyApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,100 @@ | ||
"use client"; | ||
'use client'; | ||
|
||
import { ContributeSection } from '../components/landing/ContributeSection'; | ||
import { Footer } from '../components/Footer'; | ||
import { Navbar } from '../components/Navbar'; | ||
import { useRootNotes } from 'afk_nostr_sdk/hooks/useRootNotes'; | ||
// import { NDKEvent } from 'afk_nostr_sdk'; | ||
|
||
import Providers from '../providers'; | ||
import NDK, { NDKEvent, NDKFilter, NDKKind } from '@nostr-dev-kit/ndk'; | ||
import { AFK_RELAYS } from 'afk_nostr_sdk/utils/relay'; | ||
import { useEffect } from 'react'; | ||
import { useNostrContext } from 'afk_nostr_sdk/context/NostrContext'; | ||
import { useSearch, useSearchNotes } from 'afk_nostr_sdk/hooks'; | ||
import { useState } from 'react'; | ||
import {NDKEvent, NDKFilter, NDKKind} from '@nostr-dev-kit/ndk'; | ||
import {useNostrContext, useSearchNotes} from 'afk_nostr_sdk'; | ||
import {useEffect} from 'react'; | ||
import {useState} from 'react'; | ||
|
||
import {Footer} from '../components/Footer'; | ||
import {Navbar} from '../components/Navbar'; | ||
export default function AppHomepage() { | ||
|
||
const nostr = useNostrContext() | ||
|
||
const [events, setEvents] = useState<NDKEvent[]>([]) | ||
const [isInitDone, setIsInitDone] = useState<boolean>(false) | ||
|
||
const nostr = useNostrContext(); | ||
const [events, setEvents] = useState<NDKEvent[]>([]); | ||
const [isInitDone, setIsInitDone] = useState<boolean>(false); | ||
useEffect(() => { | ||
|
||
if (!isInitDone) { | ||
fetch() | ||
setIsInitDone(true) | ||
fetch(); | ||
setIsInitDone(true); | ||
} | ||
|
||
}) | ||
}); | ||
const fetch = async () => { | ||
const filter: NDKFilter = { | ||
kinds: [NDKKind.Text, NDKKind.ChannelMetadata, NDKKind.Metadata], | ||
|
||
}; | ||
let events_package = await nostr?.ndk?.fetchEvents(filter) | ||
const events_package = await nostr?.ndk?.fetchEvents(filter); | ||
// console.log("events_package", events_package) | ||
setEvents([ | ||
...events_package, | ||
...eventsSearch?.data?.pages | ||
]) | ||
} | ||
// [...eventsSearch?.data?.pages] | ||
]); | ||
}; | ||
|
||
const eventsSearch = useSearchNotes({ | ||
kinds: [ | ||
NDKKind.Text, | ||
NDKKind.Text, | ||
// NDKKind.ChannelMetadata | ||
] | ||
|
||
], | ||
}); | ||
// const events = useRootNotes(); | ||
console.log("events hooks", eventsSearch?.data?.pages) | ||
console.log('events hooks', eventsSearch?.data?.pages); | ||
return ( | ||
// <Providers> | ||
<div className="min-h-screen w-full relative bg-black text-white"> | ||
<Navbar /> | ||
|
||
|
||
<button onClick={() => fetch()}>Reload</button> | ||
|
||
|
||
<div className='md:grid-cols-2'> | ||
{events?.length > 0 && events.map((e: NDKEvent, i) => { | ||
// console.log("e", e) | ||
return ( | ||
<div className='text-white'> | ||
<p>{e?.id}</p> | ||
<p>{e?.content}</p> | ||
<p>{e?.created_at}</p> | ||
|
||
<a href="#" className="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700"> | ||
|
||
<h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">Noteworthy technology acquisitions 2021</h5> | ||
<p className="font-normal text-gray-700 dark:text-gray-400">Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.</p> | ||
</a> | ||
|
||
</div> | ||
) | ||
})} | ||
<div className="md:grid-cols-2"> | ||
{events?.length > 0 && | ||
events.map((e: NDKEvent, i) => { | ||
return ( | ||
<div className="text-white" key={i}> | ||
<p>{e?.id}</p> | ||
<p>{e?.content}</p> | ||
<p>{e?.created_at}</p> | ||
|
||
<a | ||
href="#" | ||
className="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700" | ||
> | ||
<h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"> | ||
Noteworthy technology acquisitions 2021 | ||
</h5> | ||
<p className="font-normal text-gray-700 dark:text-gray-400"> | ||
Here are the biggest enterprise technology acquisitions of 2021 so far, in | ||
reverse chronological order. | ||
</p> | ||
</a> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
|
||
<div className='md:grid-cols-2'> | ||
<div className="md:grid-cols-2"> | ||
{eventsSearch?.data?.pages?.map((e: NDKEvent) => { | ||
console.log("e", e) | ||
console.log('e', e); | ||
return ( | ||
<div key={e?.id} className='text-white'> | ||
<div key={e?.id} className="text-white"> | ||
<p>{e?.id}</p> | ||
|
||
<a href="#" className="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700"> | ||
|
||
<h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">Noteworthy technology acquisitions 2021</h5> | ||
<p className="font-normal text-gray-700 dark:text-gray-400">Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.</p> | ||
<a | ||
href="#" | ||
className="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700" | ||
> | ||
<h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"> | ||
Noteworthy technology acquisitions 2021 | ||
</h5> | ||
<p className="font-normal text-gray-700 dark:text-gray-400"> | ||
Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse | ||
chronological order. | ||
</p> | ||
</a> | ||
|
||
</div> | ||
) | ||
); | ||
})} | ||
</div> | ||
|
||
|
||
|
||
|
||
<Footer /> | ||
</div> | ||
// </Providers> | ||
|
||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
"use client"; | ||
|
||
import { NostrProvider } from 'afk_nostr_sdk/context/NostrContext'; | ||
import { TanstackProvider } from 'afk_nostr_sdk/context/TanstackProvider'; | ||
|
||
export default function Providers({ children }: { children: React.ReactNode }) { | ||
'use client'; | ||
import {TanstackProvider} from 'afk_nostr_sdk'; | ||
import {NostrProvider} from 'afk_nostr_sdk'; | ||
export default function Providers({children}: {children: React.ReactNode}) { | ||
return ( | ||
<NostrProvider> | ||
<TanstackProvider> | ||
{children} | ||
</TanstackProvider> | ||
<TanstackProvider>{children}</TanstackProvider> | ||
</NostrProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
"installCommand": "pnpm install" | ||
|
||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ Cargo.lock | |
/node_modules | ||
|
||
node_modules/ | ||
|
||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.