54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
import {
|
|
createMintelDirectusClient,
|
|
ensureDirectusAuthenticated,
|
|
} from "@mintel/next-utils";
|
|
import { updateSettings } from "@directus/sdk";
|
|
|
|
const client = createMintelDirectusClient();
|
|
|
|
async function setupBranding() {
|
|
const prjName = process.env.PROJECT_NAME || "Mintel Project";
|
|
const prjColor = process.env.PROJECT_COLOR || "#82ed20";
|
|
|
|
console.log(`🎨 Setup Directus Branding for ${prjName}...`);
|
|
await ensureDirectusAuthenticated(client);
|
|
|
|
const cssInjection = `
|
|
<style>
|
|
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
|
body, .v-app { font-family: 'Inter', sans-serif !important; }
|
|
.public-view .v-card {
|
|
backdrop-filter: blur(20px);
|
|
border-radius: 32px !important;
|
|
box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.4) !important;
|
|
}
|
|
.v-navigation-drawer { background: #000c24 !important; }
|
|
</style>
|
|
<div style="font-family: 'Inter', sans-serif; text-align: center; margin-top: 24px;">
|
|
<p style="color: rgba(255,255,255,0.7); font-size: 14px; margin-bottom: 4px; font-weight: 500;">MINTEL INFRASTRUCTURE ENGINE</p>
|
|
<h1 style="color: #ffffff; font-size: 18px; font-weight: 700; margin: 0;">${prjName.toUpperCase()} <span style="color: ${prjColor};">RELIABILITY.</span></h1>
|
|
</div>
|
|
`;
|
|
|
|
try {
|
|
await client.request(
|
|
updateSettings({
|
|
project_name: prjName,
|
|
project_color: prjColor,
|
|
public_note: cssInjection,
|
|
theme_light_overrides: {
|
|
primary: prjColor,
|
|
borderRadius: "16px",
|
|
navigationBackground: "#000c24",
|
|
navigationForeground: "#ffffff",
|
|
},
|
|
} as any),
|
|
);
|
|
console.log("✨ Branding applied!");
|
|
} catch (error) {
|
|
console.error("❌ Error setting up branding:", error);
|
|
}
|
|
}
|
|
|
|
setupBranding();
|