diff --git a/packages/client/scan/src/App.tsx b/packages/client/scan/src/App.tsx index 0356f0d4..ba892521 100644 --- a/packages/client/scan/src/App.tsx +++ b/packages/client/scan/src/App.tsx @@ -76,15 +76,13 @@ export default function App() { useEffect(() => { const routerNet = searchParams.get('network')?.toUpperCase() - console.log('routerNet', routerNet) + if (routerNet) { Object.values(Network).includes(routerNet as Network) && setNetwork(routerNet as Network) } }, [searchParams, setSearchParams]) - console.log('network', network) - return ( diff --git a/packages/client/scan/src/components/Dapp/BasicInfo.tsx b/packages/client/scan/src/components/Dapp/BasicInfo.tsx index 3fc691f6..bbbd5696 100644 --- a/packages/client/scan/src/components/Dapp/BasicInfo.tsx +++ b/packages/client/scan/src/components/Dapp/BasicInfo.tsx @@ -10,7 +10,7 @@ import DappMirror from '../icons/DappMirror' import DappMedium from '../icons/DappMedium' import DappGithub from '../icons/DappGithub' import Copy from '../icons/Copy' - +import { useCeramicCtx } from '../../context/CeramicCtx' export default function BasicInfo({ dapp }: { dapp?: Dapp }) { const socialLink = dapp?.socialLink || [] @@ -21,7 +21,7 @@ export default function BasicInfo({ dapp }: { dapp?: Dapp }) { const socialMedium = socialLink.find((item) => item.platform === 'medium') const [showCopyTint, setShowCopyTint] = useState(false) - + const { network } = useCeramicCtx() const copyAppId = useCallback(async (appId: string) => { try { await navigator.clipboard.writeText(appId) @@ -56,7 +56,7 @@ export default function BasicInfo({ dapp }: { dapp?: Dapp }) {
- + diff --git a/packages/client/scan/src/components/Home/Lists/Models.tsx b/packages/client/scan/src/components/Home/Lists/Models.tsx index 8ae2afaa..9792e4f2 100644 --- a/packages/client/scan/src/components/Home/Lists/Models.tsx +++ b/packages/client/scan/src/components/Home/Lists/Models.tsx @@ -53,11 +53,13 @@ function ListCard({ count: number isIndexed?: boolean }) { + const { network } = useCeramicCtx() + return (
{(isIndexed && ( - +

{name}

{shortPubKey(stream_id, { len: 8, split: '-' })} @@ -71,7 +73,9 @@ function ListCard({
{description}
{(isIndexed && ( - {count} + + {count} + )) || count}
diff --git a/packages/client/scan/src/components/Home/Lists/Streams.tsx b/packages/client/scan/src/components/Home/Lists/Streams.tsx index ce6fb3ef..54e5b474 100644 --- a/packages/client/scan/src/components/Home/Lists/Streams.tsx +++ b/packages/client/scan/src/components/Home/Lists/Streams.tsx @@ -45,16 +45,17 @@ function ListCard({ did: string indexingTime: number }) { + const { network } = useCeramicCtx() return (
- + {shortPubKey(streamId, { len: 8, split: '-' })} {' '}
- +
diff --git a/packages/client/scan/src/components/Home/Lists/Title.tsx b/packages/client/scan/src/components/Home/Lists/Title.tsx index 25209969..84fee202 100644 --- a/packages/client/scan/src/components/Home/Lists/Title.tsx +++ b/packages/client/scan/src/components/Home/Lists/Title.tsx @@ -1,6 +1,7 @@ import styled from 'styled-components' import ComposeDB from '../../icons/ComposeDB' import { Link } from 'react-router-dom' +import { useCeramicCtx } from '../../../context/CeramicCtx' export default function Title({ title, @@ -9,6 +10,7 @@ export default function Title({ title: string viewAll: string }) { + const { network } = useCeramicCtx() return (
@@ -16,7 +18,7 @@ export default function Title({

{title}

- View All + View All
) diff --git a/packages/client/scan/src/components/ListTable.tsx b/packages/client/scan/src/components/ListTable.tsx index 1169a76a..0e42d24f 100644 --- a/packages/client/scan/src/components/ListTable.tsx +++ b/packages/client/scan/src/components/ListTable.tsx @@ -9,6 +9,7 @@ import { TableBox } from './TableBox' import { FamilyOrAppMapReverse, Types } from '../constants' import UserAvatarStyled from './common/UserAvatarStyled' import { UserName } from '@us3r-network/profile' +import { useCeramicCtx } from '../context/CeramicCtx' export default function ListTable({ data, @@ -17,6 +18,7 @@ export default function ListTable({ data: Array showDid?: boolean }) { + const { network } = useCeramicCtx() return ( @@ -41,13 +43,13 @@ export default function ListTable({ let schemaOrModel =
-
if (item.schema) { schemaOrModel = ( - + {shortPubKey(item.schema, { len: 8, split: '-' })} ) } else if (item.model && (item.type === '0' || item.type === '3')) { schemaOrModel = ( - + {shortPubKey(item.model, { len: 8, split: '-' })} ) @@ -56,7 +58,9 @@ export default function ListTable({ return ( - + {shortPubKey(item.streamId, { len: 8, split: '-' })} @@ -64,7 +68,9 @@ export default function ListTable({
- +
@@ -76,7 +82,7 @@ export default function ListTable({
{item.domain.length > 15 @@ -88,7 +94,9 @@ export default function ListTable({ )) || (
{(item.familyOrApp && ( - +
{FamilyOrAppMapReverse[item.familyOrApp] || item.familyOrApp.length > 15 diff --git a/packages/client/scan/src/components/MobileNav.tsx b/packages/client/scan/src/components/MobileNav.tsx index 54d8532a..286dcbe6 100644 --- a/packages/client/scan/src/components/MobileNav.tsx +++ b/packages/client/scan/src/components/MobileNav.tsx @@ -13,10 +13,13 @@ import { useSession, } from '@us3r-network/auth-with-rainbowkit' import UserAvatarStyled from './common/UserAvatarStyled' +import { useCeramicCtx } from '../context/CeramicCtx' export default function Nav() { const { signIn, signOut } = useAuthentication() const session = useSession() + const { network } = useCeramicCtx() + let location = useLocation() const navigate = useNavigate() const [openFilter, setOpenFilter] = useState(false) @@ -33,7 +36,7 @@ export default function Nav() { ) : ( - +
{/* Alpha */} @@ -76,7 +79,10 @@ export default function Nav() {
- setOpenFilter(!openFilter)}> + setOpenFilter(!openFilter)} + >
setOpenFilter(!openFilter)} >
- setOpenFilter(!openFilter)}> + setOpenFilter(!openFilter)} + >
@@ -30,7 +33,9 @@ export default function ModelStreamList({
- + {shortPubKey(item.streamId, { len: 8, split: '-', diff --git a/packages/client/scan/src/components/NoMatch.tsx b/packages/client/scan/src/components/NoMatch.tsx index be949871..e30c8719 100644 --- a/packages/client/scan/src/components/NoMatch.tsx +++ b/packages/client/scan/src/components/NoMatch.tsx @@ -1,12 +1,15 @@ import { Link } from 'react-router-dom' import styled from 'styled-components' +import { useCeramicCtx } from '../context/CeramicCtx' export default function NoMatch() { + const { network } = useCeramicCtx() + return (

404

- Go to the home page + Go to the home page

) diff --git a/packages/client/scan/src/components/StreamTable.tsx b/packages/client/scan/src/components/StreamTable.tsx index f95b01e1..1619f857 100644 --- a/packages/client/scan/src/components/StreamTable.tsx +++ b/packages/client/scan/src/components/StreamTable.tsx @@ -35,7 +35,9 @@ export default function StreamTable({
Stream ID:
- {data.streamId} + + {data.streamId} +
@@ -56,7 +58,9 @@ export default function StreamTable({ Family or App: {(data.familyOrApp && (
- +
{FamilyOrAppMapReverse[data.familyOrApp] || data.familyOrApp}
@@ -71,7 +75,7 @@ export default function StreamTable({
From:
- + @@ -90,7 +94,9 @@ export default function StreamTable({ Model: {(data.model !== 'kh4q0ozorrgaq2mezktnrmdwleo1d' && (
- {data.model} + + {data.model} +
ComposeDB @@ -103,7 +109,9 @@ export default function StreamTable({ Schema: {(data.schema && (
- {data.schema} + + {data.schema} +
)) || '-'} diff --git a/packages/client/scan/src/container/DappInfo.tsx b/packages/client/scan/src/container/DappInfo.tsx index 0a154d4c..b5870071 100644 --- a/packages/client/scan/src/container/DappInfo.tsx +++ b/packages/client/scan/src/container/DappInfo.tsx @@ -135,7 +135,9 @@ function DappModels({ )}
- +
Create
@@ -155,7 +157,7 @@ function DappModels({ }} />
- +
Explore More
diff --git a/packages/client/scan/src/container/Models.tsx b/packages/client/scan/src/container/Models.tsx index f59d2372..9d385a19 100644 --- a/packages/client/scan/src/container/Models.tsx +++ b/packages/client/scan/src/container/Models.tsx @@ -20,8 +20,12 @@ import { useCeramicCtx } from '../context/CeramicCtx' export default function ModelsPage() { const [searchParams] = useSearchParams() const { signIn } = useAuthentication() - const { network, fetchPersonalCollections, personalCollections, personalCollectionsWithoutFilter } = - useCeramicCtx() + const { + network, + fetchPersonalCollections, + personalCollections, + personalCollectionsWithoutFilter, + } = useCeramicCtx() const session = useSession() const sessId = session?.id const [models, setModels] = useState>([]) @@ -165,7 +169,9 @@ export default function ModelsPage() { {!isMobile ? ( <> {(item.isIndexed && ( - + {item.stream_content.name} )) || ( @@ -198,7 +204,9 @@ export default function ModelsPage() {
{item.useCount}
)) || (
- + {item.useCount}
@@ -301,7 +309,7 @@ function ModelStarItem({ await starModelAction(stream_id, hasStarItem?.id, !!hasStarItem?.revoke) }} > - {(hasStarItem && hasStarItem.revoke === false) ? : } + {hasStarItem && hasStarItem.revoke === false ? : }
) } diff --git a/packages/client/scan/src/container/Stream.tsx b/packages/client/scan/src/container/Stream.tsx index 59d1f129..ea5a3761 100644 --- a/packages/client/scan/src/container/Stream.tsx +++ b/packages/client/scan/src/container/Stream.tsx @@ -49,7 +49,7 @@ export default function StreamPage() {

{unknownErr}

- Go to the home page + Go to the home page

@@ -64,7 +64,7 @@ export default function StreamPage() {

{serverErrMsg.msg}

- Go to the home page + Go to the home page

diff --git a/packages/client/scan/src/container/UserModels.tsx b/packages/client/scan/src/container/UserModels.tsx index 69c6a916..ccfb4c2c 100644 --- a/packages/client/scan/src/container/UserModels.tsx +++ b/packages/client/scan/src/container/UserModels.tsx @@ -84,7 +84,7 @@ export default function UserModels() {
- + {shortPubKey(item.stream_id, { len: 8, split: '-' })}