+
An Error Occurred Please Try Again Later.
-
{errMsg}
+
{errMsg}
)) || (
<>
@@ -137,19 +149,26 @@ export const definition = ${JSON.stringify(
- {(item) => {item.title}}
+ {item => (
+
+ {item.title}
+
+ )}
- {codes.map((item) => (
-
-
-
- ))}
+ {codes.map(item => {
+ console.log('item', item)
+ return (
+
+
+
+ )
+ })}
)}
@@ -159,7 +178,7 @@ export const definition = ${JSON.stringify(
)
}
-export function Code({ name, content }: { name: string; content: string }) {
+export function Code ({ name, content }: { name: string; content: string }) {
useEffect(() => {
Prism.highlightAll()
}, [content])
@@ -168,7 +187,7 @@ export function Code({ name, content }: { name: string; content: string }) {
return (
diff --git a/packages/client/dashboard/src/components/nav/Nav.tsx b/packages/client/dashboard/src/components/nav/Nav.tsx
index aca3359..81fe5df 100644
--- a/packages/client/dashboard/src/components/nav/Nav.tsx
+++ b/packages/client/dashboard/src/components/nav/Nav.tsx
@@ -3,7 +3,6 @@ import { Link, NavLink } from 'react-router-dom'
import styled from 'styled-components'
import { DOCS_URL } from '../../constants'
import ChartIcon from '../icons/ChartIcon'
-import ChevronRight from '../icons/ChevronRight'
import ComponentIcon from '../icons/ComponentIcon'
import DocIcon from '../icons/DocIcon'
import ExploreIcon from '../icons/ExploreIcon'
@@ -101,7 +100,7 @@ export default function Nav ({ appId }: { appId: string }) {
{navItems.map(item => (
-
+
))}
@@ -162,7 +161,7 @@ function NavItemRenderer ({
{item.items && (
{item.items.map(item => (
-
+
))}
)}
diff --git a/packages/client/dashboard/src/components/node/CreateCeramicNodeModal.tsx b/packages/client/dashboard/src/components/node/CreateCeramicNodeModal.tsx
index 9fbbab3..8d9afac 100644
--- a/packages/client/dashboard/src/components/node/CreateCeramicNodeModal.tsx
+++ b/packages/client/dashboard/src/components/node/CreateCeramicNodeModal.tsx
@@ -18,7 +18,7 @@ export default function CreateCeramicNodeModal ({
onSussess
}: {
fixedNetwork?: CeramicNetwork
- closeModal: () => void
+ closeModal?: () => void
onSussess: () => void
}) {
const [submitting, setSubmitting] = useState(false)
@@ -55,8 +55,8 @@ export default function CreateCeramicNodeModal ({
if (resp.data.code !== 0) {
throw new Error(resp.data.msg)
}
- onSussess()
- closeModal()
+ onSussess?.()
+ closeModal?.()
} catch (error) {
console.error(error)
} finally {
@@ -77,9 +77,11 @@ export default function CreateCeramicNodeModal ({
Create Ceramic Node
-
+ {closeModal && (
+
+ )}
@@ -124,7 +126,11 @@ export default function CreateCeramicNodeModal ({
)) || (
-
-
+
)
diff --git a/packages/client/dashboard/src/container/MyDapps.tsx b/packages/client/dashboard/src/container/MyDapps.tsx
index b7cca62..9f8cd10 100644
--- a/packages/client/dashboard/src/container/MyDapps.tsx
+++ b/packages/client/dashboard/src/container/MyDapps.tsx
@@ -10,9 +10,14 @@ import { useAppCtx } from '../context/AppCtx'
import { ClientDApp } from '../types.d'
import { createImageFromInitials } from '../utils/createImage'
import { getRandomColor } from '../utils/randomColor'
+import { useEffect } from 'react'
export default function MyDapps() {
- const { dapps } = useAppCtx()
+ const { dapps, setCurrAppId } = useAppCtx()
+ setCurrAppId('')
+ useEffect(() => {
+ setCurrAppId('')
+ }, [setCurrAppId])
return (
diff --git a/packages/client/dashboard/src/context/AppCtx.tsx b/packages/client/dashboard/src/context/AppCtx.tsx
index efdad9e..e17ef00 100644
--- a/packages/client/dashboard/src/context/AppCtx.tsx
+++ b/packages/client/dashboard/src/context/AppCtx.tsx
@@ -4,7 +4,7 @@ import React, {
useCallback,
useContext,
useEffect,
- useState,
+ useState
} from 'react'
import { getDapp, getDappWithDid } from '../api/dapp'
import { useGuideStepsState } from '../hooks/useGuideSteps'
@@ -22,13 +22,14 @@ export interface AppContextData {
currAppId: string
setCurrAppId: React.Dispatch
>
loadDapps: () => Promise
+ loadCurrDapp: () => Promise
guideSteps: ReturnType
}
const AppContext = createContext(null)
-export default function AppProvider({
- children,
+export default function AppProvider ({
+ children
}: {
children: React.ReactNode
}) {
@@ -93,8 +94,9 @@ export default function AppProvider({
currAppId,
setCurrAppId,
loadDapps,
+ loadCurrDapp,
loadingDApps: loadingDApps || loadingDApp,
- guideSteps,
+ guideSteps
}}
>
{children}
@@ -102,12 +104,12 @@ export default function AppProvider({
)
}
-export function useAppCtx() {
+export function useAppCtx () {
const context = useContext(AppContext)
if (!context) {
throw new Error('Missing connection context')
}
return {
- ...context,
+ ...context
}
}
diff --git a/packages/client/dashboard/src/hooks/useSelectedDapp.ts b/packages/client/dashboard/src/hooks/useSelectedDapp.ts
index dbd2df4..338033d 100644
--- a/packages/client/dashboard/src/hooks/useSelectedDapp.ts
+++ b/packages/client/dashboard/src/hooks/useSelectedDapp.ts
@@ -6,7 +6,7 @@ import { useAppCtx } from '../context/AppCtx'
import { Network } from '../types.d'
export default function useSelectedDapp() {
- const { dapps } = useAppCtx()
+ const { dapps, currAppId } = useAppCtx()
const { appId } = useParams()
const selectDapps = useMemo(() => {
return (
@@ -19,8 +19,8 @@ export default function useSelectedDapp() {
}, [dapps])
const selectedDapp = useMemo(() => {
- return selectDapps?.find((item) => item.id === Number(appId))
- }, [selectDapps, appId])
+ return selectDapps?.find((item) => item.id === Number(currAppId || appId))
+ }, [selectDapps, currAppId, appId])
const s3ModelCollection = useMemo(() => {
if (selectedDapp?.network === Network.MAINNET) {
diff --git a/packages/client/dashboard/src/styles/react-aria/index.css b/packages/client/dashboard/src/styles/react-aria/index.css
index 5b3fddc..58dea42 100644
--- a/packages/client/dashboard/src/styles/react-aria/index.css
+++ b/packages/client/dashboard/src/styles/react-aria/index.css
@@ -6,5 +6,4 @@
@import 'menu.css';
@import 'modal.css';
@import 'popover.css';
-@import 'tabs.css';
@import 'textfield.css';
diff --git a/packages/client/dashboard/src/styles/react-aria/tabs.css b/packages/client/dashboard/src/styles/react-aria/tabs.css
deleted file mode 100644
index d8958d0..0000000
--- a/packages/client/dashboard/src/styles/react-aria/tabs.css
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Tabs */
-.react-aria-Tabs {
- position: relative;
- --text-color-base:black;
- --highlight-background: white;
- width: 100%;
-}
-
-.react-aria-TabList {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
-
- &[data-orientation=horizontal] {
- border: 1px solid var(--border-color);
- border-radius: 999px;
- }
-}
-
-.react-aria-Tab {
- padding: 10px 20px;
- cursor: default;
- outline: none;
- position: relative;
- color: var(--text-color-base);
- transition: color 200ms;
- --border-color: transparent;
- forced-color-adjust: none;
- border-radius: 999px;
- a {
- color: var(--text-color);
- }
-
- &[data-hovered],
- &[data-focused] {
- color: var(--text-color-hover);
- }
-
- &[data-selected] {
- background-color: var(--highlight-background);
- color: var(--text-color-base);
- a {
- color: var(--text-color-base);
- }
- }
-
- &[data-disabled] {
- color: var(--text-color-disabled);
- &[data-selected] {
- --border-color: var(--text-color-disabled);
- }
- }
-
- &[data-focus-visible]:after {
- content: '';
- position: absolute;
- inset: 4px;
- border-radius: 4px;
- border: 2px solid var(--focus-ring-color);
- }
-}
-
-.react-aria-TabPanel {
-
-}
\ No newline at end of file
diff --git a/packages/client/dashboard/src/types.d.ts b/packages/client/dashboard/src/types.d.ts
index c979d92..eaa16dd 100644
--- a/packages/client/dashboard/src/types.d.ts
+++ b/packages/client/dashboard/src/types.d.ts
@@ -104,6 +104,7 @@ export type ClientDApp = {
socialLinks?: { platform: string; url: string }[]
tags?: string[]
models?: string[]
+ modelDetails?: ModelStream[]
composites?: DappCompositeDto[];
createdAt?: number
lastModifiedAt?: number
@@ -184,9 +185,9 @@ export type ModelStream = {
stream_id: string
controller_did: string
tip: string
- streamContent: {
- name: string
- }
+ // streamContent: {
+ // name: string
+ // }
stream_content: {
name: string
description: string | null