Files
star-erp/resources/js/Components/ApplicationLogo.tsx
sky121113 55272d5d43
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 47s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped
feat: 新增租戶品牌客製化系統(Logo、主色系)、修正 hardcoded 顏色為 CSS 變數
2026-01-16 14:36:24 +08:00

28 lines
658 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ImgHTMLAttributes } from 'react';
import { usePage } from '@inertiajs/react';
import { PageProps } from '@/types/global';
export default function ApplicationLogo(props: ImgHTMLAttributes<HTMLImageElement>) {
const { branding } = usePage<PageProps>().props;
// 如果有自訂 Logo優先使用
if (branding?.logo_url) {
return (
<img
{...props}
src={branding.logo_url}
alt="Logo"
/>
);
}
// 預設 Logo
return (
<img
{...props}
src="/logo.png"
alt="小小冰室 Logo"
/>
);
}