Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CORS on preview deployment urls #289

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/common/components/templates/Space.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,9 @@ export default function Space({
: LayoutFidgets["grid"];

return (
<>
<div className="user-theme-background w-full h-full relative">
<CustomHTMLBackground html={config.theme?.properties.backgroundHTML} />
<div
className={
editMode
? "w-full transition-all duration-100 ease-out h-full"
: "w-full transition-all duration-100 ease-out h-full"
}
>
<div className="w-full transition-all duration-100 ease-out h-full">
<div className="h-full flex flex-col">
{!isUndefined(profile) ? (
<div className="z-50 bg-white h-40">{profile}</div>
Expand All @@ -126,6 +120,6 @@ export default function Space({
/>
</div>
</div>
</>
</div>
);
}
5 changes: 4 additions & 1 deletion src/constants/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export const WEBSITE_URL =
process.env.NEXT_PUBLIC_VERCEL_ENV === "preview"
? `https://${process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL}`
? typeof window !== "undefined"
? window.location.origin
: `https://${process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL}`
: process.env.NEXT_PUBLIC_URL;

export const APP_FID = process.env.NEXT_PUBLIC_APP_FID
? Number(process.env.NEXT_PUBLIC_APP_FID)
: undefined;
5 changes: 1 addition & 4 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ const sidebarLayout = (page: React.ReactElement) => {
return (
<>
<div className="min-h-screen max-w-screen h-screen w-screen">
<div
className="flex w-full h-full"
style={{ background: "var(--user-theme-background)" }}
>
<div className="flex w-full h-full">
<div className="flex mx-auto transition-all duration-100 ease-out z-10">
<Sidebar />
</div>
Expand Down