Fix examples URL in docs app (#4129)
Allow us to preview docs + examples changes on staging.tldraw.dev. Also allow previewing the docs app on phones in local dev. ### Change type - [x] `bugfix` - [ ] `improvement` - [ ] `feature` - [ ] `api` - [ ] `other`
This commit is contained in:
parent
89d7438ca3
commit
76a5d98eeb
1 changed files with 5 additions and 1 deletions
|
@ -17,7 +17,11 @@ export default function ExampleCodeBlock({
|
|||
const { theme } = useTheme()
|
||||
useEffect(() => setIsClientSide(true), [])
|
||||
const SERVER =
|
||||
process.env.NODE_ENV === 'development' ? 'http://localhost:5420' : 'https://examples.tldraw.com'
|
||||
process.env.NODE_ENV === 'development'
|
||||
? `http://${location.host}:5420`
|
||||
: location.host.includes('staging') || location.host.includes('canary')
|
||||
? `https://examples-canary.tldraw.com`
|
||||
: 'https://examples.tldraw.com'
|
||||
|
||||
// This is to avoid hydration mismatch between the server and the client because of the useTheme.
|
||||
if (!isClientSide) {
|
||||
|
|
Loading…
Reference in a new issue