Skip to content

Commit a1025d3

Browse files
committed
fix: 🐛 template site url for repos env
1 parent 4059e7a commit a1025d3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.changeset/young-experts-march.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@fleek-platform/dashboard": patch
3+
---
4+
5+
Template site URL support for repo's env

src/utils/template.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import { constants } from '@/constants';
22
import { TemplateCardPart, TemplateJson, TemplatePart } from '@/types/Template';
33
import { joinUrl, getWebsiteUrl } from '@/utils/url';
4+
import { isServerSide } from '@/utils/isServerSide';
45

56
const { templatesAPI, templatesUrl } = constants.FLEEK_TEMPLATES_RELATIVE_PATHS;
67

7-
const websiteUrl = getWebsiteUrl();
8+
// Note: For repo's environments
9+
// we must use the `fleek.xyz`
10+
// this is due to site URL being overriden
11+
// for the repo's environment fleek-dashboard-
12+
const websiteUrl =
13+
!isServerSide() && !window.location.hostname.startsWith('fleek-dashboard-')
14+
? getWebsiteUrl()
15+
: 'https://fleek.xyz'
816

917
export const FLEEK_TEMPLATES_URLS = {
1018
websiteUrl,

0 commit comments

Comments
 (0)