mirror of
https://github.com/luminous-devs/lume.git
synced 2024-09-18 11:13:30 +00:00
fixed built errors in ssg mode
This commit is contained in:
parent
247f28ae75
commit
8a79938391
@ -17,14 +17,8 @@ const DynamicContent = dynamic(() => import('@components/note/content'), {
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export const Single = memo(function Single({ event }: { event: any }) {
|
export const Single = memo(function Single({ event }: { event: any }) {
|
||||||
const openThread = () => {
|
|
||||||
console.log('ok');
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div className="flex h-min min-h-min w-full cursor-pointer select-text flex-col border-b border-zinc-800 py-4 px-6 hover:bg-zinc-800">
|
||||||
onClick={() => openThread()}
|
|
||||||
className="flex h-min min-h-min w-full cursor-pointer select-text flex-col border-b border-zinc-800 py-4 px-6 hover:bg-zinc-800">
|
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<User pubkey={event.pubkey} time={event.created_at} />
|
<User pubkey={event.pubkey} time={event.created_at} />
|
||||||
<div className="-mt-4 pl-[60px]">
|
<div className="-mt-4 pl-[60px]">
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
import BaseLayout from '@layouts/baseLayout';
|
|
||||||
import UserLayout from '@layouts/userLayout';
|
|
||||||
|
|
||||||
import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from 'react';
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return <></>;
|
|
||||||
}
|
|
||||||
|
|
||||||
Page.getLayout = function getLayout(
|
|
||||||
page:
|
|
||||||
| string
|
|
||||||
| number
|
|
||||||
| boolean
|
|
||||||
| ReactElement<unknown, string | JSXElementConstructor<unknown>>
|
|
||||||
| ReactFragment
|
|
||||||
| ReactPortal
|
|
||||||
) {
|
|
||||||
return (
|
|
||||||
<BaseLayout>
|
|
||||||
<UserLayout>{page}</UserLayout>
|
|
||||||
</BaseLayout>
|
|
||||||
);
|
|
||||||
};
|
|
@ -3,6 +3,7 @@ import BaseLayout from '@layouts/baseLayout';
|
|||||||
import OnboardingLayout from '@layouts/onboardingLayout';
|
import OnboardingLayout from '@layouts/onboardingLayout';
|
||||||
|
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
|
import { GetStaticPaths } from 'next';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { useNostrEvents } from 'nostr-react';
|
import { useNostrEvents } from 'nostr-react';
|
||||||
import {
|
import {
|
||||||
@ -15,12 +16,11 @@ import {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
import Database from 'tauri-plugin-sql-api';
|
import Database from 'tauri-plugin-sql-api';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page({ pubkey }: { pubkey: string }) {
|
||||||
const [follows, setFollows] = useState([null]);
|
const [follows, setFollows] = useState([null]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { pubkey }: any = router.query;
|
|
||||||
|
|
||||||
const { onEvent } = useNostrEvents({
|
const { onEvent } = useNostrEvents({
|
||||||
filter: {
|
filter: {
|
||||||
@ -108,6 +108,20 @@ export default function Page() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getStaticPaths: GetStaticPaths = async () => {
|
||||||
|
return {
|
||||||
|
paths: [],
|
||||||
|
fallback: 'blocking',
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export async function getStaticProps(context) {
|
||||||
|
const pubkey = context.params.pubkey;
|
||||||
|
return {
|
||||||
|
props: { pubkey },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Page.getLayout = function getLayout(
|
Page.getLayout = function getLayout(
|
||||||
page:
|
page:
|
||||||
| string
|
| string
|
@ -46,10 +46,7 @@ export default function Page() {
|
|||||||
const pubKey = getPublicKey(privKey);
|
const pubKey = getPublicKey(privKey);
|
||||||
|
|
||||||
if (pubKey) {
|
if (pubKey) {
|
||||||
router.push({
|
router.push(`/onboarding/profile/${privKey}`);
|
||||||
pathname: '/onboarding/fetch-profile',
|
|
||||||
query: { privkey: privKey },
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setError('key', {
|
setError('key', {
|
||||||
|
@ -3,6 +3,7 @@ import BaseLayout from '@layouts/baseLayout';
|
|||||||
import OnboardingLayout from '@layouts/onboardingLayout';
|
import OnboardingLayout from '@layouts/onboardingLayout';
|
||||||
|
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
|
import { GetStaticPaths } from 'next';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { useNostrEvents } from 'nostr-react';
|
import { useNostrEvents } from 'nostr-react';
|
||||||
import { getPublicKey, nip19 } from 'nostr-tools';
|
import { getPublicKey, nip19 } from 'nostr-tools';
|
||||||
@ -16,12 +17,11 @@ import {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
import Database from 'tauri-plugin-sql-api';
|
import Database from 'tauri-plugin-sql-api';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page({ privkey }: { privkey: string }) {
|
||||||
const [account, setAccount] = useState(null);
|
const [account, setAccount] = useState(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { privkey }: any = router.query;
|
|
||||||
|
|
||||||
const pubkey = getPublicKey(privkey);
|
const pubkey = getPublicKey(privkey);
|
||||||
const npub = nip19.npubEncode(pubkey);
|
const npub = nip19.npubEncode(pubkey);
|
||||||
@ -61,10 +61,7 @@ export default function Page() {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
router.push({
|
router.push(`/onboarding/follows/${pubkey}`);
|
||||||
pathname: '/onboarding/fetch-follows',
|
|
||||||
query: { pubkey: pubkey },
|
|
||||||
});
|
|
||||||
}, 1500);
|
}, 1500);
|
||||||
})
|
})
|
||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
@ -116,6 +113,20 @@ export default function Page() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getStaticPaths: GetStaticPaths = async () => {
|
||||||
|
return {
|
||||||
|
paths: [],
|
||||||
|
fallback: 'blocking',
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export async function getStaticProps(context) {
|
||||||
|
const privkey = context.params.privkey;
|
||||||
|
return {
|
||||||
|
props: { privkey },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Page.getLayout = function getLayout(
|
Page.getLayout = function getLayout(
|
||||||
page:
|
page:
|
||||||
| string
|
| string
|
Loading…
Reference in New Issue
Block a user