-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#34): Remove uri-parameter-dependent asset prefix, let next.config.j…
…s handle it. Remove client rendered _draft, leave all rendering to SSR for now. Client uses useRouter, which appears to handle calls from XP proxy badly, specifically sets asPath wrong and causes error.
- Loading branch information
Showing
4 changed files
with
18 additions
and
135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,8 @@ | ||
import '../styles/globals.css' | ||
import type { AppProps } from 'next/app' | ||
import Head from 'next/head' | ||
import type {AppProps} from 'next/app' | ||
|
||
|
||
function MyApp({ Component, pageProps }: AppProps) { | ||
let host = pageProps.__host; | ||
|
||
|
||
if (host) { | ||
delete pageProps.__host; | ||
|
||
} else if ('undefined' !== typeof window) { | ||
console.log('Hostin?'); | ||
const urlParams = new URLSearchParams(window.location.search); | ||
// @ts-ignore | ||
if (urlParams && urlParams.get('__fromXp__') !== undefined) { | ||
console.log('Hostin') | ||
host = window.location.origin; | ||
} | ||
} | ||
|
||
console.log(host); | ||
|
||
if (host) { | ||
return <> | ||
<Head> | ||
<base href={host} /> | ||
</Head> | ||
<Component {...pageProps} /> | ||
</>; | ||
|
||
} else { | ||
return <Component {...pageProps} /> | ||
} | ||
function MyApp({Component, pageProps}: AppProps) { | ||
return <Component {...pageProps} /> | ||
} | ||
|
||
export default MyApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters