feat: update title and favicon in index.html
This commit updates the title and favicon in the index.html file to reflect the new KROW branding. It also updates the links in the internal launchpad to point to the correct environments. feat: add script to patch index.html during integration This commit adds a new script to patch the index.html file during the integration process. This script updates the title and favicon to reflect the new KROW branding. style: update badge style in Dashboard.jsx This commit updates the badge style in the Dashboard.jsx file to use a span element with rounded corners instead of the Badge component. This is to match the design of the new KROW branding.
This commit is contained in:
2
Makefile
2
Makefile
@@ -65,6 +65,8 @@ integrate-export:
|
||||
@node scripts/patch-layout-query-key.js
|
||||
@echo " - Patching Dashboard.jsx for environment label..."
|
||||
@node scripts/patch-dashboard-for-env-label.js
|
||||
@echo " - Patching index.html for title..."
|
||||
@node scripts/patch-index-html.js
|
||||
@echo "--> Integration complete. Next step: 'make prepare-export'."
|
||||
|
||||
# Applies all necessary patches to a fresh Base44 export to run it locally.
|
||||
|
||||
@@ -169,11 +169,11 @@
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<a target="_blank" href="#">Control Tower (Dev)</a>
|
||||
<a target="_blank" href="https://krow-workforce-dev.web.app">Control Tower (Dev)</a>
|
||||
<span class="badge bg-primary rounded-pill">Dev</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<a target="_blank" href="#">Control Tower (Staging)</a>
|
||||
<a target="_blank" href="https://krow-workforce-staging.web.app">Control Tower (Staging)</a>
|
||||
<span class="badge bg-warning text-dark rounded-pill">Staging</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="https://base44.com/logo_v2.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="https://krow-workforce-dev-launchpad.web.app/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Base44 APP</title>
|
||||
<title>KROW</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -91,8 +91,8 @@ export default function Dashboard() {
|
||||
title={
|
||||
<div className="flex items-center gap-2">
|
||||
<span>Welcome to KROW</span>
|
||||
{import.meta.env.VITE_APP_ENV === 'staging' && <Badge className="bg-yellow-100 text-yellow-800">Staging</Badge>}
|
||||
{import.meta.env.VITE_APP_ENV === 'dev' && <Badge className="bg-slate-100 text-slate-800">Dev</Badge>}
|
||||
{import.meta.env.VITE_APP_ENV === 'staging' && <span className="bg-yellow-100 text-yellow-800 text-xs font-semibold px-2.5 py-0.5 rounded-full">Staging</span>}
|
||||
{import.meta.env.VITE_APP_ENV === 'dev' && <span className="bg-slate-200 text-slate-800 text-xs font-semibold px-2.5 py-0.5 rounded-full">Dev</span>}
|
||||
</div>
|
||||
}
|
||||
subtitle="Your Complete Workforce Management Ecosystem"
|
||||
|
||||
@@ -11,8 +11,8 @@ const newString = ` <PageHeader
|
||||
title={
|
||||
<div className="flex items-center gap-2">
|
||||
<span>Welcome to KROW</span>
|
||||
{import.meta.env.VITE_APP_ENV === 'staging' && <Badge className="bg-yellow-100 text-yellow-800">Staging</Badge>}
|
||||
{import.meta.env.VITE_APP_ENV === 'dev' && <Badge className="bg-slate-100 text-slate-800">Dev</Badge>}
|
||||
{import.meta.env.VITE_APP_ENV === 'staging' && <span className="bg-yellow-100 text-yellow-800 text-xs font-semibold px-2.5 py-0.5 rounded-full">Staging</span>}
|
||||
{import.meta.env.VITE_APP_ENV === 'dev' && <span className="bg-slate-200 text-slate-800 text-xs font-semibold px-2.5 py-0.5 rounded-full">Dev</span>}
|
||||
</div>
|
||||
}`;
|
||||
|
||||
|
||||
41
scripts/patch-index-html.js
Normal file
41
scripts/patch-index-html.js
Normal file
@@ -0,0 +1,41 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const projectRoot = path.resolve(__dirname, '..');
|
||||
const indexPath = path.join(projectRoot, 'frontend-web', 'index.html');
|
||||
|
||||
const oldTitle = '<title>Base44 APP</title>';
|
||||
const newTitle = '<title>KROW</title>';
|
||||
|
||||
const oldFavicon = '<link rel="icon" type="image/svg+xml" href="https://base44.com/logo_v2.svg" />';
|
||||
const newFavicon = '<link rel="icon" type="image/svg+xml" href="https://krow-workforce-dev-launchpad.web.app/favicon.svg" />';
|
||||
|
||||
try {
|
||||
let content = fs.readFileSync(indexPath, 'utf8');
|
||||
|
||||
if (content.includes(oldTitle)) {
|
||||
content = content.replace(oldTitle, newTitle);
|
||||
console.log('✅ Successfully patched title in frontend-web/index.html.');
|
||||
} else if (content.includes(newTitle)) {
|
||||
console.log('ℹ️ index.html title is already patched. Skipping.');
|
||||
} else {
|
||||
console.error('❌ Patching index.html failed: Could not find the expected title tag.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (content.includes(oldFavicon)) {
|
||||
content = content.replace(oldFavicon, newFavicon);
|
||||
console.log('✅ Successfully patched favicon in frontend-web/index.html.');
|
||||
} else if (content.includes(newFavicon)) {
|
||||
console.log('ℹ️ index.html favicon is already patched. Skipping.');
|
||||
} else {
|
||||
console.error('❌ Patching index.html failed: Could not find the expected favicon link.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
fs.writeFileSync(indexPath, content, 'utf8');
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ An error occurred during patching index.html:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user