From 297cc2f018e55683cb4b9eb6a1097fd08fca54c9 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sun, 12 Mar 2023 17:00:10 +0700 Subject: [PATCH 01/71] updated onboarding, include UI & UX --- src/assets/directory.json | 102 ------------ src/layouts/base.tsx | 2 +- src/layouts/fullscreen.tsx | 12 -- src/layouts/onboarding.tsx | 15 -- src/pages/index.tsx | 75 +++------ src/pages/newsfeed/circle.tsx | 2 +- src/pages/newsfeed/global.tsx | 28 ---- src/pages/onboarding/create/index.tsx | 170 +++++++++----------- src/pages/onboarding/create/pre-follows.tsx | 147 ----------------- src/pages/onboarding/index.tsx | 44 ++--- src/pages/onboarding/login/fetch.tsx | 149 ----------------- src/pages/onboarding/login/index.tsx | 125 +++++++------- src/pages/onboarding/login/step-2.tsx | 147 +++++++++++++++++ tailwind.config.js | 9 ++ 14 files changed, 333 insertions(+), 694 deletions(-) delete mode 100644 src/assets/directory.json delete mode 100644 src/layouts/fullscreen.tsx delete mode 100644 src/layouts/onboarding.tsx delete mode 100644 src/pages/newsfeed/global.tsx delete mode 100644 src/pages/onboarding/create/pre-follows.tsx delete mode 100644 src/pages/onboarding/login/fetch.tsx create mode 100644 src/pages/onboarding/login/step-2.tsx diff --git a/src/assets/directory.json b/src/assets/directory.json deleted file mode 100644 index 0df53779..00000000 --- a/src/assets/directory.json +++ /dev/null @@ -1,102 +0,0 @@ -[ - { - "name": "jb55", - "avatar": "https://pbs.twimg.com/profile_images/1362882895669436423/Jzsp1Ikr.jpg", - "npub": "npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s" - }, - { - "name": "jack", - "avatar": "https://pbs.twimg.com/profile_images/1115644092329758721/AFjOr-K8.jpg", - "npub": "npub1sg6plzptd64u62a878hep2kev88swjh3tw00gjsfl8f237lmu63q0uf63m" - }, - { - "name": "derekmoss", - "avatar": "https://pbs.twimg.com/profile_images/1609534946435076096/Gl1xeTPP.jpg", - "npub": "npub18ams6ewn5aj2n3wt2qawzglx9mr4nzksxhvrdc4gzrecw7n5tvjqctp424" - }, - { - "name": "ODELL", - "avatar": "https://pbs.twimg.com/profile_images/1421584695746338819/Z_7ZfAeP.jpg", - "npub": "npub1qny3tkh0acurzla8x3zy4nhrjz5zd8l9sy9jys09umwng00manysew95gx" - }, - { - "name": "yeg0rpetrov", - "avatar": "https://pbs.twimg.com/profile_images/1593772940126035968/D_LQYRd9.jpg", - "npub": "npub1z4m7gkva6yxgvdyclc7zp0vz4ta0s2d9jh8g83w03tp5vdf3kzdsxana6p" - }, - { - "name": "PrestonPysh", - "avatar": "https://pbs.twimg.com/profile_images/1408783276081299462/f4Ye5n7-.jpg", - "npub": "npub1s5yq6wadwrxde4lhfs56gn64hwzuhnfa6r9mj476r5s4hkunzgzqrs6q7z" - }, - { - "name": "fiatjaf", - "avatar": "https://pbs.twimg.com/profile_images/539211568035004416/sBMjPR9q.jpeg", - "npub": "npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6" - }, - { - "name": "dergigi", - "avatar": "https://pbs.twimg.com/profile_images/1566370176446119943/UeuACt-4.jpg", - "npub": "npub1dergggklka99wwrs92yz8wdjs952h2ux2ha2ed598ngwu9w7a6fsh9xzpc" - }, - { - "name": "hodlonaut", - "avatar": "https://pbs.twimg.com/profile_images/1570910274755911682/z8DJsufc.jpg", - "npub": "npub1cjw49ftnxene9wdxujz3tp7zspp0kf862cjud4nm3j2usag6eg2smwj2rh" - }, - { - "name": "DylanLeClair_", - "avatar": "https://pbs.twimg.com/profile_images/1599858581611941922/XxvPPWAt.jpg", - "npub": "npub1pyp9fqq60689ppds9ec3vghsm7s6s4grfya0y342g2hs3a0y6t0segc0qq" - }, - { - "name": "ShadowOfNakadai", - "avatar": "https://pbs.twimg.com/profile_images/1620811984374464514/V7GJo1ak.jpg", - "npub": "npub1sqaxzwvh5fhgw9q3d7v658ucapvfeds3dcd2587fcwyesn7dnwuqt2r45v" - }, - { - "name": "jackmallers", - "avatar": "https://pbs.twimg.com/profile_images/1599778945699909632/O0qc9ykA.jpg", - "npub": "npub1cn4t4cd78nm900qc2hhqte5aa8c9njm6qkfzw95tszufwcwtcnsq7g3vle" - }, - { - "name": "remroya", - "avatar": "https://pbs.twimg.com/profile_images/1616979727515881478/5ABZzBYO.jpg", - "npub": "npub1csamkk8zu67zl9z4wkp90a462v53q775aqn5q6xzjdkxnkvcpd7srtz4x9" - }, - { - "name": "TakumiHisoka", - "avatar": "https://pbs.twimg.com/profile_images/1623286991944302594/cXSJ04BF.jpg", - "npub": "npub1yc8jxnzkzm2esndrqdae6lza6qlwzxpcz9drpy699j9k7xetrpkqgvkwe9" - }, - { - "name": "EvelinSchallert", - "avatar": "https://pbs.twimg.com/profile_images/1448008447983763457/7k07LJxQ.jpg", - "npub": "npub1l2gvp9wxajsl6wqnh6eulvz5sdk05gtajjwjn2yn45s9yvfru2kqf3r0gm" - }, - { - "name": "peer", - "avatar": "https://pbs.twimg.com/profile_images/1623291991709700097/aBL_VpMC.jpg", - "npub": "npub18zx8lw3947pghsgzqv2t0x8pe767sscag5djgj5afr755xkqd97qt530pr" - }, - { - "name": "francispouliot_", - "avatar": "https://pbs.twimg.com/profile_images/1524789480439283719/5Q_XBKGb.jpg", - "npub": "npub1t289s8ck5qfwynf2vsq49t2kypvvkpj7rhegayrur0ag9s2sezaqgunkzs" - }, - { - "name": "lanyihou", - "avatar": "https://pbs.twimg.com/profile_images/1603653816175689729/Ctj5GXPt.jpg", - "npub": "npub18hywyhcnn5rqhlgu80yxeyf57fyhghlrc54dzaqyd9vtts949u9s24rtva" - }, - { - "name": "marttimalmi", - "avatar": "https://pbs.twimg.com/profile_images/1125299725828272129/n8NDo1LN.png", - "npub": "npub1g53mukxnjkcmr94fhryzkqutdz2ukq4ks0gvy5af25rgmwsl4ngq43drvk" - }, - { - "name": "Snowden", - "avatar": "https://pbs.twimg.com/profile_images/648888480974508032/66_cUYfj.jpg", - "npub": "npub1sn0wdenkukak0d9dfczzeacvhkrgz92ak56egt7vdgzn8pv2wfqqhrjdv9" - } -] diff --git a/src/layouts/base.tsx b/src/layouts/base.tsx index 620befc8..a5dd511d 100644 --- a/src/layouts/base.tsx +++ b/src/layouts/base.tsx @@ -1,3 +1,3 @@ export default function BaseLayout({ children }: { children: React.ReactNode }) { - return
{children}
; + return
{children}
; } diff --git a/src/layouts/fullscreen.tsx b/src/layouts/fullscreen.tsx deleted file mode 100644 index 58bbdcb9..00000000 --- a/src/layouts/fullscreen.tsx +++ /dev/null @@ -1,12 +0,0 @@ -export default function FullscreenLayout({ children }: { children: React.ReactNode }) { - return ( -
- {/* dragging area */} -
- {/* end dragging area */} - {/* content */} -
{children}
- {/* end content */} -
- ); -} diff --git a/src/layouts/onboarding.tsx b/src/layouts/onboarding.tsx deleted file mode 100644 index 2876f33e..00000000 --- a/src/layouts/onboarding.tsx +++ /dev/null @@ -1,15 +0,0 @@ -export default function OnboardingLayout({ children }: { children: React.ReactNode }) { - return ( -
-
-
-
-
-
-
- {children} -
-
-
- ); -} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index e6ac0054..b8b09403 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,16 +1,14 @@ import BaseLayout from '@layouts/base'; -import FullscreenLayout from '@layouts/fullscreen'; import LumeSymbol from '@assets/icons/Lume'; import { useLocalStorage } from '@rehooks/local-storage'; -import { motion } from 'framer-motion'; import { useRouter } from 'next/router'; import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal, useEffect, useRef, useState } from 'react'; export default function Page() { const router = useRouter(); - const [currentUser]: any = useLocalStorage('current-user'); + const [currentUser]: object[] = useLocalStorage('current-user'); const [loading, setLoading] = useState(true); const timer = useRef(null); @@ -18,7 +16,7 @@ export default function Page() { if (currentUser) { timer.current = setTimeout(() => { setLoading(false); - router.push('/newsfeed/following'); + router.push('/newsfeed/circle'); }, 1000); } else { timer.current = setTimeout(() => { @@ -34,32 +32,24 @@ export default function Page() { }, [currentUser, router]); return ( -
-
{/* spacer */}
-
- - - -
- - A censorship-resistant social network - - - built on nostr - +
+ {/* dragging area */} +
+ {/* end dragging area */} +
+
+ +
+

Did you know?

+

+ no one can't stop you use bitcoin and nostr +

+
-
-
-
- {loading ? ( +
+ {loading && ( - ) : ( - <> )}
- {/* background */} -
- -
- {/* end background */}
); } @@ -110,9 +77,5 @@ Page.getLayout = function getLayout( | ReactFragment | ReactPortal ) { - return ( - - {page} - - ); + return {page}; }; diff --git a/src/pages/newsfeed/circle.tsx b/src/pages/newsfeed/circle.tsx index d6749316..98f3d23e 100644 --- a/src/pages/newsfeed/circle.tsx +++ b/src/pages/newsfeed/circle.tsx @@ -6,7 +6,7 @@ import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from export default function Page() { return (
-

Global

+

Circle Newsfeed

); } diff --git a/src/pages/newsfeed/global.tsx b/src/pages/newsfeed/global.tsx deleted file mode 100644 index d6749316..00000000 --- a/src/pages/newsfeed/global.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import BaseLayout from '@layouts/base'; -import NewsFeedLayout from '@layouts/newsfeed'; - -import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from 'react'; - -export default function Page() { - return ( -
-

Global

-
- ); -} - -Page.getLayout = function getLayout( - page: - | string - | number - | boolean - | ReactElement> - | ReactFragment - | ReactPortal -) { - return ( - - {page} - - ); -}; diff --git a/src/pages/onboarding/create/index.tsx b/src/pages/onboarding/create/index.tsx index 90f8189f..7284c748 100644 --- a/src/pages/onboarding/create/index.tsx +++ b/src/pages/onboarding/create/index.tsx @@ -1,12 +1,10 @@ import BaseLayout from '@layouts/base'; -import OnboardingLayout from '@layouts/onboarding'; import { DatabaseContext } from '@components/contexts/database'; import { RelayContext } from '@components/contexts/relay'; import { EyeClosedIcon, EyeOpenIcon } from '@radix-ui/react-icons'; import { useLocalStorage, writeStorage } from '@rehooks/local-storage'; -import { motion } from 'framer-motion'; import Image from 'next/image'; import { useRouter } from 'next/router'; import { generatePrivateKey, getEventHash, getPublicKey, nip19, signEvent } from 'nostr-tools'; @@ -100,115 +98,107 @@ export default function Page() { // redirect to pre-follow setTimeout(() => { setLoading(false); - router.push('/onboarding/create/pre-follows'); + router.push('/'); }, 1500); }) .catch(console.error); }; return ( -
-
{/* spacer */}
- +
+
- - Create new key - - - Lume will generate key with default profile for you, you can edit it later, and please store your key safely - so you can restore your account or use other client - +

+ Create new account +

-
-
- -
- +
+
+
+
+
+ +
+ +
-
-
- -
- - +
+ +
+ + +
-
-
- -
-
-
-
- -
-
-
-

{data.display_name}

-

@{data.username}

+
+ +
+
+
+
+
-
-
-
-
+
+
+

{data.display_name}

+

@{data.username}

+
+
+
+
+
+
+
-
-
- - -
- {loading === true ? ( - - - - - ) : ( -
+
+ {loading === true ? ( + + + + + ) : ( -
- )} + )} +
-
+
); } @@ -222,9 +212,5 @@ Page.getLayout = function getLayout( | ReactFragment | ReactPortal ) { - return ( - - {page} - - ); + return {page}; }; diff --git a/src/pages/onboarding/create/pre-follows.tsx b/src/pages/onboarding/create/pre-follows.tsx deleted file mode 100644 index 601b097f..00000000 --- a/src/pages/onboarding/create/pre-follows.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import BaseLayout from '@layouts/base'; -import OnboardingLayout from '@layouts/onboarding'; - -import { DatabaseContext } from '@components/contexts/database'; - -import { truncate } from '@utils/truncate'; - -import data from '@assets/directory.json'; -import { CheckCircledIcon } from '@radix-ui/react-icons'; -import { useLocalStorage } from '@rehooks/local-storage'; -import { motion } from 'framer-motion'; -import Image from 'next/image'; -import { useRouter } from 'next/router'; -import { nip19 } from 'nostr-tools'; -import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal, useContext, useState } from 'react'; - -const shuffle = (arr: { name: string; avatar: string; npub: string }[]) => [...arr].sort(() => Math.random() - 0.5); - -export default function Page() { - const { db }: any = useContext(DatabaseContext); - const router = useRouter(); - - const [follow, setFollow] = useState([]); - const [loading, setLoading] = useState(false); - const [list] = useState(shuffle(data)); - const [currentUser]: any = useLocalStorage('current-user'); - - const followUser = (e) => { - const npub = e.currentTarget.getAttribute('data-npub'); - setFollow((arr) => [...arr, npub]); - }; - - const insertDB = async () => { - // self follow - await db.execute( - `INSERT INTO follows (pubkey, account, kind) VALUES ("${currentUser.id}", "${currentUser.id}", "0")` - ); - // follow selected - follow.forEach(async (npub) => { - const { data } = nip19.decode(npub); - await db.execute(`INSERT INTO follows (pubkey, account, kind) VALUES ("${data}", "${currentUser.id}", "0")`); - }); - }; - - const createFollowing = async () => { - setLoading(true); - - insertDB().then(() => - setTimeout(() => { - setLoading(false); - router.push('/'); - }, 1500) - ); - }; - - return ( -
-
{/* spacer */}
- -
- - Choose 10 people you want to following - - - For better experiences, you should follow the people you care about to personalize your newsfeed, otherwise - you will be very bored - -
-
-
- {list.map((item, index) => ( -
followUser(e)} - data-npub={item.npub} - className={`col-span-1 inline-flex cursor-pointer items-center gap-3 rounded-lg p-2 hover:bg-zinc-700 ${ - follow.includes(item.npub) ? 'bg-zinc-800' : '' - }`} - > -
- {item.name} -
-
-
-

{item.name}

-

{truncate(item.npub, 16, ' .... ')}

-
-
- {follow.includes(item.npub) ? : <>} -
-
-
- ))} -
-
-
- -
- {loading === true ? ( - - - - - ) : ( -
- -
- )} -
-
-
- ); -} - -Page.getLayout = function getLayout( - page: - | string - | number - | boolean - | ReactElement> - | ReactFragment - | ReactPortal -) { - return ( - - {page} - - ); -}; diff --git a/src/pages/onboarding/index.tsx b/src/pages/onboarding/index.tsx index 521d78fa..a32867d1 100644 --- a/src/pages/onboarding/index.tsx +++ b/src/pages/onboarding/index.tsx @@ -1,47 +1,33 @@ import BaseLayout from '@layouts/base'; -import OnboardingLayout from '@layouts/onboarding'; -import { motion } from 'framer-motion'; +import { ArrowRightIcon } from '@radix-ui/react-icons'; import Link from 'next/link'; import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from 'react'; export default function Page() { return ( -
-
{/* spacer */}
-
- - Other social network require email/password -
- nostr use{' '} - - public/private key instead - -
- - If you have used nostr before, you can import your own private key. Otherwise, you can create a new key or use - auto-generated account created by system. - - - +
+
+
+

+ Let's start! +

+
Create new key + Login with private key - +
-
{/* spacer */}
); } @@ -55,9 +41,5 @@ Page.getLayout = function getLayout( | ReactFragment | ReactPortal ) { - return ( - - {page} - - ); + return {page}; }; diff --git a/src/pages/onboarding/login/fetch.tsx b/src/pages/onboarding/login/fetch.tsx deleted file mode 100644 index 9b1bca29..00000000 --- a/src/pages/onboarding/login/fetch.tsx +++ /dev/null @@ -1,149 +0,0 @@ -import BaseLayout from '@layouts/base'; -import OnboardingLayout from '@layouts/onboarding'; - -import { DatabaseContext } from '@components/contexts/database'; -import { RelayContext } from '@components/contexts/relay'; - -import { useLocalStorage } from '@rehooks/local-storage'; -import { motion } from 'framer-motion'; -import Link from 'next/link'; -import { useRouter } from 'next/router'; -import { getPublicKey, nip19 } from 'nostr-tools'; -import { - JSXElementConstructor, - ReactElement, - ReactFragment, - ReactPortal, - useCallback, - useContext, - useMemo, - useState, -} from 'react'; - -export default function Page() { - const { db }: any = useContext(DatabaseContext); - const relayPool: any = useContext(RelayContext); - - const [loading, setLoading] = useState(false); - const [relays] = useLocalStorage('relays'); - - const router = useRouter(); - const { privkey }: any = router.query; - - const pubkey = useMemo(() => (privkey ? getPublicKey(privkey) : null), [privkey]); - - // save account to database - const insertAccount = useCallback( - async (metadata) => { - if (loading === false) { - const npub = privkey ? nip19.npubEncode(pubkey) : null; - const nsec = privkey ? nip19.nsecEncode(privkey) : null; - await db.execute( - `INSERT OR IGNORE INTO accounts (id, privkey, npub, nsec, metadata) VALUES ("${pubkey}", "${privkey}", "${npub}", "${nsec}", '${metadata}')` - ); - setLoading(true); - } - }, - [db, privkey, pubkey, loading] - ); - - // save follows to database - const insertFollows = useCallback( - async (follows) => { - follows.forEach(async (item) => { - if (item) { - await db.execute( - `INSERT OR IGNORE INTO follows (pubkey, account, kind) VALUES ("${item[1]}", "${pubkey}", "0")` - ); - } - }); - }, - [db, pubkey] - ); - - relayPool.subscribe( - [ - { - authors: [pubkey], - kinds: [0, 3], - since: 0, - }, - ], - relays, - (event: any) => { - if (event.kind === 0) { - insertAccount(event.content); - } else { - if (event.tags.length > 0) { - insertFollows(event.tags); - } - } - }, - undefined, - (events: any, relayURL: any) => { - console.log(events, relayURL); - } - ); - - return ( -
-
{/* spacer */}
- -
- - Fetching your profile... - - - As long as you have private key, you alway can sync your profile and follows list on every nostr client, so - please keep your key safely - -
-
- -
- {loading === true ? ( - - - - - ) : ( - - Finish - - )} -
-
-
- ); -} - -Page.getLayout = function getLayout( - page: - | string - | number - | boolean - | ReactElement> - | ReactFragment - | ReactPortal -) { - return ( - - {page} - - ); -}; diff --git a/src/pages/onboarding/login/index.tsx b/src/pages/onboarding/login/index.tsx index 47ca3354..d61a8310 100644 --- a/src/pages/onboarding/login/index.tsx +++ b/src/pages/onboarding/login/index.tsx @@ -1,7 +1,6 @@ import BaseLayout from '@layouts/base'; -import OnboardingLayout from '@layouts/onboarding'; -import { motion } from 'framer-motion'; +import { LightningBoltIcon } from '@radix-ui/react-icons'; import { useRouter } from 'next/router'; import { nip19 } from 'nostr-tools'; import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from 'react'; @@ -43,7 +42,7 @@ export default function Page() { try { router.push({ - pathname: '/onboarding/login/fetch', + pathname: '/onboarding/login/step-2', query: { privkey: privkey }, }); } catch (error) { @@ -55,60 +54,70 @@ export default function Page() { }; return ( -
-
{/* spacer */}
- -
- - Import your private key - - - You can import private key format as hex string or nsec. If you have installed Nostr Connect compality - wallet in your mobile, you can connect by scan QR Code below - -
-
-
- + +
+

+ Login with Private Key +

+
+
+
+
+
+ {/* #TODO: add function */} + +
+
+
+
+
+
+ or +
+
+
+
+ +
+ {errors.key &&

{errors.key.message}

}
+
+
+
+ {isSubmitting ? ( + + + + + ) : ( + + )}
- {errors.key &&

{errors.key.message}

}
- - -
- {isSubmitting ? ( - - - - - ) : ( - - )} -
-
+
); } @@ -122,9 +131,5 @@ Page.getLayout = function getLayout( | ReactFragment | ReactPortal ) { - return ( - - {page} - - ); + return {page}; }; diff --git a/src/pages/onboarding/login/step-2.tsx b/src/pages/onboarding/login/step-2.tsx new file mode 100644 index 00000000..442618c4 --- /dev/null +++ b/src/pages/onboarding/login/step-2.tsx @@ -0,0 +1,147 @@ +import BaseLayout from '@layouts/base'; + +import { DatabaseContext } from '@components/contexts/database'; +import { RelayContext } from '@components/contexts/relay'; + +import { useLocalStorage } from '@rehooks/local-storage'; +import Image from 'next/image'; +import Link from 'next/link'; +import { useRouter } from 'next/router'; +import { getPublicKey, nip19 } from 'nostr-tools'; +import { + JSXElementConstructor, + ReactElement, + ReactFragment, + ReactPortal, + useCallback, + useContext, + useEffect, + useMemo, + useState, +} from 'react'; + +export default function Page() { + const { db }: any = useContext(DatabaseContext); + const relayPool: any = useContext(RelayContext); + + const router = useRouter(); + const { privkey }: any = router.query; + + const [relays] = useLocalStorage('relays'); + const [profile, setProfile] = useState({ picture: '', display_name: '', username: '' }); + + const pubkey = useMemo(() => (privkey ? getPublicKey(privkey) : null), [privkey]); + + // save account to database + const insertAccount = useCallback( + async (metadata) => { + const npub = privkey ? nip19.npubEncode(pubkey) : null; + const nsec = privkey ? nip19.nsecEncode(privkey) : null; + // insert to database + await db.execute( + `INSERT OR IGNORE INTO accounts (id, privkey, npub, nsec, metadata) VALUES ("${pubkey}", "${privkey}", "${npub}", "${nsec}", '${metadata}')` + ); + // update state + setProfile(JSON.parse(metadata)); + }, + [db, privkey, pubkey] + ); + + // save follows to database + const insertFollows = useCallback( + async (follows) => { + follows.forEach(async (item) => { + if (item) { + // insert to database + await db.execute( + `INSERT OR IGNORE INTO follows (pubkey, account, kind) VALUES ("${item[1]}", "${pubkey}", "0")` + ); + } + }); + }, + [db, pubkey] + ); + + useEffect(() => { + relayPool.subscribe( + [ + { + authors: [pubkey], + kinds: [0, 3], + since: 0, + }, + ], + relays, + (event: any) => { + if (event.kind === 0) { + insertAccount(event.content); + } else { + if (event.tags.length > 0) { + insertFollows(event.tags); + } + } + }, + undefined, + (events: any, relayURL: any) => { + console.log(events, relayURL); + } + ); + }, [insertAccount, insertFollows, pubkey, relayPool, relays]); + + return ( +
+
+
+

+ Bringing back your profile... +

+
+
+
+
+
+
+
+
+ +
+
+
+

{profile.display_name}

+ · +

@{profile.username}

+
+
+
+
+
+
+
+
+
+
+
+
+ + Done → + +
+
+
+ ); +} + +Page.getLayout = function getLayout( + page: + | string + | number + | boolean + | ReactElement> + | ReactFragment + | ReactPortal +) { + return {page}; +}; diff --git a/tailwind.config.js b/tailwind.config.js index ee947538..d707e092 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -65,6 +65,14 @@ module.exports = { from: { opacity: 0, transform: 'translateX(2px)' }, to: { opacity: 1, transform: 'translateX(0)' }, }, + moveBg: { + '0%': { backgroundPosition: '50px' }, + '20%': { backgroundPosition: '150px' }, + '40%': { backgroundPosition: '250px' }, + '60%': { backgroundPosition: '350px' }, + '80%': { backgroundPosition: '450px' }, + '100%': { backgroundPosition: '550px' }, + }, }, animation: { disco: 'disco 1.5s linear infinite', @@ -74,6 +82,7 @@ module.exports = { slideLeftAndFade: 'slideLeftAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)', slideUpAndFade: 'slideUpAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)', slideRightAndFade: 'slideRightAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)', + moveBg: 'moveBg 3s ease-in-out infinite alternate running forwards', }, }, }, From 431f21e02cc1ce01c1bd982344798ea5f97429f6 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 13 Mar 2023 21:43:22 +0700 Subject: [PATCH 02/71] added app-header and updated navigation bar --- src-tauri/src/main.rs | 4 +- src/components/columns/account/index.tsx | 2 +- src/components/columns/navigator/index.tsx | 70 ++++++++++--------- .../columns/navigator/messages/index.tsx | 32 +++++++++ .../columns/navigator/userDropdownMenu.tsx | 61 ---------------- src/layouts/newsfeed.tsx | 21 ------ src/layouts/withSidebar.tsx | 29 ++++++++ src/pages/index.tsx | 4 +- src/pages/newsfeed/circle.tsx | 4 +- src/pages/newsfeed/following.tsx | 4 +- 10 files changed, 106 insertions(+), 125 deletions(-) create mode 100644 src/components/columns/navigator/messages/index.tsx delete mode 100644 src/components/columns/navigator/userDropdownMenu.tsx delete mode 100644 src/layouts/newsfeed.tsx create mode 100644 src/layouts/withSidebar.tsx diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 4b0c9868..45f470a0 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -20,7 +20,7 @@ fn main() { .setup(|app| { let main_window = app.get_window("main").unwrap(); // set inset for traffic lights - main_window.position_traffic_lights(8.0, 16.0); + main_window.position_traffic_lights(8.0, 20.0); Ok(()) }) @@ -41,7 +41,7 @@ fn main() { .on_window_event(|e| { let apply_offset = || { let win = e.window(); - win.position_traffic_lights(8.0, 16.0); + win.position_traffic_lights(8.0, 20.0); }; match e.event() { diff --git a/src/components/columns/account/index.tsx b/src/components/columns/account/index.tsx index 36d5470d..d7c5669d 100644 --- a/src/components/columns/account/index.tsx +++ b/src/components/columns/account/index.tsx @@ -23,7 +23,7 @@ export default function AccountColumn() { }, [getAccounts]); return ( -
+
{users.map((user, index) => ( diff --git a/src/components/columns/navigator/index.tsx b/src/components/columns/navigator/index.tsx index 57906d18..94997151 100644 --- a/src/components/columns/navigator/index.tsx +++ b/src/components/columns/navigator/index.tsx @@ -1,72 +1,74 @@ import ActiveLink from '@components/activeLink'; -import CreatePost from '@components/columns/navigator/createPost'; -import { UserDropdownMenu } from '@components/columns/navigator/userDropdownMenu'; +import Messages from '@components/columns/navigator/messages'; import { PlusIcon } from '@radix-ui/react-icons'; -import { useLocalStorage } from '@rehooks/local-storage'; export default function NavigatorColumn() { - const [currentUser]: any = useLocalStorage('current-user'); - const profile = JSON.parse(currentUser.metadata); - return ( -
+
- {/* Create post */} -
-
-
-
{profile.display_name || ''}
- + {/* Create post +
+
+
+
{profile.display_name || ''}
+ +
+ @{profile.username || ''} +
+
+
- @{profile.username || ''}
-
- -
-
+ */} {/* Newsfeed */} -
+
-

Newsfeed

+

Newsfeed

-
+
- # +
+ +
following
- # - global +
+ +
+ circle
{/* Messages */} -
+
-

Direct Messages

+

Messages

-
+
+ +
diff --git a/src/components/columns/navigator/messages/index.tsx b/src/components/columns/navigator/messages/index.tsx new file mode 100644 index 00000000..4e288a3e --- /dev/null +++ b/src/components/columns/navigator/messages/index.tsx @@ -0,0 +1,32 @@ +import Avatar from 'boring-avatars'; +import { useState } from 'react'; +import { Config, names, uniqueNamesGenerator } from 'unique-names-generator'; + +const config: Config = { + dictionaries: [names], +}; + +export default function Messages() { + const [data] = useState([...Array(15)]); + + return ( + <> + {data.map((item, index) => ( +
+ +
+

{uniqueNamesGenerator(config).toString()}

+
+
+ ))} + + ); +} diff --git a/src/components/columns/navigator/userDropdownMenu.tsx b/src/components/columns/navigator/userDropdownMenu.tsx deleted file mode 100644 index c377d7f0..00000000 --- a/src/components/columns/navigator/userDropdownMenu.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import * as DropdownMenu from '@radix-ui/react-dropdown-menu'; -import { DotsHorizontalIcon } from '@radix-ui/react-icons'; -import { writeText } from '@tauri-apps/api/clipboard'; -import { useRouter } from 'next/router'; -import { nip19 } from 'nostr-tools'; -import { memo } from 'react'; - -export const UserDropdownMenu = memo(function ProfileMenu({ pubkey }: { pubkey: string }) { - const router = useRouter(); - - const viewProfile = () => { - router.push(`/profile/${pubkey}`); - }; - - const updateProfile = () => { - router.push('/profile/update'); - }; - - const copyPubkey = async () => { - const npub = nip19.npubEncode(pubkey); - await writeText(npub); - }; - - return ( - - - - - - - viewProfile()} - className="group relative flex h-[30px] select-none items-center rounded px-1 pl-6 text-sm leading-none text-zinc-100 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-zinc-700 data-[highlighted]:text-fuchsia-400 data-[disabled]:text-zinc-400" - > - View profile - - updateProfile()} - className="group relative flex h-[30px] select-none items-center rounded px-1 pl-6 text-sm leading-none text-zinc-100 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-zinc-700 data-[highlighted]:text-fuchsia-400 data-[disabled]:text-zinc-400" - > - Update profile - - copyPubkey()} - className="group relative flex h-[30px] select-none items-center rounded px-1 pl-6 text-sm leading-none text-zinc-100 outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-zinc-700 data-[highlighted]:text-fuchsia-400 data-[disabled]:text-zinc-400" - > - Copy public key - - - Log out - - - - - ); -}); diff --git a/src/layouts/newsfeed.tsx b/src/layouts/newsfeed.tsx deleted file mode 100644 index c49447f5..00000000 --- a/src/layouts/newsfeed.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import AccountColumn from '@components/columns/account'; -import NavigatorColumn from '@components/columns/navigator'; - -export default function NewsFeedLayout({ children }: { children: React.ReactNode }) { - return ( -
-
-
- -
-
-
- -
-
-
{children}
-
-
-
- ); -} diff --git a/src/layouts/withSidebar.tsx b/src/layouts/withSidebar.tsx new file mode 100644 index 00000000..4e2b6ed7 --- /dev/null +++ b/src/layouts/withSidebar.tsx @@ -0,0 +1,29 @@ +import AccountColumn from '@components/columns/account'; +import NavigatorColumn from '@components/columns/navigator'; + +export default function WithSidebarLayout({ children }: { children: React.ReactNode }) { + return ( +
+
+

Header

+
+
+
+
+ +
+
+
+ +
+
+
{children}
+
+
+
+
+ ); +} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index b8b09403..ca7aa418 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -40,9 +40,9 @@ export default function Page() {
-

Did you know?

+

Did you know?

- no one can't stop you use bitcoin and nostr + No one can't stop you use bitcoin and nostr

diff --git a/src/pages/newsfeed/circle.tsx b/src/pages/newsfeed/circle.tsx index 98f3d23e..c14a205a 100644 --- a/src/pages/newsfeed/circle.tsx +++ b/src/pages/newsfeed/circle.tsx @@ -1,5 +1,5 @@ import BaseLayout from '@layouts/base'; -import NewsFeedLayout from '@layouts/newsfeed'; +import WithSidebarLayout from '@layouts/withSidebar'; import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from 'react'; @@ -22,7 +22,7 @@ Page.getLayout = function getLayout( ) { return ( - {page} + {page} ); }; diff --git a/src/pages/newsfeed/following.tsx b/src/pages/newsfeed/following.tsx index 71b5bddc..022b57d7 100644 --- a/src/pages/newsfeed/following.tsx +++ b/src/pages/newsfeed/following.tsx @@ -1,5 +1,5 @@ import BaseLayout from '@layouts/base'; -import NewsFeedLayout from '@layouts/newsfeed'; +import WithSidebarLayout from '@layouts/withSidebar'; import { DatabaseContext } from '@components/contexts/database'; import { NoteConnector } from '@components/note/connector'; @@ -137,7 +137,7 @@ Page.getLayout = function getLayout( ) { return ( - {page} + {page} ); }; From 8a80b36f9c940b2cb24efa14b38b5543cbefeaa3 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Tue, 14 Mar 2023 10:57:51 +0700 Subject: [PATCH 03/71] updated appheader --- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 5 +++++ src/components/appHeader/index.tsx | 30 ++++++++++++++++++++++++++++++ src/layouts/withSidebar.tsx | 7 ++++--- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 src/components/appHeader/index.tsx diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 7818d44b..0e3ac8f8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -16,7 +16,7 @@ tauri-build = { version = "1.2", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "1.2", features = ["clipboard-all", "notification-all", "shell-open", "system-tray", "window-start-dragging"] } +tauri = { version = "1.2", features = ["app-all", "clipboard-all", "notification-all", "shell-open", "system-tray", "window-start-dragging"] } [dependencies.tauri-plugin-sql] git = "https://github.com/tauri-apps/plugins-workspace" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 96b62eb9..385fb53a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -13,6 +13,11 @@ "tauri": { "allowlist": { "all": false, + "app": { + "all": true, + "hide": false, + "show": false + }, "shell": { "all": false, "open": true diff --git a/src/components/appHeader/index.tsx b/src/components/appHeader/index.tsx new file mode 100644 index 00000000..7655c8dd --- /dev/null +++ b/src/components/appHeader/index.tsx @@ -0,0 +1,30 @@ +import { ArrowLeftIcon, ArrowRightIcon } from '@radix-ui/react-icons'; +import { useRouter } from 'next/router'; + +export default function AppHeader() { + const router = useRouter(); + + const goBack = () => { + router.back(); + }; + + const goForward = () => { + window.history.forward(); + }; + + return ( +
+
{/* macos traffic lights */}
+
+
+ + +
+
+
+ ); +} diff --git a/src/layouts/withSidebar.tsx b/src/layouts/withSidebar.tsx index 4e2b6ed7..2b7f7e66 100644 --- a/src/layouts/withSidebar.tsx +++ b/src/layouts/withSidebar.tsx @@ -1,3 +1,4 @@ +import AppHeader from '@components/appHeader'; import AccountColumn from '@components/columns/account'; import NavigatorColumn from '@components/columns/navigator'; @@ -6,12 +7,12 @@ export default function WithSidebarLayout({ children }: { children: React.ReactN
-

Header

+
-
+
From 4ea1cafb7bf4974a7ac54c6169888602d6d19a3d Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Wed, 15 Mar 2023 10:51:32 +0700 Subject: [PATCH 04/71] added pre-follow to onboarding process --- package.json | 15 +- pnpm-lock.yaml | 697 +++++++++++++++++-------- src/components/user/base.tsx | 63 +++ src/pages/onboarding/create/index.tsx | 6 +- src/pages/onboarding/create/step-2.tsx | 217 ++++++++ src/pages/onboarding/login/index.tsx | 8 +- src/pages/onboarding/login/step-2.tsx | 2 +- 7 files changed, 772 insertions(+), 236 deletions(-) create mode 100644 src/components/user/base.tsx create mode 100644 src/pages/onboarding/create/step-2.tsx diff --git a/package.json b/package.json index bdb5e749..718f8b5a 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@radix-ui/react-dropdown-menu": "^2.0.4", "@radix-ui/react-icons": "^1.2.0", "@rehooks/local-storage": "^2.4.4", + "@supabase/supabase-js": "^2.10.0", "@tauri-apps/api": "^1.2.0", "@uiw/react-markdown-preview": "^4.1.10", "@uiw/react-md-editor": "^3.20.5", @@ -25,7 +26,7 @@ "moment": "^2.29.4", "next": "^13.2.4", "next-remove-imports": "^1.0.10", - "nostr-relaypool": "^0.5.12", + "nostr-relaypool": "^0.5.18", "nostr-tools": "^1.7.4", "qrcode.react": "^3.1.0", "react": "^18.2.0", @@ -36,26 +37,26 @@ "react-virtuoso": "^4.1.0", "tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql", "unique-names-generator": "^4.7.1", - "ws": "^8.12.1" + "ws": "^8.13.0" }, "devDependencies": { "@tailwindcss/typography": "^0.5.9", "@tauri-apps/cli": "^1.2.3", "@trivago/prettier-plugin-sort-imports": "^4.1.1", - "@types/node": "^18.15.0", + "@types/node": "^18.15.3", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", - "@typescript-eslint/eslint-plugin": "^5.54.1", - "@typescript-eslint/parser": "^5.54.1", + "@typescript-eslint/eslint-plugin": "^5.55.0", + "@typescript-eslint/parser": "^5.55.0", "autoprefixer": "^10.4.14", "csstype": "^3.1.1", - "eslint": "^8.35.0", + "eslint": "^8.36.0", "eslint-config-next": "^13.2.4", "eslint-config-prettier": "^8.7.0", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", "husky": "^8.0.3", - "lint-staged": "^13.1.2", + "lint-staged": "^13.2.0", "postcss": "^8.4.21", "prettier": "^2.8.4", "prettier-plugin-tailwindcss": "^0.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6eab37a6..95f9b161 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,33 +5,34 @@ specifiers: '@radix-ui/react-dropdown-menu': ^2.0.4 '@radix-ui/react-icons': ^1.2.0 '@rehooks/local-storage': ^2.4.4 + '@supabase/supabase-js': ^2.10.0 '@tailwindcss/typography': ^0.5.9 '@tauri-apps/api': ^1.2.0 '@tauri-apps/cli': ^1.2.3 '@trivago/prettier-plugin-sort-imports': ^4.1.1 - '@types/node': ^18.15.0 + '@types/node': ^18.15.3 '@types/react': ^18.0.28 '@types/react-dom': ^18.0.11 - '@typescript-eslint/eslint-plugin': ^5.54.1 - '@typescript-eslint/parser': ^5.54.1 + '@typescript-eslint/eslint-plugin': ^5.55.0 + '@typescript-eslint/parser': ^5.55.0 '@uiw/react-markdown-preview': ^4.1.10 '@uiw/react-md-editor': ^3.20.5 autoprefixer: ^10.4.14 bitcoin-address-validation: ^2.2.1 boring-avatars: ^1.7.0 csstype: ^3.1.1 - eslint: ^8.35.0 + eslint: ^8.36.0 eslint-config-next: ^13.2.4 eslint-config-prettier: ^8.7.0 eslint-plugin-react: ^7.32.2 eslint-plugin-react-hooks: ^4.6.0 framer-motion: ^9.1.7 husky: ^8.0.3 - lint-staged: ^13.1.2 + lint-staged: ^13.2.0 moment: ^2.29.4 next: ^13.2.4 next-remove-imports: ^1.0.10 - nostr-relaypool: ^0.5.12 + nostr-relaypool: ^0.5.18 nostr-tools: ^1.7.4 postcss: ^8.4.21 prettier: ^2.8.4 @@ -48,13 +49,14 @@ specifiers: tauri-plugin-sql-api: github:tauri-apps/tauri-plugin-sql typescript: ^4.9.5 unique-names-generator: ^4.7.1 - ws: ^8.12.1 + ws: ^8.13.0 dependencies: '@radix-ui/react-dialog': 1.0.3_zula6vjvt3wdocc4mwcxqa6nzi '@radix-ui/react-dropdown-menu': 2.0.4_zula6vjvt3wdocc4mwcxqa6nzi '@radix-ui/react-icons': 1.2.0_react@18.2.0 '@rehooks/local-storage': 2.4.4_react@18.2.0 + '@supabase/supabase-js': 2.10.0 '@tauri-apps/api': 1.2.0 '@uiw/react-markdown-preview': 4.1.10_zula6vjvt3wdocc4mwcxqa6nzi '@uiw/react-md-editor': 3.20.5_zula6vjvt3wdocc4mwcxqa6nzi @@ -64,7 +66,7 @@ dependencies: moment: 2.29.4 next: 13.2.4_biqbaboplfbrettd7655fr4n2y next-remove-imports: 1.0.10 - nostr-relaypool: 0.5.12_ws@8.12.1 + nostr-relaypool: 0.5.18_ws@8.13.0 nostr-tools: 1.7.4 qrcode.react: 3.1.0_react@18.2.0 react: 18.2.0 @@ -73,28 +75,28 @@ dependencies: react-moment: 1.1.3_mmavuqf6ek6upnyryxchoaliru react-player: 2.12.0_react@18.2.0 react-virtuoso: 4.1.0_biqbaboplfbrettd7655fr4n2y - tauri-plugin-sql-api: github.com/tauri-apps/tauri-plugin-sql/b945c7a74ed207771420f7f0809d20ba66d55f70 + tauri-plugin-sql-api: github.com/tauri-apps/tauri-plugin-sql/3a8b9a6b244df7512bc5ef8692cebdedbab3ccce unique-names-generator: 4.7.1 - ws: 8.12.1 + ws: 8.13.0 devDependencies: '@tailwindcss/typography': 0.5.9_tailwindcss@3.2.7 '@tauri-apps/cli': 1.2.3 '@trivago/prettier-plugin-sort-imports': 4.1.1_prettier@2.8.4 - '@types/node': 18.15.0 + '@types/node': 18.15.3 '@types/react': 18.0.28 '@types/react-dom': 18.0.11 - '@typescript-eslint/eslint-plugin': 5.54.1_mlk7dnz565t663n4razh6a6v6i - '@typescript-eslint/parser': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/eslint-plugin': 5.55.0_342y7v4tc7ytrrysmit6jo4wri + '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m autoprefixer: 10.4.14_postcss@8.4.21 csstype: 3.1.1 - eslint: 8.35.0 - eslint-config-next: 13.2.4_ycpbpc6yetojsgtrx3mwntkhsu - eslint-config-prettier: 8.7.0_eslint@8.35.0 - eslint-plugin-react: 7.32.2_eslint@8.35.0 - eslint-plugin-react-hooks: 4.6.0_eslint@8.35.0 + eslint: 8.36.0 + eslint-config-next: 13.2.4_vgl77cfdswitgr47lm5swmv43m + eslint-config-prettier: 8.7.0_eslint@8.36.0 + eslint-plugin-react: 7.32.2_eslint@8.36.0 + eslint-plugin-react-hooks: 4.6.0_eslint@8.36.0 husky: 8.0.3 - lint-staged: 13.1.2 + lint-staged: 13.2.0 postcss: 8.4.21 prettier: 2.8.4 prettier-plugin-tailwindcss: 0.2.4_zmkqdpv3ldc45e6wei6qtrbrca @@ -125,21 +127,21 @@ packages: engines: { node: '>=6.9.0' } dev: false - /@babel/core/7.21.0: + /@babel/core/7.21.3: resolution: - { integrity: sha512-PuxUbxcW6ZYe656yL3EAhpy7qXKq0DmYsrJLpbB8XrsCP9Nm+XCg9XFMb5vIDliPD7+U/+M+QJlH17XOcB7eXA== } + { integrity: sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw== } engines: { node: '>=6.9.0' } dependencies: '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.18.6 - '@babel/generator': 7.21.1 - '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.0 + '@babel/generator': 7.21.3 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.3 '@babel/helper-module-transforms': 7.21.2 '@babel/helpers': 7.21.0 - '@babel/parser': 7.21.2 + '@babel/parser': 7.21.3 '@babel/template': 7.20.7 - '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/traverse': 7.21.3 + '@babel/types': 7.21.3 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -159,18 +161,18 @@ packages: source-map: 0.5.7 dev: true - /@babel/generator/7.21.1: + /@babel/generator/7.21.3: resolution: - { integrity: sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA== } + { integrity: sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA== } engines: { node: '>=6.9.0' } dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.21.3 '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.17 jsesc: 2.5.2 dev: false - /@babel/helper-compilation-targets/7.20.7_@babel+core@7.21.0: + /@babel/helper-compilation-targets/7.20.7_@babel+core@7.21.3: resolution: { integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== } engines: { node: '>=6.9.0' } @@ -178,7 +180,7 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/compat-data': 7.21.0 - '@babel/core': 7.21.0 + '@babel/core': 7.21.3 '@babel/helper-validator-option': 7.21.0 browserslist: 4.21.5 lru-cache: 5.1.1 @@ -196,21 +198,21 @@ packages: engines: { node: '>=6.9.0' } dependencies: '@babel/template': 7.20.7 - '@babel/types': 7.21.2 + '@babel/types': 7.21.3 /@babel/helper-hoist-variables/7.18.6: resolution: { integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== } engines: { node: '>=6.9.0' } dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.21.3 /@babel/helper-module-imports/7.18.6: resolution: { integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== } engines: { node: '>=6.9.0' } dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.21.3 dev: false /@babel/helper-module-transforms/7.21.2: @@ -224,8 +226,8 @@ packages: '@babel/helper-split-export-declaration': 7.18.6 '@babel/helper-validator-identifier': 7.19.1 '@babel/template': 7.20.7 - '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/traverse': 7.21.3 + '@babel/types': 7.21.3 transitivePeerDependencies: - supports-color dev: false @@ -235,7 +237,7 @@ packages: { integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== } engines: { node: '>=6.9.0' } dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.21.3 dev: false /@babel/helper-split-export-declaration/7.18.6: @@ -243,7 +245,7 @@ packages: { integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== } engines: { node: '>=6.9.0' } dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.21.3 /@babel/helper-string-parser/7.19.4: resolution: @@ -267,8 +269,8 @@ packages: engines: { node: '>=6.9.0' } dependencies: '@babel/template': 7.20.7 - '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/traverse': 7.21.3 + '@babel/types': 7.21.3 transitivePeerDependencies: - supports-color dev: false @@ -282,9 +284,9 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 - /@babel/parser/7.21.2: + /@babel/parser/7.21.3: resolution: - { integrity: sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ== } + { integrity: sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ== } engines: { node: '>=6.0.0' } hasBin: true dependencies: @@ -303,8 +305,8 @@ packages: engines: { node: '>=6.9.0' } dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.21.2 - '@babel/types': 7.21.2 + '@babel/parser': 7.21.3 + '@babel/types': 7.21.3 /@babel/traverse/7.17.3: resolution: @@ -317,7 +319,7 @@ packages: '@babel/helper-function-name': 7.21.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.21.2 + '@babel/parser': 7.21.3 '@babel/types': 7.17.0 debug: 4.3.4 globals: 11.12.0 @@ -325,19 +327,19 @@ packages: - supports-color dev: true - /@babel/traverse/7.21.2: + /@babel/traverse/7.21.3: resolution: - { integrity: sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw== } + { integrity: sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ== } engines: { node: '>=6.9.0' } dependencies: '@babel/code-frame': 7.18.6 - '@babel/generator': 7.21.1 + '@babel/generator': 7.21.3 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-function-name': 7.21.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.21.2 - '@babel/types': 7.21.2 + '@babel/parser': 7.21.3 + '@babel/types': 7.21.3 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -352,9 +354,9 @@ packages: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 - /@babel/types/7.21.2: + /@babel/types/7.21.3: resolution: - { integrity: sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw== } + { integrity: sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg== } engines: { node: '>=6.9.0' } dependencies: '@babel/helper-string-parser': 7.19.4 @@ -376,14 +378,31 @@ packages: dev: false optional: true - /@eslint/eslintrc/2.0.0: + /@eslint-community/eslint-utils/4.2.0_eslint@8.36.0: resolution: - { integrity: sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A== } + { integrity: sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.36.0 + eslint-visitor-keys: 3.3.0 + dev: true + + /@eslint-community/regexpp/4.4.0: + resolution: + { integrity: sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ== } + engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } + dev: true + + /@eslint/eslintrc/2.0.1: + resolution: + { integrity: sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.4.1 + espree: 9.5.0 globals: 13.20.0 ignore: 5.2.4 import-fresh: 3.3.0 @@ -394,9 +413,9 @@ packages: - supports-color dev: true - /@eslint/js/8.35.0: + /@eslint/js/8.36.0: resolution: - { integrity: sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw== } + { integrity: sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dev: true @@ -1110,6 +1129,67 @@ packages: '@scure/base': 1.1.1 dev: false + /@supabase/functions-js/2.1.0: + resolution: + { integrity: sha512-vRziB+AqRXRaGHjEFHwBo0kuNDTuAxI7VUeqU24Fe86ISoD8YEQm0dGdpleJEcqgDGWaO6pxT1tfj1BRY5PwMg== } + dependencies: + cross-fetch: 3.1.5 + transitivePeerDependencies: + - encoding + dev: false + + /@supabase/gotrue-js/2.13.0: + resolution: + { integrity: sha512-NFBHuHNUn94mP/zOQzsp1k2PtwV55Vhf6ZbTzmMpiUvIRlXhVteZcdfdoAQDIBrdxOdL7F54NFp1gIupPZka6g== } + dependencies: + cross-fetch: 3.1.5 + transitivePeerDependencies: + - encoding + dev: false + + /@supabase/postgrest-js/1.4.1: + resolution: + { integrity: sha512-aruqwV/aTggkM7OVv2JinCeXmRMKHJCZpkuS1nuoa0NgLw7g3NyILSyWOKYTBJ/PxE/zXtWsBhdxFzaaNz5uxg== } + dependencies: + cross-fetch: 3.1.5 + transitivePeerDependencies: + - encoding + dev: false + + /@supabase/realtime-js/2.6.0: + resolution: + { integrity: sha512-tOVulMobhpxyDuu8VIImpL8FXmZOKsGNOSyS5ihJdj2xYmPPvYG+D2J51Ewfl+MFF65tweiB6p9N9bNIW1cDNA== } + dependencies: + '@types/phoenix': 1.5.5 + websocket: 1.0.34 + transitivePeerDependencies: + - supports-color + dev: false + + /@supabase/storage-js/2.3.1: + resolution: + { integrity: sha512-BaPIvyvjuZW1V0CnfGKUZyzpBUXnsh0XD8eqTOYd+MdiGPmIPI0vtwnT4fAoK8mipp1vpcN62EVQaqeUnWXPtQ== } + dependencies: + cross-fetch: 3.1.5 + transitivePeerDependencies: + - encoding + dev: false + + /@supabase/supabase-js/2.10.0: + resolution: + { integrity: sha512-/vkpPxGDyLfTASWnVHL8vdgQxn9SX/Cs+BotTxFhLSIeGFSazC6rpQSMKu6RqzO7gjBD1KqTv0h3auWfClWs+Q== } + dependencies: + '@supabase/functions-js': 2.1.0 + '@supabase/gotrue-js': 2.13.0 + '@supabase/postgrest-js': 1.4.1 + '@supabase/realtime-js': 2.6.0 + '@supabase/storage-js': 2.3.1 + cross-fetch: 3.1.5 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + /@swc/helpers/0.4.14: resolution: { integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw== } @@ -1254,7 +1334,7 @@ packages: optional: true dependencies: '@babel/generator': 7.17.7 - '@babel/parser': 7.21.2 + '@babel/parser': 7.21.3 '@babel/traverse': 7.17.3 '@babel/types': 7.17.0 javascript-natural-sort: 0.7.1 @@ -1299,9 +1379,9 @@ packages: { integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== } dev: false - /@types/node/18.15.0: + /@types/node/18.15.3: resolution: - { integrity: sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w== } + { integrity: sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw== } dev: true /@types/parse5/6.0.3: @@ -1309,6 +1389,11 @@ packages: { integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== } dev: false + /@types/phoenix/1.5.5: + resolution: + { integrity: sha512-1eWWT19k0L4ZiTvdXjAvJ9KvW0B8SdiVftQmFPJGTEx78Q4PCSIQDpz+EfkFVR1N4U9gREjlW4JXL8YCIlY0bw== } + dev: false + /@types/prismjs/1.26.0: resolution: { integrity: sha512-ZTaqn/qSqUuAq1YwvOFQfVW1AR/oQJlLSZVustdjwI+GZ8kr0MSHBj0tsXPW1EqHubx50gtBEjbPGsdZwQwCjQ== } @@ -1347,9 +1432,9 @@ packages: { integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== } dev: false - /@typescript-eslint/eslint-plugin/5.54.1_mlk7dnz565t663n4razh6a6v6i: + /@typescript-eslint/eslint-plugin/5.55.0_342y7v4tc7ytrrysmit6jo4wri: resolution: - { integrity: sha512-a2RQAkosH3d3ZIV08s3DcL/mcGc2M/UC528VkPULFxR9VnVPT8pBu0IyBAJJmVsCmhVfwQX1v6q+QGnmSe1bew== } + { integrity: sha512-IZGc50rtbjk+xp5YQoJvmMPmJEYoC53SiKPXyqWfv15XoD2Y5Kju6zN0DwlmaGJp1Iw33JsWJcQ7nw0lGCGjVg== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -1359,16 +1444,16 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu - '@typescript-eslint/scope-manager': 5.54.1 - '@typescript-eslint/type-utils': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu - '@typescript-eslint/utils': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu + '@eslint-community/regexpp': 4.4.0 + '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/scope-manager': 5.55.0 + '@typescript-eslint/type-utils': 5.55.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/utils': 5.55.0_vgl77cfdswitgr47lm5swmv43m debug: 4.3.4 - eslint: 8.35.0 + eslint: 8.36.0 grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 - regexpp: 3.2.0 semver: 7.3.8 tsutils: 3.21.0_typescript@4.9.5 typescript: 4.9.5 @@ -1376,9 +1461,9 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.54.1_ycpbpc6yetojsgtrx3mwntkhsu: + /@typescript-eslint/parser/5.55.0_vgl77cfdswitgr47lm5swmv43m: resolution: - { integrity: sha512-8zaIXJp/nG9Ff9vQNh7TI+C3nA6q6iIsGJ4B4L6MhZ7mHnTMR4YP5vp2xydmFXIy8rpyIVbNAG44871LMt6ujg== } + { integrity: sha512-ppvmeF7hvdhUUZWSd2EEWfzcFkjJzgNQzVST22nzg958CR+sphy8A6K7LXQZd6V75m1VKjp+J4g/PCEfSCmzhw== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1387,28 +1472,28 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.54.1 - '@typescript-eslint/types': 5.54.1 - '@typescript-eslint/typescript-estree': 5.54.1_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.55.0 + '@typescript-eslint/types': 5.55.0 + '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.5 debug: 4.3.4 - eslint: 8.35.0 + eslint: 8.36.0 typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/5.54.1: + /@typescript-eslint/scope-manager/5.55.0: resolution: - { integrity: sha512-zWKuGliXxvuxyM71UA/EcPxaviw39dB2504LqAmFDjmkpO8qNLHcmzlh6pbHs1h/7YQ9bnsO8CCcYCSA8sykUg== } + { integrity: sha512-OK+cIO1ZGhJYNCL//a3ROpsd83psf4dUJ4j7pdNVzd5DmIk+ffkuUIX2vcZQbEW/IR41DYsfJTB19tpCboxQuw== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: - '@typescript-eslint/types': 5.54.1 - '@typescript-eslint/visitor-keys': 5.54.1 + '@typescript-eslint/types': 5.55.0 + '@typescript-eslint/visitor-keys': 5.55.0 dev: true - /@typescript-eslint/type-utils/5.54.1_ycpbpc6yetojsgtrx3mwntkhsu: + /@typescript-eslint/type-utils/5.55.0_vgl77cfdswitgr47lm5swmv43m: resolution: - { integrity: sha512-WREHsTz0GqVYLIbzIZYbmUUr95DKEKIXZNH57W3s+4bVnuF1TKe2jH8ZNH8rO1CeMY3U4j4UQeqPNkHMiGem3g== } + { integrity: sha512-ObqxBgHIXj8rBNm0yh8oORFrICcJuZPZTqtAFh0oZQyr5DnAHZWfyw54RwpEEH+fD8suZaI0YxvWu5tYE/WswA== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: '*' @@ -1417,25 +1502,25 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.54.1_typescript@4.9.5 - '@typescript-eslint/utils': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.5 + '@typescript-eslint/utils': 5.55.0_vgl77cfdswitgr47lm5swmv43m debug: 4.3.4 - eslint: 8.35.0 + eslint: 8.36.0 tsutils: 3.21.0_typescript@4.9.5 typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types/5.54.1: + /@typescript-eslint/types/5.55.0: resolution: - { integrity: sha512-G9+1vVazrfAfbtmCapJX8jRo2E4MDXxgm/IMOF4oGh3kq7XuK3JRkOg6y2Qu1VsTRmWETyTkWt1wxy7X7/yLkw== } + { integrity: sha512-M4iRh4AG1ChrOL6Y+mETEKGeDnT7Sparn6fhZ5LtVJF1909D5O4uqK+C5NPbLmpfZ0XIIxCdwzKiijpZUOvOug== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dev: true - /@typescript-eslint/typescript-estree/5.54.1_typescript@4.9.5: + /@typescript-eslint/typescript-estree/5.55.0_typescript@4.9.5: resolution: - { integrity: sha512-bjK5t+S6ffHnVwA0qRPTZrxKSaFYocwFIkZx5k7pvWfsB1I57pO/0M0Skatzzw1sCkjJ83AfGTL0oFIFiDX3bg== } + { integrity: sha512-I7X4A9ovA8gdpWMpr7b1BN9eEbvlEtWhQvpxp/yogt48fy9Lj3iE3ild/1H3jKBBIYj5YYJmS2+9ystVhC7eaQ== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: typescript: '*' @@ -1443,8 +1528,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.54.1 - '@typescript-eslint/visitor-keys': 5.54.1 + '@typescript-eslint/types': 5.55.0 + '@typescript-eslint/visitor-keys': 5.55.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1455,33 +1540,33 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.54.1_ycpbpc6yetojsgtrx3mwntkhsu: + /@typescript-eslint/utils/5.55.0_vgl77cfdswitgr47lm5swmv43m: resolution: - { integrity: sha512-IY5dyQM8XD1zfDe5X8jegX6r2EVU5o/WJnLu/znLPWCBF7KNGC+adacXnt5jEYS9JixDcoccI6CvE4RCjHMzCQ== } + { integrity: sha512-FkW+i2pQKcpDC3AY6DU54yl8Lfl14FVGYDgBTyGKB75cCwV3KpkpTMFi9d9j2WAJ4271LR2HeC5SEWF/CZmmfw== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: + '@eslint-community/eslint-utils': 4.2.0_eslint@8.36.0 '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 - '@typescript-eslint/scope-manager': 5.54.1 - '@typescript-eslint/types': 5.54.1 - '@typescript-eslint/typescript-estree': 5.54.1_typescript@4.9.5 - eslint: 8.35.0 + '@typescript-eslint/scope-manager': 5.55.0 + '@typescript-eslint/types': 5.55.0 + '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.5 + eslint: 8.36.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.35.0 semver: 7.3.8 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys/5.54.1: + /@typescript-eslint/visitor-keys/5.55.0: resolution: - { integrity: sha512-q8iSoHTgwCfgcRJ2l2x+xCbu8nBlRAlsQ33k24Adj8eoVBE0f8dUeI+bAa8F84Mv05UGbAx57g2zrRsYIooqQg== } + { integrity: sha512-q2dlHHwWgirKh1D3acnuApXG+VNXpEY5/AwRxDVuEQpxWaB0jCDe0jFMVMALJ3ebSfuOVE8/rMS+9ZOYGg1GWw== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: - '@typescript-eslint/types': 5.54.1 + '@typescript-eslint/types': 5.55.0 eslint-visitor-keys: 3.3.0 dev: true @@ -1695,6 +1780,14 @@ packages: deep-equal: 2.2.0 dev: true + /array-buffer-byte-length/1.0.0: + resolution: + { integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== } + dependencies: + call-bind: 1.0.2 + is-array-buffer: 3.0.2 + dev: true + /array-includes/3.1.6: resolution: { integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== } @@ -1702,7 +1795,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 get-intrinsic: 1.2.0 is-string: 1.0.7 dev: true @@ -1720,7 +1813,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 es-shim-unscopables: 1.0.0 dev: true @@ -1731,7 +1824,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 es-shim-unscopables: 1.0.0 dev: true @@ -1741,7 +1834,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 es-shim-unscopables: 1.0.0 get-intrinsic: 1.2.0 dev: true @@ -1766,7 +1859,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.21.5 - caniuse-lite: 1.0.30001464 + caniuse-lite: 1.0.30001466 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -1793,7 +1886,7 @@ packages: deep-equal: 2.2.0 dev: true - /babel-loader/9.1.2_@babel+core@7.21.0: + /babel-loader/9.1.2_@babel+core@7.21.3: resolution: { integrity: sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA== } engines: { node: '>= 14.15.0' } @@ -1801,18 +1894,18 @@ packages: '@babel/core': ^7.12.0 webpack: '>=5' dependencies: - '@babel/core': 7.21.0 + '@babel/core': 7.21.3 find-cache-dir: 3.3.2 schema-utils: 4.0.0 dev: false - /babel-plugin-transform-remove-imports/1.7.0_@babel+core@7.21.0: + /babel-plugin-transform-remove-imports/1.7.0_@babel+core@7.21.3: resolution: { integrity: sha512-gprmWf6ry5qrnxMyiDaxZpXzZJP6R9FRA+p0AImLIWRmSEGtlKcFprHKeGMZYkII9rJR6Q1hYou+n1fk6rWf2g== } peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.0 + '@babel/core': 7.21.3 dev: false /bail/2.0.2: @@ -1888,11 +1981,20 @@ packages: engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 } hasBin: true dependencies: - caniuse-lite: 1.0.30001464 - electron-to-chromium: 1.4.327 + caniuse-lite: 1.0.30001466 + electron-to-chromium: 1.4.330 node-releases: 2.0.10 update-browserslist-db: 1.0.10_browserslist@4.21.5 + /bufferutil/4.0.7: + resolution: + { integrity: sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== } + engines: { node: '>=6.14.2' } + requiresBuild: true + dependencies: + node-gyp-build: 4.6.0 + dev: false + /call-bind/1.0.2: resolution: { integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== } @@ -1912,9 +2014,9 @@ packages: engines: { node: '>= 6' } dev: true - /caniuse-lite/1.0.30001464: + /caniuse-lite/1.0.30001466: resolution: - { integrity: sha512-oww27MtUmusatpRpCGSOneQk2/l5czXANDSFvsc7VuOQ86s3ANhZetpwXNf1zY/zdfP63Xvjz325DAdAoES13g== } + { integrity: sha512-ewtFBSfWjEmxUgNBSZItFSmVtvk9zkwkl1OfRZlKA8slltRN+/C/tuGVrF9styXkN36Yu3+SeJ1qkXxDEyNZ5w== } /ccount/2.0.1: resolution: @@ -1939,6 +2041,12 @@ packages: supports-color: 7.2.0 dev: true + /chalk/5.2.0: + resolution: + { integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== } + engines: { node: ^12.17.0 || ^14.13 || >=16.0.0 } + dev: true + /character-entities-html4/2.1.0: resolution: { integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== } @@ -2045,10 +2153,10 @@ packages: { integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== } dev: false - /commander/9.5.0: + /commander/10.0.0: resolution: - { integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== } - engines: { node: ^12.20.0 || >=14 } + { integrity: sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA== } + engines: { node: '>=14' } dev: true /commondir/1.0.1: @@ -2066,6 +2174,15 @@ packages: { integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== } dev: false + /cross-fetch/3.1.5: + resolution: + { integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== } + dependencies: + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: false + /cross-spawn/7.0.3: resolution: { integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== } @@ -2092,11 +2209,31 @@ packages: resolution: { integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== } + /d/1.0.1: + resolution: + { integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== } + dependencies: + es5-ext: 0.10.62 + type: 1.2.0 + dev: false + /damerau-levenshtein/1.0.8: resolution: { integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== } dev: true + /debug/2.6.9: + resolution: + { integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== } + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: false + /debug/3.2.7: resolution: { integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== } @@ -2255,9 +2392,9 @@ packages: { integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== } dev: true - /electron-to-chromium/1.4.327: + /electron-to-chromium/1.4.330: resolution: - { integrity: sha512-DIk2H4g/3ZhjgiABJjVdQvUdMlSABOsjeCm6gmUzIdKxAuFrGiJ8QXMm3i09grZdDBMC/d8MELMrdwYRC0+YHg== } + { integrity: sha512-PqyefhybrVdjAJ45HaPLtuVaehiSw7C3ya0aad+rvmV53IVyXmYRk3pwIOb2TxTDTnmgQdn46NjMMaysx79/6Q== } /emoji-regex/8.0.0: resolution: @@ -2278,16 +2415,16 @@ packages: tapable: 2.2.1 dev: true - /es-abstract/1.21.1: + /es-abstract/1.21.2: resolution: - { integrity: sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg== } + { integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== } engines: { node: '>= 0.4' } dependencies: + array-buffer-byte-length: 1.0.0 available-typed-arrays: 1.0.5 call-bind: 1.0.2 es-set-tostringtag: 2.0.1 es-to-primitive: 1.2.1 - function-bind: 1.1.1 function.prototype.name: 1.1.5 get-intrinsic: 1.2.0 get-symbol-description: 1.0.0 @@ -2311,6 +2448,7 @@ packages: object.assign: 4.1.4 regexp.prototype.flags: 1.4.3 safe-regex-test: 1.0.0 + string.prototype.trim: 1.2.7 string.prototype.trimend: 1.0.6 string.prototype.trimstart: 1.0.6 typed-array-length: 1.0.4 @@ -2360,6 +2498,34 @@ packages: is-symbol: 1.0.4 dev: true + /es5-ext/0.10.62: + resolution: + { integrity: sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== } + engines: { node: '>=0.10' } + requiresBuild: true + dependencies: + es6-iterator: 2.0.3 + es6-symbol: 3.1.3 + next-tick: 1.1.0 + dev: false + + /es6-iterator/2.0.3: + resolution: + { integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== } + dependencies: + d: 1.0.1 + es5-ext: 0.10.62 + es6-symbol: 3.1.3 + dev: false + + /es6-symbol/3.1.3: + resolution: + { integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== } + dependencies: + d: 1.0.1 + ext: 1.7.0 + dev: false + /escalade/3.1.1: resolution: { integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== } @@ -2382,7 +2548,7 @@ packages: engines: { node: '>=12' } dev: false - /eslint-config-next/13.2.4_ycpbpc6yetojsgtrx3mwntkhsu: + /eslint-config-next/13.2.4_vgl77cfdswitgr47lm5swmv43m: resolution: { integrity: sha512-lunIBhsoeqw6/Lfkd6zPt25w1bn0znLA/JCL+au1HoEpSb4/PpsOYsYtgV/q+YPsoKIOzFyU5xnb04iZnXjUvg== } peerDependencies: @@ -2394,28 +2560,28 @@ packages: dependencies: '@next/eslint-plugin-next': 13.2.4 '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/parser': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu - eslint: 8.35.0 + '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m + eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.3_yckic57kx266ph64dhq6ozvb54 - eslint-plugin-import: 2.27.5_yiggpkcwtyhpwcphetqfqiayhm - eslint-plugin-jsx-a11y: 6.7.1_eslint@8.35.0 - eslint-plugin-react: 7.32.2_eslint@8.35.0 - eslint-plugin-react-hooks: 4.6.0_eslint@8.35.0 + eslint-import-resolver-typescript: 3.5.3_eakrjjutlgqjxe5ydhtnd4qdmy + eslint-plugin-import: 2.27.5_v7jo3sddp7aqau7pajjy572cju + eslint-plugin-jsx-a11y: 6.7.1_eslint@8.36.0 + eslint-plugin-react: 7.32.2_eslint@8.36.0 + eslint-plugin-react-hooks: 4.6.0_eslint@8.36.0 typescript: 4.9.5 transitivePeerDependencies: - eslint-import-resolver-webpack - supports-color dev: true - /eslint-config-prettier/8.7.0_eslint@8.35.0: + /eslint-config-prettier/8.7.0_eslint@8.36.0: resolution: { integrity: sha512-HHVXLSlVUhMSmyW4ZzEuvjpwqamgmlfkutD53cYXLikh4pt/modINRcCIApJ84czDxM4GZInwUrromsDdTImTA== } hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.35.0 + eslint: 8.36.0 dev: true /eslint-import-resolver-node/0.3.7: @@ -2429,7 +2595,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript/3.5.3_yckic57kx266ph64dhq6ozvb54: + /eslint-import-resolver-typescript/3.5.3_eakrjjutlgqjxe5ydhtnd4qdmy: resolution: { integrity: sha512-njRcKYBc3isE42LaTcJNVANR3R99H9bAxBDMNDr2W7yq5gYPxbU3MkdhsQukxZ/Xg9C2vcyLlDsbKfRDg0QvCQ== } engines: { node: ^14.18.0 || >=16.0.0 } @@ -2439,8 +2605,8 @@ packages: dependencies: debug: 4.3.4 enhanced-resolve: 5.12.0 - eslint: 8.35.0 - eslint-plugin-import: 2.27.5_yiggpkcwtyhpwcphetqfqiayhm + eslint: 8.36.0 + eslint-plugin-import: 2.27.5_v7jo3sddp7aqau7pajjy572cju get-tsconfig: 4.4.0 globby: 13.1.3 is-core-module: 2.11.0 @@ -2450,7 +2616,7 @@ packages: - supports-color dev: true - /eslint-module-utils/2.7.4_4ew7aeh2ovxxbkkqgt5g5mz23a: + /eslint-module-utils/2.7.4_wgltsi2kbncdpzwytonvdf2oba: resolution: { integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA== } engines: { node: '>=4' } @@ -2472,16 +2638,16 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m debug: 3.2.7 - eslint: 8.35.0 + eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.3_yckic57kx266ph64dhq6ozvb54 + eslint-import-resolver-typescript: 3.5.3_eakrjjutlgqjxe5ydhtnd4qdmy transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-import/2.27.5_yiggpkcwtyhpwcphetqfqiayhm: + /eslint-plugin-import/2.27.5_v7jo3sddp7aqau7pajjy572cju: resolution: { integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow== } engines: { node: '>=4' } @@ -2492,15 +2658,15 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.35.0 + eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4_4ew7aeh2ovxxbkkqgt5g5mz23a + eslint-module-utils: 2.7.4_wgltsi2kbncdpzwytonvdf2oba has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -2515,7 +2681,7 @@ packages: - supports-color dev: true - /eslint-plugin-jsx-a11y/6.7.1_eslint@8.35.0: + /eslint-plugin-jsx-a11y/6.7.1_eslint@8.36.0: resolution: { integrity: sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA== } engines: { node: '>=4.0' } @@ -2531,7 +2697,7 @@ packages: axobject-query: 3.1.1 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 - eslint: 8.35.0 + eslint: 8.36.0 has: 1.0.3 jsx-ast-utils: 3.3.3 language-tags: 1.0.5 @@ -2541,17 +2707,17 @@ packages: semver: 6.3.0 dev: true - /eslint-plugin-react-hooks/4.6.0_eslint@8.35.0: + /eslint-plugin-react-hooks/4.6.0_eslint@8.36.0: resolution: { integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== } engines: { node: '>=10' } peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 dependencies: - eslint: 8.35.0 + eslint: 8.36.0 dev: true - /eslint-plugin-react/7.32.2_eslint@8.35.0: + /eslint-plugin-react/7.32.2_eslint@8.36.0: resolution: { integrity: sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg== } engines: { node: '>=4' } @@ -2562,7 +2728,7 @@ packages: array.prototype.flatmap: 1.3.1 array.prototype.tosorted: 1.1.1 doctrine: 2.1.0 - eslint: 8.35.0 + eslint: 8.36.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.3 minimatch: 3.1.2 @@ -2594,37 +2760,22 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.35.0: - resolution: - { integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== } - engines: { node: ^10.0.0 || ^12.0.0 || >= 14.0.0 } - peerDependencies: - eslint: '>=5' - dependencies: - eslint: 8.35.0 - eslint-visitor-keys: 2.1.0 - dev: true - - /eslint-visitor-keys/2.1.0: - resolution: - { integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== } - engines: { node: '>=10' } - dev: true - /eslint-visitor-keys/3.3.0: resolution: { integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dev: true - /eslint/8.35.0: + /eslint/8.36.0: resolution: - { integrity: sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw== } + { integrity: sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } hasBin: true dependencies: - '@eslint/eslintrc': 2.0.0 - '@eslint/js': 8.35.0 + '@eslint-community/eslint-utils': 4.2.0_eslint@8.36.0 + '@eslint-community/regexpp': 4.4.0 + '@eslint/eslintrc': 2.0.1 + '@eslint/js': 8.36.0 '@humanwhocodes/config-array': 0.11.8 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -2635,9 +2786,8 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.35.0 eslint-visitor-keys: 3.3.0 - espree: 9.4.1 + espree: 9.5.0 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -2659,7 +2809,6 @@ packages: minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.1 - regexpp: 3.2.0 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 text-table: 0.2.0 @@ -2667,9 +2816,9 @@ packages: - supports-color dev: true - /espree/9.4.1: + /espree/9.5.0: resolution: - { integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== } + { integrity: sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: acorn: 8.8.2 @@ -2711,14 +2860,14 @@ packages: engines: { node: '>=0.10.0' } dev: true - /execa/6.1.0: + /execa/7.1.1: resolution: - { integrity: sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA== } - engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + { integrity: sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q== } + engines: { node: ^14.18.0 || ^16.14.0 || >=18.0.0 } dependencies: cross-spawn: 7.0.3 get-stream: 6.0.1 - human-signals: 3.0.1 + human-signals: 4.3.0 is-stream: 3.0.0 merge-stream: 2.0.0 npm-run-path: 5.1.0 @@ -2727,6 +2876,13 @@ packages: strip-final-newline: 3.0.0 dev: true + /ext/1.7.0: + resolution: + { integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== } + dependencies: + type: 2.7.2 + dev: false + /extend/3.0.2: resolution: { integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== } @@ -2875,7 +3031,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 functions-have-names: 1.2.3 dev: true @@ -3228,10 +3384,10 @@ packages: { integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A== } dev: false - /human-signals/3.0.1: + /human-signals/4.3.0: resolution: - { integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ== } - engines: { node: '>=12.20.0' } + { integrity: sha512-zyzVyMjpGBX2+6cDVZeFPCdtOtdsxOeseRhB9tkQ6xXmGUNrcnBzdEKPy3VPNYz+4gy1oukVOXcrJCunSyc6QQ== } + engines: { node: '>=14.18.0' } dev: true /husky/8.0.3: @@ -3520,6 +3676,11 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-typedarray/1.0.0: + resolution: + { integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== } + dev: false + /is-weakmap/2.0.1: resolution: { integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== } @@ -3558,13 +3719,13 @@ packages: { integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== } dev: true - /isomorphic-ws/5.0.0_ws@8.12.1: + /isomorphic-ws/5.0.0_ws@8.13.0: resolution: { integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw== } peerDependencies: ws: '*' dependencies: - ws: 8.12.1 + ws: 8.13.0 dev: false /javascript-natural-sort/0.7.1: @@ -3661,31 +3822,25 @@ packages: type-check: 0.4.0 dev: true - /lilconfig/2.0.6: - resolution: - { integrity: sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg== } - engines: { node: '>=10' } - dev: true - /lilconfig/2.1.0: resolution: { integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== } engines: { node: '>=10' } dev: true - /lint-staged/13.1.2: + /lint-staged/13.2.0: resolution: - { integrity: sha512-K9b4FPbWkpnupvK3WXZLbgu9pchUJ6N7TtVZjbaPsoizkqFUDkUReUL25xdrCljJs7uLUF3tZ7nVPeo/6lp+6w== } + { integrity: sha512-GbyK5iWinax5Dfw5obm2g2ccUiZXNGtAS4mCbJ0Lv4rq6iEtfBSjOYdcbOtAIFtM114t0vdpViDDetjVTSd8Vw== } engines: { node: ^14.13.1 || >=16.0.0 } hasBin: true dependencies: + chalk: 5.2.0 cli-truncate: 3.1.0 - colorette: 2.0.19 - commander: 9.5.0 + commander: 10.0.0 debug: 4.3.4 - execa: 6.1.0 - lilconfig: 2.0.6 - listr2: 5.0.7 + execa: 7.1.1 + lilconfig: 2.1.0 + listr2: 5.0.8 micromatch: 4.0.5 normalize-path: 3.0.0 object-inspect: 1.12.3 @@ -3697,9 +3852,9 @@ packages: - supports-color dev: true - /listr2/5.0.7: + /listr2/5.0.8: resolution: - { integrity: sha512-MD+qXHPmtivrHIDRwPYdfNkrzqDiuaKU/rfBcec3WMyMF3xylQj3jMq344OtvQxz7zaCFViRAeqlr2AFhPvXHw== } + { integrity: sha512-mC73LitKHj9w6v30nLNGPetZIlfpUniNSsxxrbaPcWOjDb92SHPzJPi/t+v1YC/lxKz/AJ9egOjww0qUuFxBpA== } engines: { node: ^14.13.1 || >=16.0.0 } peerDependencies: enquirer: '>= 2.3.0 < 3' @@ -4290,6 +4445,11 @@ packages: engines: { node: '>=4' } dev: false + /ms/2.0.0: + resolution: + { integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== } + dev: false + /ms/2.1.2: resolution: { integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== } @@ -4319,14 +4479,19 @@ packages: resolution: { integrity: sha512-BTlwYD86PyU0YuO2/CVfm+82WZiUpkspH7YkzFBM/nua/d8zouw+/4eUhLl278dtZXIlarmhpH47cWwred4w6Q== } dependencies: - '@babel/core': 7.21.0 - babel-loader: 9.1.2_@babel+core@7.21.0 - babel-plugin-transform-remove-imports: 1.7.0_@babel+core@7.21.0 + '@babel/core': 7.21.3 + babel-loader: 9.1.2_@babel+core@7.21.3 + babel-plugin-transform-remove-imports: 1.7.0_@babel+core@7.21.3 transitivePeerDependencies: - supports-color - webpack dev: false + /next-tick/1.1.0: + resolution: + { integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== } + dev: false + /next/13.2.4_biqbaboplfbrettd7655fr4n2y: resolution: { integrity: sha512-g1I30317cThkEpvzfXujf0O4wtaQHtDCLhlivwlTJ885Ld+eOgcz7r3TGQzeU+cSRoNHtD8tsJgzxVdYojFssw== } @@ -4351,7 +4516,7 @@ packages: dependencies: '@next/env': 13.2.4 '@swc/helpers': 0.4.14 - caniuse-lite: 1.0.30001464 + caniuse-lite: 1.0.30001466 postcss: 8.4.14 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -4375,6 +4540,25 @@ packages: - babel-plugin-macros dev: false + /node-fetch/2.6.7: + resolution: + { integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== } + engines: { node: 4.x || >=6.0.0 } + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: false + + /node-gyp-build/4.6.0: + resolution: + { integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== } + hasBin: true + dev: false + /node-releases/2.0.10: resolution: { integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== } @@ -4391,12 +4575,12 @@ packages: engines: { node: '>=0.10.0' } dev: true - /nostr-relaypool/0.5.12_ws@8.12.1: + /nostr-relaypool/0.5.18_ws@8.13.0: resolution: - { integrity: sha512-bWf3ESxPGWaLu8pY2fjz8GhQcBNXBUmY0HV935apvfD9GMSIctvTPib+R8w5mo/+tSEOLKwFLc2D/DuJjefMiA== } + { integrity: sha512-l3bR034akVSdd/jSOqcj33k1BYaAwqbJMJQFg3cJ/BXPrXy6fPSd4Qye0vuF+MwtqokmLFa68MM8hbfHeOgYtQ== } dependencies: '@jest/source-map': 29.4.3 - isomorphic-ws: 5.0.0_ws@8.12.1 + isomorphic-ws: 5.0.0_ws@8.13.0 nostr-tools: 1.7.4 safe-stable-stringify: 2.4.2 transitivePeerDependencies: @@ -4484,7 +4668,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 dev: true /object.fromentries/2.0.6: @@ -4494,7 +4678,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 dev: true /object.hasown/1.1.2: @@ -4502,7 +4686,7 @@ packages: { integrity: sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw== } dependencies: define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 dev: true /object.values/1.1.6: @@ -4512,7 +4696,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 dev: true /once/1.4.0: @@ -5111,12 +5295,6 @@ packages: functions-have-names: 1.2.3 dev: true - /regexpp/3.2.0: - resolution: - { integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== } - engines: { node: '>=8' } - dev: true - /rehype-attr/2.1.4: resolution: { integrity: sha512-iAeaL5JyF4XxkcvWzpi/0SAF7iV7qOTaHS56tJuEsXziQc3+PEmMn65kV8OFgbO9mRVY7J1fRC/aLvot1PsNkg== } @@ -5514,7 +5692,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 get-intrinsic: 1.2.0 has-symbols: 1.0.3 internal-slot: 1.0.5 @@ -5522,13 +5700,23 @@ packages: side-channel: 1.0.4 dev: true + /string.prototype.trim/1.2.7: + resolution: + { integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== } + engines: { node: '>= 0.4' } + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.2 + dev: true + /string.prototype.trimend/1.0.6: resolution: { integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== } dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 dev: true /string.prototype.trimstart/1.0.6: @@ -5537,7 +5725,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.21.2 dev: true /stringify-entities/4.0.3: @@ -5709,6 +5897,11 @@ packages: is-number: 7.0.0 dev: true + /tr46/0.0.3: + resolution: + { integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== } + dev: false + /trim-lines/3.0.1: resolution: { integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== } @@ -5769,6 +5962,16 @@ packages: engines: { node: '>=10' } dev: true + /type/1.2.0: + resolution: + { integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== } + dev: false + + /type/2.7.2: + resolution: + { integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== } + dev: false + /typed-array-length/1.0.4: resolution: { integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== } @@ -5778,6 +5981,13 @@ packages: is-typed-array: 1.1.10 dev: true + /typedarray-to-buffer/3.1.5: + resolution: + { integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== } + dependencies: + is-typedarray: 1.0.0 + dev: false + /typescript/4.9.5: resolution: { integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== } @@ -5930,6 +6140,15 @@ packages: tslib: 2.5.0 dev: false + /utf-8-validate/5.0.10: + resolution: + { integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ== } + engines: { node: '>=6.14.2' } + requiresBuild: true + dependencies: + node-gyp-build: 4.6.0 + dev: false + /util-deprecate/1.0.2: resolution: { integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== } @@ -5978,6 +6197,34 @@ packages: { integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ== } dev: false + /webidl-conversions/3.0.1: + resolution: + { integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== } + dev: false + + /websocket/1.0.34: + resolution: + { integrity: sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== } + engines: { node: '>=4.0.0' } + dependencies: + bufferutil: 4.0.7 + debug: 2.6.9 + es5-ext: 0.10.62 + typedarray-to-buffer: 3.1.5 + utf-8-validate: 5.0.10 + yaeti: 0.0.6 + transitivePeerDependencies: + - supports-color + dev: false + + /whatwg-url/5.0.0: + resolution: + { integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== } + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: false + /which-boxed-primitive/1.0.2: resolution: { integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== } @@ -6052,9 +6299,9 @@ packages: { integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== } dev: true - /ws/8.12.1: + /ws/8.13.0: resolution: - { integrity: sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew== } + { integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== } engines: { node: '>=10.0.0' } peerDependencies: bufferutil: ^4.0.1 @@ -6072,6 +6319,12 @@ packages: engines: { node: '>=0.4' } dev: true + /yaeti/0.0.6: + resolution: + { integrity: sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug== } + engines: { node: '>=0.10.32' } + dev: false + /yallist/3.1.1: resolution: { integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== } @@ -6105,10 +6358,10 @@ packages: { integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== } dev: false - github.com/tauri-apps/tauri-plugin-sql/b945c7a74ed207771420f7f0809d20ba66d55f70: + github.com/tauri-apps/tauri-plugin-sql/3a8b9a6b244df7512bc5ef8692cebdedbab3ccce: resolution: { - tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/b945c7a74ed207771420f7f0809d20ba66d55f70, + tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/3a8b9a6b244df7512bc5ef8692cebdedbab3ccce, } name: tauri-plugin-sql-api version: 0.0.0 diff --git a/src/components/user/base.tsx b/src/components/user/base.tsx new file mode 100644 index 00000000..51220251 --- /dev/null +++ b/src/components/user/base.tsx @@ -0,0 +1,63 @@ +import { DatabaseContext } from '@components/contexts/database'; +import { ImageWithFallback } from '@components/imageWithFallback'; + +import { truncate } from '@utils/truncate'; + +import Avatar from 'boring-avatars'; +import { memo, useCallback, useContext, useEffect, useState } from 'react'; + +export const UserBase = memo(function UserBase({ pubkey }: { pubkey: string }) { + const { db }: any = useContext(DatabaseContext); + const [profile, setProfile] = useState({ picture: null, display_name: null, name: null }); + + const cacheProfile = useCallback( + async (event) => { + const metadata: any = JSON.parse(event.content); + // insert to database + await db.execute( + `INSERT OR IGNORE INTO cache_profiles (id, metadata) VALUES ("${pubkey}", '${JSON.stringify(metadata)}')` + ); + // update state + setProfile(metadata); + }, + [db, pubkey] + ); + + useEffect(() => { + fetch(`https://rbr.bio/${pubkey}/metadata.json`, { redirect: 'follow' }) + .then((response) => { + if (response.ok) { + return response.json(); + } else if (response.status === 404) { + return Promise.reject('error 404'); + } else { + return Promise.reject('some other error: ' + response.status); + } + }) + .then((data) => cacheProfile(data)) + .catch((error) => console.log('error is', error)); + }, [cacheProfile, pubkey]); + + return ( +
+
+ {profile.picture ? ( + + ) : ( + + )} +
+
+ + {profile.display_name ? profile.display_name : truncate(pubkey, 16, ' .... ')} + + {profile.name} +
+
+ ); +}); diff --git a/src/pages/onboarding/create/index.tsx b/src/pages/onboarding/create/index.tsx index 7284c748..91e7c6b6 100644 --- a/src/pages/onboarding/create/index.tsx +++ b/src/pages/onboarding/create/index.tsx @@ -93,12 +93,12 @@ export default function Page() { metadata: JSON.stringify(data), npub: npub, privkey: privKey, - pubkey: pubKey, + id: pubKey, }); // redirect to pre-follow setTimeout(() => { setLoading(false); - router.push('/'); + router.push('/onboarding/create/step-2'); }, 1500); }) .catch(console.error); @@ -107,7 +107,7 @@ export default function Page() { return (
-
+

Create new account

diff --git a/src/pages/onboarding/create/step-2.tsx b/src/pages/onboarding/create/step-2.tsx new file mode 100644 index 00000000..2e578818 --- /dev/null +++ b/src/pages/onboarding/create/step-2.tsx @@ -0,0 +1,217 @@ +import BaseLayout from '@layouts/base'; + +import { DatabaseContext } from '@components/contexts/database'; +import { RelayContext } from '@components/contexts/relay'; +import { UserBase } from '@components/user/base'; + +import { CheckCircledIcon } from '@radix-ui/react-icons'; +import useLocalStorage from '@rehooks/local-storage'; +import { createClient } from '@supabase/supabase-js'; +import { useRouter } from 'next/router'; +import { getEventHash, nip19, signEvent } from 'nostr-tools'; +import { + JSXElementConstructor, + Key, + ReactElement, + ReactFragment, + ReactPortal, + useContext, + useEffect, + useState, +} from 'react'; + +const supabase = createClient( + 'https://niwaazauwnrwiwmnocnn.supabase.co', + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5pd2FhemF1d25yd2l3bW5vY25uIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NzYwMjAzMjAsImV4cCI6MTk5MTU5NjMyMH0.IbjrnE6rDgC6lhIAHBIMN4niM2bPjxkRLtvAy_gFgqw' +); + +const initialList = [ + { pubkey: '82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2' }, + { pubkey: 'a341f45ff9758f570a21b000c17d4e53a3a497c8397f26c0e6d61e5acffc7a98' }, + { pubkey: '04c915daefee38317fa734444acee390a8269fe5810b2241e5e6dd343dfbecc9' }, + { pubkey: 'c4eabae1be3cf657bc1855ee05e69de9f059cb7a059227168b80b89761cbc4e0' }, + { pubkey: '6e468422dfb74a5738702a8823b9b28168abab8655faacb6853cd0ee15deee93' }, + { pubkey: 'e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411' }, + { pubkey: '3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d' }, + { pubkey: 'c49d52a573366792b9a6e4851587c28042fb24fa5625c6d67b8c95c8751aca15' }, + { pubkey: 'e33fe65f1fde44c6dc17eeb38fdad0fceaf1cae8722084332ed1e32496291d42' }, + { pubkey: '84dee6e676e5bb67b4ad4e042cf70cbd8681155db535942fcc6a0533858a7240' }, + { pubkey: '703e26b4f8bc0fa57f99d815dbb75b086012acc24fc557befa310f5aa08d1898' }, + { pubkey: 'bf2376e17ba4ec269d10fcc996a4746b451152be9031fa48e74553dde5526bce' }, + { pubkey: '4523be58d395b1b196a9b8c82b038b6895cb02b683d0c253a955068dba1facd0' }, + { pubkey: 'c9b19ffcd43e6a5f23b3d27106ce19e4ad2df89ba1031dd4617f1b591e108965' }, + { pubkey: 'c7dccba4fe4426a7b1ea239a5637ba40fab9862c8c86b3330fe65e9f667435f6' }, + { pubkey: '6e1534f56fc9e937e06237c8ba4b5662bcacc4e1a3cfab9c16d89390bec4fca3' }, + { pubkey: '50d94fc2d8580c682b071a542f8b1e31a200b0508bab95a33bef0855df281d63' }, + { pubkey: '3d2e51508699f98f0f2bdbe7a45b673c687fe6420f466dc296d90b908d51d594' }, + { pubkey: '6e3f51664e19e082df5217fd4492bb96907405a0b27028671dd7f297b688608c' }, + { pubkey: '2edbcea694d164629854a52583458fd6d965b161e3c48b57d3aff01940558884' }, + { pubkey: '3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24' }, + { pubkey: 'eab0e756d32b80bcd464f3d844b8040303075a13eabc3599a762c9ac7ab91f4f' }, + { pubkey: 'be1d89794bf92de5dd64c1e60f6a2c70c140abac9932418fee30c5c637fe9479' }, + { pubkey: 'a5e93aef8e820cbc7ab7b6205f854b87aed4b48c5f6b30fbbeba5c99e40dcf3f' }, + { pubkey: '1989034e56b8f606c724f45a12ce84a11841621aaf7182a1f6564380b9c4276b' }, + { pubkey: 'c48b5cced5ada74db078df6b00fa53fc1139d73bf0ed16de325d52220211dbd5' }, + { pubkey: '460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c' }, + { pubkey: '7f3b464b9ff3623630485060cbda3a7790131c5339a7803bde8feb79a5e1b06a' }, + { pubkey: 'b99dbca0184a32ce55904cb267b22e434823c97f418f36daf5d2dff0dd7b5c27' }, + { pubkey: 'e9e4276490374a0daf7759fd5f475deff6ffb9b0fc5fa98c902b5f4b2fe3bba2' }, + { pubkey: 'ea2e3c814d08a378f8a5b8faecb2884d05855975c5ca4b5c25e2d6f936286f14' }, + { pubkey: 'ff04a0e6cd80c141b0b55825fed127d4532a6eecdb7e743a38a3c28bf9f44609' }, +]; + +export default function Page() { + const router = useRouter(); + + const { db }: any = useContext(DatabaseContext); + const relayPool: any = useContext(RelayContext); + + const [currentUser]: any = useLocalStorage('current-user'); + const [relays] = useLocalStorage('relays'); + + const [loading, setLoading] = useState(false); + const [list, setList]: any = useState(initialList); + const [follows, setFollows] = useState([]); + + // toggle follow state + const toggleFollow = (pubkey: string) => { + const arr = follows.includes(pubkey) ? follows.filter((i) => i !== pubkey) : [...follows, pubkey]; + setFollows(arr); + }; + + // insert follow to database + const insertDB = async () => { + // self follow + await db.execute( + `INSERT OR IGNORE INTO follows (pubkey, account, kind) VALUES ("${currentUser.id}", "${currentUser.id}", "0")` + ); + // follow selected + follows.forEach(async (pubkey) => { + await db.execute( + `INSERT OR IGNORE INTO follows (pubkey, account, kind) VALUES ("${pubkey}", "${currentUser.id}", "0")` + ); + }); + }; + + // build event tags + const createTags = () => { + const tags = []; + // push item to tags + follows.forEach((item) => { + tags.push(['p', item]); + }); + + return tags; + }; + + // commit and publish to relays + const createFollows = () => { + setLoading(true); + + // build event + const event: any = { + content: '', + created_at: Math.floor(Date.now() / 1000), + kind: 3, + pubkey: currentUser.id, + tags: createTags(), + }; + event.id = getEventHash(event); + event.sig = signEvent(event, currentUser.privkey); + + insertDB().then(() => { + // publish to relays + relayPool.publish(event, relays); + // redirect to home + setTimeout(() => { + setLoading(false); + router.push('/'); + }, 1000); + }); + }; + + useEffect(() => { + const fetchData = async () => { + const { data } = await supabase.from('random_users').select('pubkey').limit(28); + // update state + setList((list: any) => [...list, ...data]); + }; + + fetchData().catch(console.error); + }, []); + + return ( +
+
+
+

+ Personalized your newsfeed +

+

+ Follow at least{' '} + + {follows.length}/10 + {' '} + plebs +

+
+
+
+
+ {list.map((item: { pubkey: string }, index: Key) => ( + + ))} +
+
+ {follows.length >= 10 && ( +
+ +
+ )} +
+ ); +} + +Page.getLayout = function getLayout( + page: + | string + | number + | boolean + | ReactElement> + | ReactFragment + | ReactPortal +) { + return {page}; +}; diff --git a/src/pages/onboarding/login/index.tsx b/src/pages/onboarding/login/index.tsx index d61a8310..4bd16e78 100644 --- a/src/pages/onboarding/login/index.tsx +++ b/src/pages/onboarding/login/index.tsx @@ -56,9 +56,11 @@ export default function Page() { return (
-

- Login with Private Key -

+
+

+ Login with Private Key +

+
diff --git a/src/pages/onboarding/login/step-2.tsx b/src/pages/onboarding/login/step-2.tsx index 442618c4..b87485e3 100644 --- a/src/pages/onboarding/login/step-2.tsx +++ b/src/pages/onboarding/login/step-2.tsx @@ -91,7 +91,7 @@ export default function Page() { return (
-
+

Bringing back your profile...

From 43330418729bced5501bab3a9e85309ede7b2181 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:09:23 +0700 Subject: [PATCH 05/71] updated navigatorbar --- src/components/columns/navigator/index.tsx | 113 ++++++++---------- .../columns/navigator/messages/index.tsx | 29 +---- src/components/user/mini.tsx | 75 ++++++++++++ 3 files changed, 131 insertions(+), 86 deletions(-) create mode 100644 src/components/user/mini.tsx diff --git a/src/components/columns/navigator/index.tsx b/src/components/columns/navigator/index.tsx index 94997151..6d0d503b 100644 --- a/src/components/columns/navigator/index.tsx +++ b/src/components/columns/navigator/index.tsx @@ -2,73 +2,60 @@ import ActiveLink from '@components/activeLink'; import Messages from '@components/columns/navigator/messages'; import { PlusIcon } from '@radix-ui/react-icons'; +import useLocalStorage from '@rehooks/local-storage'; export default function NavigatorColumn() { + const [follows] = useLocalStorage('follows'); + return ( -
-
- {/* Create post -
-
-
-
{profile.display_name || ''}
- -
- @{profile.username || ''} -
-
- -
-
- */} - {/* Newsfeed */} -
-
-

Newsfeed

- -
-
- -
- -
- following -
- -
- -
- circle -
-
+
+ {/* Newsfeed */} +
+
+

Newsfeed

+
- {/* Messages */} -
-
-

Messages

- -
-
- -
+
+ +
+ +
+ following +
+ +
+ +
+ circle +
+
+
+ {/* Messages */} +
+
+

Messages

+ +
+
+
diff --git a/src/components/columns/navigator/messages/index.tsx b/src/components/columns/navigator/messages/index.tsx index 4e288a3e..a7c369fb 100644 --- a/src/components/columns/navigator/messages/index.tsx +++ b/src/components/columns/navigator/messages/index.tsx @@ -1,31 +1,14 @@ -import Avatar from 'boring-avatars'; -import { useState } from 'react'; -import { Config, names, uniqueNamesGenerator } from 'unique-names-generator'; +import { UserMini } from '@components/user/mini'; -const config: Config = { - dictionaries: [names], -}; +import { Key } from 'react'; -export default function Messages() { - const [data] = useState([...Array(15)]); +export default function Messages({ data }: { data: any }) { + console.log(data); return ( <> - {data.map((item, index) => ( -
- -
-

{uniqueNamesGenerator(config).toString()}

-
-
+ {data.map((item: string, index: Key) => ( + ))} ); diff --git a/src/components/user/mini.tsx b/src/components/user/mini.tsx new file mode 100644 index 00000000..824ea181 --- /dev/null +++ b/src/components/user/mini.tsx @@ -0,0 +1,75 @@ +import { DatabaseContext } from '@components/contexts/database'; +import { ImageWithFallback } from '@components/imageWithFallback'; + +import { truncate } from '@utils/truncate'; + +import Avatar from 'boring-avatars'; +import { memo, useCallback, useContext, useEffect, useState } from 'react'; + +export const UserMini = memo(function UserMini({ pubkey }: { pubkey: string }) { + const { db }: any = useContext(DatabaseContext); + const [profile, setProfile] = useState({ picture: null, display_name: null }); + + const insertCacheProfile = useCallback( + async (event) => { + const metadata: any = JSON.parse(event.content); + // insert to database + await db.execute( + `INSERT OR IGNORE INTO cache_profiles (id, metadata) VALUES ("${pubkey}", '${JSON.stringify(metadata)}')` + ); + // update state + setProfile(metadata); + }, + [db, pubkey] + ); + + const getCacheProfile = useCallback(async () => { + const result: any = await db.select(`SELECT metadata FROM cache_profiles WHERE id = "${pubkey}"`); + return result[0]; + }, [db, pubkey]); + + useEffect(() => { + getCacheProfile() + .then((res) => { + if (res !== undefined) { + setProfile(JSON.parse(res.metadata)); + } else { + fetch(`https://rbr.bio/${pubkey}/metadata.json`, { redirect: 'follow' }) + .then((response) => { + if (response.ok) { + return response.json(); + } else if (response.status === 404) { + return Promise.reject('error 404'); + } else { + return Promise.reject('some other error: ' + response.status); + } + }) + .then((data) => insertCacheProfile(data)) + .catch((error) => console.log('error is', error)); + } + }) + .catch(console.error); + }, [getCacheProfile, insertCacheProfile, pubkey]); + + return ( +
+
+ {profile.picture ? ( + + ) : ( + + )} +
+
+

+ {profile.display_name ? profile.display_name : truncate(pubkey, 16, ' .... ')} +

+
+
+ ); +}); From 387ca17a59a515c659613e049ae9545c5273c02f Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:38:16 +0700 Subject: [PATCH 06/71] updated account column --- src/components/columns/account/account.tsx | 15 +++------------ src/components/columns/account/index.tsx | 4 +--- src/components/user/mini.tsx | 2 +- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/components/columns/account/account.tsx b/src/components/columns/account/account.tsx index 493e1d5d..22272863 100644 --- a/src/components/columns/account/account.tsx +++ b/src/components/columns/account/account.tsx @@ -1,7 +1,7 @@ import Image from 'next/image'; import { memo } from 'react'; -export const Account = memo(function Account({ user, current }: { user: any; current: string }) { +export const Account = memo(function Account({ user }: { user: any }) { const userData = JSON.parse(user.metadata); const setCurrentUser = () => { @@ -9,17 +9,8 @@ export const Account = memo(function Account({ user, current }: { user: any; cur }; return ( - ); }); diff --git a/src/components/columns/account/index.tsx b/src/components/columns/account/index.tsx index d7c5669d..0d52d63f 100644 --- a/src/components/columns/account/index.tsx +++ b/src/components/columns/account/index.tsx @@ -2,14 +2,12 @@ import { Account } from '@components/columns/account/account'; import LumeSymbol from '@assets/icons/Lume'; import { PlusIcon } from '@radix-ui/react-icons'; -import { useLocalStorage } from '@rehooks/local-storage'; import Link from 'next/link'; import { useCallback, useEffect, useState } from 'react'; import Database from 'tauri-plugin-sql-api'; export default function AccountColumn() { const [users, setUsers] = useState([]); - const [currentUser]: any = useLocalStorage('current-user'); const getAccounts = useCallback(async () => { const db = await Database.load('sqlite:lume.db'); @@ -26,7 +24,7 @@ export default function AccountColumn() {
{users.map((user, index) => ( - + ))} -
+
{profile.picture ? ( ) : ( From d30d78608f4447d53efa29996ff07a7a3dc469e8 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:03:12 +0700 Subject: [PATCH 07/71] added more relays to sql migration --- .../migrations/20230226004139_create_tables.sql | 12 +++++++++++- src/components/user/mini.tsx | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src-tauri/migrations/20230226004139_create_tables.sql b/src-tauri/migrations/20230226004139_create_tables.sql index 7e923494..a25631ae 100644 --- a/src-tauri/migrations/20230226004139_create_tables.sql +++ b/src-tauri/migrations/20230226004139_create_tables.sql @@ -13,7 +13,7 @@ INSERT INTO relays (relay_url, relay_status) VALUES ("wss://relay.damus.io", "1"), - ("wss://relay.uselume.xyz", "0"), + ("wss://eden.nostr.land", "1"), ("wss://nostr-pub.wellorder.net", "1"), ("wss://nostr.bongbong.com", "1"), ("wss://nostr.zebedee.cloud", "1"), @@ -21,6 +21,16 @@ VALUES ("wss://nostr.walletofsatoshi.com", "1"), ("wss://relay.snort.social", "1"), ("wss://offchain.pub", "1"), + ("wss://brb.io", "1"), + ("wss://relay.current.fyi", "1"), + ("wss://nostr.relayer.se", "1"), + ("wss://nostr.bitcoiner.social", "1"), + ("wss://relay.nostr.info", "1"), + ("wss://relay.zeh.app", "1"), + ("wss://nostr-01.dorafactory.org", "1"), + ("wss://nostr.zhongwen.world", "1"), + ("wss://nostro.cc", "1"), + ("wss://relay.nostr.net.in", "1"), ("wss://nos.lol", "1"); -- create accounts diff --git a/src/components/user/mini.tsx b/src/components/user/mini.tsx index f211a060..4ebf4af5 100644 --- a/src/components/user/mini.tsx +++ b/src/components/user/mini.tsx @@ -53,7 +53,7 @@ export const UserMini = memo(function UserMini({ pubkey }: { pubkey: string }) { return (
-
+
{profile.picture ? ( ) : ( From 58fb8e0a33f9cce51add6d0e2bd4c522571945b4 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:27:07 +0700 Subject: [PATCH 08/71] updated sql migration --- .../migrations/20230226004139_create_tables.sql | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src-tauri/migrations/20230226004139_create_tables.sql b/src-tauri/migrations/20230226004139_create_tables.sql index a25631ae..3ae80b73 100644 --- a/src-tauri/migrations/20230226004139_create_tables.sql +++ b/src-tauri/migrations/20230226004139_create_tables.sql @@ -9,6 +9,10 @@ CREATE TABLE updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); +-- add default relays +-- relay status: +-- 0: off +-- 1: on INSERT INTO relays (relay_url, relay_status) VALUES @@ -34,6 +38,9 @@ VALUES ("wss://nos.lol", "1"); -- create accounts +-- is_active (part of multi-account feature): +-- 0: false +-- 1: true CREATE TABLE accounts ( id TEXT PRIMARY KEY, @@ -45,6 +52,9 @@ CREATE TABLE ); -- create follows +-- kind (part of multi-newsfeed feature): +-- 0: direct +-- 1: follow of follow CREATE TABLE follows ( id INTEGER PRIMARY KEY, @@ -55,7 +65,7 @@ CREATE TABLE ); -- create index for pubkey in follows -CREATE UNIQUE INDEX index_pubkey ON follows (pubkey); +CREATE UNIQUE INDEX index_pubkey_on_follows ON follows (pubkey); -- create cache profiles CREATE TABLE @@ -74,7 +84,5 @@ CREATE TABLE created_at TEXT, kind INTEGER NOT NULL DEFAULT 1, tags TEXT NOT NULL, - content TEXT NOT NULL, - relay TEXT, - is_multi BOOLEAN DEFAULT 0 + content TEXT NOT NULL ); \ No newline at end of file From e5bd58eca8150b5b5d8347713e2cbb34763c316c Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Thu, 16 Mar 2023 08:18:04 +0700 Subject: [PATCH 09/71] updated navigator column --- package.json | 1 + pnpm-lock.yaml | 22 +++++++ src/components/columns/navigator/index.tsx | 58 ++----------------- .../columns/navigator/messages/index.tsx | 37 +++++++++--- .../columns/navigator/messages/list.tsx | 13 +++++ .../columns/navigator/newsfeed/index.tsx | 51 ++++++++++++++++ src/components/user/mini.tsx | 6 +- src/layouts/withSidebar.tsx | 6 +- src/pages/onboarding/login/step-2.tsx | 11 ++-- 9 files changed, 132 insertions(+), 73 deletions(-) create mode 100644 src/components/columns/navigator/messages/list.tsx create mode 100644 src/components/columns/navigator/newsfeed/index.tsx diff --git a/package.json b/package.json index 718f8b5a..13515ca7 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "**/*": "prettier --write --ignore-unknown" }, "dependencies": { + "@radix-ui/react-collapsible": "^1.0.2", "@radix-ui/react-dialog": "^1.0.3", "@radix-ui/react-dropdown-menu": "^2.0.4", "@radix-ui/react-icons": "^1.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95f9b161..93b703dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,6 +1,7 @@ lockfileVersion: 5.4 specifiers: + '@radix-ui/react-collapsible': ^1.0.2 '@radix-ui/react-dialog': ^1.0.3 '@radix-ui/react-dropdown-menu': ^2.0.4 '@radix-ui/react-icons': ^1.2.0 @@ -52,6 +53,7 @@ specifiers: ws: ^8.13.0 dependencies: + '@radix-ui/react-collapsible': 1.0.2_biqbaboplfbrettd7655fr4n2y '@radix-ui/react-dialog': 1.0.3_zula6vjvt3wdocc4mwcxqa6nzi '@radix-ui/react-dropdown-menu': 2.0.4_zula6vjvt3wdocc4mwcxqa6nzi '@radix-ui/react-icons': 1.2.0_react@18.2.0 @@ -737,6 +739,26 @@ packages: react-dom: 18.2.0_react@18.2.0 dev: false + /@radix-ui/react-collapsible/1.0.2_biqbaboplfbrettd7655fr4n2y: + resolution: + { integrity: sha512-QNiDT6Au8jUU0K1WV+HEd4loH7C5CKQjeXxskwqyiyAkyCmW7qlQM5vSSJCIoQC+OVPyhgafSmGudRP8Qm1/gA== } + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.21.0 + '@radix-ui/primitive': 1.0.0 + '@radix-ui/react-compose-refs': 1.0.0_react@18.2.0 + '@radix-ui/react-context': 1.0.0_react@18.2.0 + '@radix-ui/react-id': 1.0.0_react@18.2.0 + '@radix-ui/react-presence': 1.0.0_biqbaboplfbrettd7655fr4n2y + '@radix-ui/react-primitive': 1.0.2_biqbaboplfbrettd7655fr4n2y + '@radix-ui/react-use-controllable-state': 1.0.0_react@18.2.0 + '@radix-ui/react-use-layout-effect': 1.0.0_react@18.2.0 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + dev: false + /@radix-ui/react-collection/1.0.2_biqbaboplfbrettd7655fr4n2y: resolution: { integrity: sha512-s8WdQQ6wNXpaxdZ308KSr8fEWGrg4un8i4r/w7fhiS4ElRNjk5rRcl0/C6TANG2LvLOGIxtzo/jAg6Qf73TEBw== } diff --git a/src/components/columns/navigator/index.tsx b/src/components/columns/navigator/index.tsx index 6d0d503b..9b54946c 100644 --- a/src/components/columns/navigator/index.tsx +++ b/src/components/columns/navigator/index.tsx @@ -1,63 +1,13 @@ -import ActiveLink from '@components/activeLink'; import Messages from '@components/columns/navigator/messages'; - -import { PlusIcon } from '@radix-ui/react-icons'; -import useLocalStorage from '@rehooks/local-storage'; +import Newsfeed from '@components/columns/navigator/newsfeed'; export default function NavigatorColumn() { - const [follows] = useLocalStorage('follows'); - return ( -
+
{/* Newsfeed */} -
-
-

Newsfeed

- -
-
- -
- -
- following -
- -
- -
- circle -
-
-
+ {/* Messages */} -
-
-

Messages

- -
-
- -
-
+
); } diff --git a/src/components/columns/navigator/messages/index.tsx b/src/components/columns/navigator/messages/index.tsx index a7c369fb..150726ca 100644 --- a/src/components/columns/navigator/messages/index.tsx +++ b/src/components/columns/navigator/messages/index.tsx @@ -1,15 +1,34 @@ -import { UserMini } from '@components/user/mini'; +import { MessageList } from '@components/columns/navigator/messages/list'; -import { Key } from 'react'; +import * as Collapsible from '@radix-ui/react-collapsible'; +import { ChevronUpIcon } from '@radix-ui/react-icons'; +import useLocalStorage from '@rehooks/local-storage'; +import { useState } from 'react'; -export default function Messages({ data }: { data: any }) { - console.log(data); +export default function Messages() { + const [open, setOpen] = useState(true); + const [follows] = useLocalStorage('follows'); return ( - <> - {data.map((item: string, index: Key) => ( - - ))} - + +
+ + +

+ Messages +

+
+ + + +
+
); } diff --git a/src/components/columns/navigator/messages/list.tsx b/src/components/columns/navigator/messages/list.tsx new file mode 100644 index 00000000..59de3e5c --- /dev/null +++ b/src/components/columns/navigator/messages/list.tsx @@ -0,0 +1,13 @@ +import { UserMini } from '@components/user/mini'; + +import { Key, memo } from 'react'; + +export const MessageList = memo(function MessageList({ data }: { data: any }) { + return ( + <> + {data.map((item: string, index: Key) => ( + + ))} + + ); +}); diff --git a/src/components/columns/navigator/newsfeed/index.tsx b/src/components/columns/navigator/newsfeed/index.tsx new file mode 100644 index 00000000..f0742cf3 --- /dev/null +++ b/src/components/columns/navigator/newsfeed/index.tsx @@ -0,0 +1,51 @@ +import ActiveLink from '@components/activeLink'; + +import * as Collapsible from '@radix-ui/react-collapsible'; +import { ChevronUpIcon } from '@radix-ui/react-icons'; +import { useState } from 'react'; + +export default function Newsfeed() { + const [open, setOpen] = useState(true); + + return ( + +
+ + +

+ Newsfeed +

+
+ + +
+ +
+ Following +
+ +
+ +
+ Circle +
+
+
+
+ ); +} diff --git a/src/components/user/mini.tsx b/src/components/user/mini.tsx index 4ebf4af5..28c8f3e5 100644 --- a/src/components/user/mini.tsx +++ b/src/components/user/mini.tsx @@ -53,7 +53,7 @@ export const UserMini = memo(function UserMini({ pubkey }: { pubkey: string }) { return (
-
+
{profile.picture ? ( ) : ( @@ -65,8 +65,8 @@ export const UserMini = memo(function UserMini({ pubkey }: { pubkey: string }) { /> )}
-
-

+

+

{profile.display_name ? profile.display_name : truncate(pubkey, 16, ' .... ')}

diff --git a/src/layouts/withSidebar.tsx b/src/layouts/withSidebar.tsx index 2b7f7e66..6640ffd7 100644 --- a/src/layouts/withSidebar.tsx +++ b/src/layouts/withSidebar.tsx @@ -11,13 +11,13 @@ export default function WithSidebarLayout({ children }: { children: React.ReactN >
-
+
-
-
+
+
diff --git a/src/pages/onboarding/login/step-2.tsx b/src/pages/onboarding/login/step-2.tsx index b87485e3..07bae67f 100644 --- a/src/pages/onboarding/login/step-2.tsx +++ b/src/pages/onboarding/login/step-2.tsx @@ -5,7 +5,6 @@ import { RelayContext } from '@components/contexts/relay'; import { useLocalStorage } from '@rehooks/local-storage'; import Image from 'next/image'; -import Link from 'next/link'; import { useRouter } from 'next/router'; import { getPublicKey, nip19 } from 'nostr-tools'; import { @@ -62,6 +61,10 @@ export default function Page() { [db, pubkey] ); + const submit = () => { + router.push('/'); + }; + useEffect(() => { relayPool.subscribe( [ @@ -122,12 +125,12 @@ export default function Page() {
- submit()} className="inline-flex w-full transform items-center justify-center rounded-lg bg-gradient-to-r from-fuchsia-300 via-orange-100 to-amber-300 px-3.5 py-2.5 font-medium text-zinc-800 active:translate-y-1 disabled:cursor-not-allowed disabled:opacity-30" > Done → - +
From 123d22d5cf2845d8efb1505367c839722ebe5019 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Thu, 16 Mar 2023 10:06:12 +0700 Subject: [PATCH 10/71] updated create note form --- src/components/appHeader/index.tsx | 2 +- .../columns/navigator/messages/index.tsx | 9 +- .../columns/navigator/newsfeed/index.tsx | 11 ++- src/components/note/content/index.tsx | 8 +- .../createPost.tsx => note/form.tsx} | 57 +++++++++--- src/components/note/single.tsx | 2 +- src/components/user/extend.tsx | 88 +++++++++++++++++++ src/pages/newsfeed/following.tsx | 3 +- 8 files changed, 152 insertions(+), 28 deletions(-) rename src/components/{columns/navigator/createPost.tsx => note/form.tsx} (58%) create mode 100644 src/components/user/extend.tsx diff --git a/src/components/appHeader/index.tsx b/src/components/appHeader/index.tsx index 7655c8dd..9eeb3ab9 100644 --- a/src/components/appHeader/index.tsx +++ b/src/components/appHeader/index.tsx @@ -15,7 +15,7 @@ export default function AppHeader() { return (
{/* macos traffic lights */}
-
+
+ +

Messages

diff --git a/src/components/columns/navigator/newsfeed/index.tsx b/src/components/columns/navigator/newsfeed/index.tsx index f0742cf3..7cb204b4 100644 --- a/src/components/columns/navigator/newsfeed/index.tsx +++ b/src/components/columns/navigator/newsfeed/index.tsx @@ -1,7 +1,7 @@ import ActiveLink from '@components/activeLink'; import * as Collapsible from '@radix-ui/react-collapsible'; -import { ChevronUpIcon } from '@radix-ui/react-icons'; +import { TriangleUpIcon } from '@radix-ui/react-icons'; import { useState } from 'react'; export default function Newsfeed() { @@ -11,14 +11,13 @@ export default function Newsfeed() {
- + +

Newsfeed

@@ -27,7 +26,7 @@ export default function Newsfeed() {
diff --git a/src/components/note/content/index.tsx b/src/components/note/content/index.tsx index f4674e3e..d583ff71 100644 --- a/src/components/note/content/index.tsx +++ b/src/components/note/content/index.tsx @@ -1,8 +1,6 @@ -import Reaction from '@components/note/atoms/reaction'; -import Reply from '@components/note/atoms/reply'; -import { User } from '@components/note/atoms/user'; import { ImageCard } from '@components/note/content/preview/imageCard'; import { Video } from '@components/note/content/preview/video'; +import { UserExtend } from '@components/user/extend'; import dynamic from 'next/dynamic'; import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; @@ -63,7 +61,7 @@ export const Content = memo(function Content({ data }: { data: any }) { return (
- +
@@ -87,10 +85,12 @@ export const Content = memo(function Content({ data }: { data: any }) {
<>{previewAttachment()}
+ {/*
+ */}
diff --git a/src/components/columns/navigator/createPost.tsx b/src/components/note/form.tsx similarity index 58% rename from src/components/columns/navigator/createPost.tsx rename to src/components/note/form.tsx index 52feb6d0..aa9083bb 100644 --- a/src/components/columns/navigator/createPost.tsx +++ b/src/components/note/form.tsx @@ -3,6 +3,7 @@ import { RelayContext } from '@components/contexts/relay'; import { dateToUnix } from '@utils/getDate'; import * as Dialog from '@radix-ui/react-dialog'; +import { ImageIcon, SizeIcon } from '@radix-ui/react-icons'; import { useLocalStorage } from '@rehooks/local-storage'; import * as commands from '@uiw/react-md-editor/lib/commands'; import dynamic from 'next/dynamic'; @@ -13,7 +14,7 @@ const MDEditor = dynamic(() => import('@uiw/react-md-editor').then((mod) => mod. ssr: false, }); -export default function CreatePost() { +export default function NoteForm() { const relayPool: any = useContext(RelayContext); const [relays]: any = useLocalStorage('relays'); @@ -57,20 +58,56 @@ export default function CreatePost() { return ( - -
-
+
+
+