- {renderIcon(preset.id)}
+ }
+ />
{preset.name}
{(preset.apiKeysURL && preset.id !== "routstr") && (
diff --git a/src/pages/DeploySettings.tsx b/src/pages/DeploySettings.tsx
index 16ec372d..1ef5a5da 100644
--- a/src/pages/DeploySettings.tsx
+++ b/src/pages/DeploySettings.tsx
@@ -2,7 +2,6 @@ import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Rocket, ArrowLeft, Trash2, Check, GripVertical, ChevronDown } from 'lucide-react';
import { Checkbox } from '@/components/ui/checkbox';
-import { SiNetlify, SiVercel } from '@icons-pack/react-simple-icons';
import {
DropdownMenu,
DropdownMenuContent,
@@ -28,7 +27,6 @@ import {
useSortable,
} from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
-import { IconMasksTheater } from '@tabler/icons-react';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { PasswordInput } from '@/components/ui/password-input';
@@ -42,6 +40,8 @@ import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useIsMobile } from '@/hooks/useIsMobile';
import { useNavigate, Link } from 'react-router-dom';
import type { DeployProvider } from '@/contexts/DeploySettingsContext';
+import { ExternalFavicon } from '@/components/ExternalFavicon';
+import { normalizeUrl } from '@/lib/faviconUrl';
interface PresetProvider {
id: string;
@@ -96,7 +96,18 @@ function SortableProviderItem({ provider, index, preset, onRemove, onUpdate, sho
)}
- {renderIcon(provider.id)}
+ {(() => {
+ const url = getProviderUrl(provider);
+ return url ? (
+
}
+ />
+ ) : (
+
+ );
+ })()}
{provider.name}
@@ -272,16 +283,35 @@ function generateCustomProviderId(type: string): string {
return `${type}-${randomSegment}`;
}
-function renderIcon(providerId: string, size = 16) {
- switch (providerId) {
+function getProviderUrl(provider: DeployProvider | PresetProvider): string | null {
+ switch (provider.type) {
case 'shakespeare':
- return
;
+ // For Shakespeare providers, check for custom host first, then use default
+ if ('host' in provider && provider.host) {
+ return normalizeUrl(provider.host);
+ }
+ return 'https://shakespeare.diy';
+
case 'netlify':
- return
;
+ // For Netlify providers, check for custom baseURL first, then use default
+ if ('baseURL' in provider && provider.baseURL) {
+ return provider.baseURL;
+ }
+ return 'https://netlify.com';
+
case 'vercel':
- return
;
+ // For Vercel providers, check for custom baseURL first, then use default
+ if ('baseURL' in provider && provider.baseURL) {
+ return provider.baseURL;
+ }
+ return 'https://vercel.com';
+
+ case 'nsite':
+ // nsite uses Rocket icon fallback
+ return null;
+
default:
- return
;
+ return null;
}
}
@@ -564,7 +594,18 @@ export function DeploySettings() {
- {renderIcon(preset.id)}
+ {(() => {
+ const url = getProviderUrl(preset);
+ return url ? (
+ }
+ />
+ ) : (
+
+ );
+ })()}
{preset.name}
{preset.apiKeyURL && !isOAuthConfigured && (
@@ -607,7 +648,18 @@ export function DeploySettings() {
>
) : (
<>
- {renderIcon(preset.id)}
+ {(() => {
+ const url = getProviderUrl(preset);
+ return url ? (
+
}
+ />
+ ) : (
+
+ );
+ })()}
Connect to {preset.name}
diff --git a/src/pages/GitSettings.tsx b/src/pages/GitSettings.tsx
index 2916195f..4b243e70 100644
--- a/src/pages/GitSettings.tsx
+++ b/src/pages/GitSettings.tsx
@@ -2,7 +2,6 @@ import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Check, GitBranch, ArrowLeft, Trash2, ChevronDown } from 'lucide-react';
import { Button } from '@/components/ui/button';
-import { SiGithub, SiGitlab } from '@icons-pack/react-simple-icons';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Badge } from '@/components/ui/badge';
@@ -20,6 +19,7 @@ import { useIsMobile } from '@/hooks/useIsMobile';
import { useNavigate } from 'react-router-dom';
import type { GitCredential } from '@/contexts/GitSettingsContext';
import { PasswordInput } from '@/components/ui/password-input';
+import { ExternalFavicon } from '@/components/ExternalFavicon';
interface PresetProvider {
id: string;
@@ -46,17 +46,6 @@ const PRESET_PROVIDERS: PresetProvider[] = [
},
];
-function renderIcon(providerId: string, size = 16) {
- switch (providerId) {
- case 'github':
- return
;
- case 'gitlab':
- return
;
- default:
- return
;
- }
-}
-
export function GitSettings() {
const { t } = useTranslation();
const { settings, addCredential, removeCredential, updateCredential, updateSettings } = useGitSettings();
@@ -170,7 +159,11 @@ export function GitSettings() {
- {preset && renderIcon(preset.id)}
+
}
+ />
{preset?.name || new URL(origin).hostname}
@@ -233,7 +226,11 @@ export function GitSettings() {
- {renderIcon(preset.id)}
+ }
+ />
{preset.name}
{preset.tokenURL && (preset.id !== 'github' || !isOAuthConfigured) && (
@@ -265,7 +262,11 @@ export function GitSettings() {
>
) : (
<>
-
+
}
+ />
Connect to GitHub
diff --git a/src/pages/SystemSettings.tsx b/src/pages/SystemSettings.tsx
index 56bd8fcf..d64f8953 100644
--- a/src/pages/SystemSettings.tsx
+++ b/src/pages/SystemSettings.tsx
@@ -18,6 +18,7 @@ export function SystemSettings() {
const [projectTemplateInput, setProjectTemplateInput] = useState(config.projectTemplate);
const [esmUrlInput, setEsmUrlInput] = useState(config.esmUrl);
const [corsProxyInput, setCorsProxyInput] = useState(config.corsProxy);
+ const [faviconUrlInput, setFaviconUrlInput] = useState(config.faviconUrl);
const [previewDomainInput, setPreviewDomainInput] = useState(config.previewDomain);
const [showcaseModeratorInput, setShowcaseModeratorInput] = useState(config.showcaseModerator);
@@ -119,6 +120,36 @@ export function SystemSettings() {
+ {/* Favicon URL Configuration */}
+
+
+
+ Favicon URL
+
+
+
+
{
+ const value = e.target.value;
+ setFaviconUrlInput(value);
+ updateConfig((current) => ({
+ ...current,
+ faviconUrl: value,
+ }));
+ }}
+ />
+
+ URL template for fetching favicons. Available variables: {'{hostname}'}, {'{origin}'}, {'{href}'}, {'{protocol}'}, {'{pathname}'}
+
+
+
+
+
+
{/* JavaScript CDN Configuration */}
diff --git a/src/test/TestApp.tsx b/src/test/TestApp.tsx
index 83e3920f..f330dcd9 100644
--- a/src/test/TestApp.tsx
+++ b/src/test/TestApp.tsx
@@ -33,6 +33,7 @@ export function TestApp({ children }: TestAppProps) {
projectTemplate: 'https://gitlab.com/soapbox-pub/mkstack.git',
esmUrl: 'https://esm.shakespeare.diy',
corsProxy: 'https://proxy.shakespeare.diy/?url={href}',
+ faviconUrl: 'https://external-content.duckduckgo.com/ip3/{hostname}.ico',
previewDomain: 'local-shakespeare.dev',
language: 'en',
showcaseEnabled: true,