Files
AI_Pharmacy_Frontend/reduce_search_height_more.cjs
2026-09-02 18:23:05 +05:30

25 lines
1.1 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const dir = './src/pages';
const files = fs.readdirSync(dir).filter(f => f.endsWith('.tsx'));
for (const file of files) {
const filePath = path.join(dir, file);
let content = fs.readFileSync(filePath, 'utf8');
// Reduce height from 54px to 46px, font size to 15px
content = content.replace(/style=\{\{ height: '54px', paddingLeft: '56px', paddingRight: '16px', fontSize: '16px' \}\}/g, "style={{ height: '46px', paddingLeft: '44px', paddingRight: '16px', fontSize: '15px' }}");
// Reduce the Search icon size from 24 to 20
content = content.replace(/<Search size=\{24\}/g, '<Search size={20}');
// Adjust icon padding so it's centered perfectly
content = content.replace(/style=\{\{ paddingLeft: '20px' \}\}/g, "style={{ paddingLeft: '16px' }}");
// Remove py-5 and text-lg because we are setting height directly anyway, but let's keep it clean
content = content.replace(/className="w-full py-5 text-lg /g, 'className="w-full py-3 ');
fs.writeFileSync(filePath, content, 'utf8');
}
console.log('Reduced search bar height to 46px.');