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.
36 lines
1.5 KiB
JavaScript
36 lines
1.5 KiB
JavaScript
const fs = require('fs');
|
||
const path = require('path');
|
||
|
||
const projectRoot = path.resolve(__dirname, '..');
|
||
const dashboardFilePath = path.join(projectRoot, 'frontend-web', 'src', 'pages', 'Dashboard.jsx');
|
||
|
||
const oldString = ` <PageHeader
|
||
title="Welcome to KROW"`;
|
||
|
||
const newString = ` <PageHeader
|
||
title={
|
||
<div className="flex items-center gap-2">
|
||
<span>Welcome to KROW</span>
|
||
{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>
|
||
}`;
|
||
|
||
try {
|
||
const content = fs.readFileSync(dashboardFilePath, 'utf8');
|
||
|
||
if (content.includes(oldString)) {
|
||
const newContent = content.replace(oldString, newString);
|
||
fs.writeFileSync(dashboardFilePath, newContent, 'utf8');
|
||
console.log('✅ Successfully patched Dashboard.jsx to include environment label.');
|
||
} else if (content.includes('VITE_APP_ENV')) {
|
||
console.log('ℹ️ Dashboard.jsx is already patched for environment labels. Skipping.');
|
||
} else {
|
||
console.error('❌ Patching Dashboard.jsx failed: Could not find the PageHeader title.');
|
||
process.exit(1);
|
||
}
|
||
} catch (error) {
|
||
console.error('❌ An error occurred during patching Dashboard.jsx:', error);
|
||
process.exit(1);
|
||
}
|