fix: transpile SDK workspace packages; fix Nav hydration mismatch
This commit is contained in:
@@ -2,7 +2,7 @@ import type { NextConfig } from 'next'
|
||||
|
||||
const config: NextConfig = {
|
||||
reactStrictMode: true,
|
||||
transpilePackages: ['@solana/connector'],
|
||||
transpilePackages: ['@solana/connector', '@solisting/sdk', '@descro/sdk'],
|
||||
}
|
||||
|
||||
export default config
|
||||
|
||||
@@ -24,9 +24,11 @@ export function Nav() {
|
||||
const { cluster, clusters, setCluster } = useCluster()
|
||||
const [netOpen, setNetOpen] = useState(false)
|
||||
const [search, setSearch] = useState('')
|
||||
const [mounted, setMounted] = useState(false)
|
||||
const netRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true)
|
||||
function close(e: MouseEvent) {
|
||||
if (netRef.current && !netRef.current.contains(e.target as Node)) setNetOpen(false)
|
||||
}
|
||||
@@ -41,7 +43,7 @@ export function Nav() {
|
||||
}
|
||||
}
|
||||
|
||||
const dot = NET_DOTS[cluster?.id ?? ''] ?? '#8A8FA3'
|
||||
const dot = mounted ? (NET_DOTS[cluster?.id ?? ''] ?? '#8A8FA3') : '#8A8FA3'
|
||||
|
||||
return (
|
||||
<nav
|
||||
@@ -163,7 +165,7 @@ export function Nav() {
|
||||
}}
|
||||
>
|
||||
<span style={{ width: 8, height: 8, borderRadius: '50%', background: dot, boxShadow: `0 0 8px ${dot}` }} />
|
||||
{cluster?.label ?? 'Network'}
|
||||
{mounted ? (cluster?.label ?? 'Network') : 'Network'}
|
||||
<span style={{ color: 'var(--mut)', fontSize: 10 }}>▾</span>
|
||||
</button>
|
||||
{netOpen && (
|
||||
|
||||
Reference in New Issue
Block a user