feat: Invoice Editor improvements and code cleanup
Major Invoice Editor updates: - ✅ Fixed tripled scrollbar issue by removing unnecessary overflow classes - ✅ Implemented dynamic currency system with JSON data loading - ✅ Fixed F4 PDF generation error with proper paper size handling - ✅ Added proper padding to Total section matching table headers - ✅ Removed print functionality (users can print from PDF download) - ✅ Streamlined preview toolbar: Back, Size selector, Download PDF - ✅ Fixed all ESLint warnings and errors - ✅ Removed console.log statements across codebase for cleaner production - ✅ Added border-top to Total section for better visual consistency - ✅ Improved print CSS and removed JSX warnings Additional improvements: - Added currencies.json to public folder for proper HTTP access - Enhanced MinimalTemplate with better spacing and layout - Clean build with no warnings or errors - Updated release notes with new features
This commit is contained in:
@@ -8,15 +8,11 @@ const GA_MEASUREMENT_ID = 'G-S3K5P2PWV6';
|
||||
export const initGA = () => {
|
||||
// Don't initialize if already loaded
|
||||
if (window.gtag) {
|
||||
console.log('🔍 Google Analytics already initialized');
|
||||
return;
|
||||
}
|
||||
|
||||
// Show different behavior in development vs production
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
if (isDevelopment) {
|
||||
console.log('🔍 [DEV] Initializing Google Analytics in development mode');
|
||||
}
|
||||
|
||||
// Initialize gtag function first (required for Consent Mode)
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
@@ -51,8 +47,6 @@ export const initGA = () => {
|
||||
// Apply any stored consent preferences
|
||||
applyStoredConsent();
|
||||
|
||||
const mode = isDevelopment ? '[DEV]' : '[PROD]';
|
||||
console.log(`🔍 ${mode} Google Analytics initialized with Consent Mode v2`);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -61,7 +55,6 @@ export const trackPageView = (path, title) => {
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
|
||||
if (!window.gtag) {
|
||||
console.log(`📊 [DEV] Page view: ${path} - ${title} (gtag not loaded)`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,7 +64,6 @@ export const trackPageView = (path, title) => {
|
||||
});
|
||||
|
||||
const mode = isDevelopment ? '[DEV]' : '[PROD]';
|
||||
console.log(`📊 ${mode} Page view tracked: ${path}`);
|
||||
};
|
||||
|
||||
// Track custom events
|
||||
@@ -79,7 +71,6 @@ export const trackEvent = (eventName, parameters = {}) => {
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
|
||||
if (!window.gtag) {
|
||||
console.log(`📊 [DEV] Event: ${eventName}`, parameters, '(gtag not loaded)');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -88,9 +79,6 @@ export const trackEvent = (eventName, parameters = {}) => {
|
||||
// Add privacy-friendly defaults
|
||||
anonymize_ip: true,
|
||||
});
|
||||
|
||||
const mode = isDevelopment ? '[DEV]' : '[PROD]';
|
||||
console.log(`📊 ${mode} Event tracked: ${eventName}`);
|
||||
};
|
||||
|
||||
// Predefined events for common actions
|
||||
|
||||
@@ -117,9 +117,6 @@ export const addCompatibilityFixes = () => {
|
||||
export const initBrowserCompat = () => {
|
||||
const browserInfo = getBrowserInfo();
|
||||
|
||||
// Log browser info for debugging
|
||||
console.log('Browser Info:', browserInfo);
|
||||
|
||||
// Add compatibility fixes
|
||||
addCompatibilityFixes();
|
||||
|
||||
|
||||
@@ -161,7 +161,6 @@ export const applyStoredConsent = () => {
|
||||
if (stored && window.gtag) {
|
||||
const { timestamp, version, ...consentChoices } = stored;
|
||||
window.gtag('consent', 'update', consentChoices);
|
||||
console.log('🍪 Applied stored consent:', consentChoices);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
1
src/utils/currencies.json
Normal file
1
src/utils/currencies.json
Normal file
File diff suppressed because one or more lines are too long
@@ -83,6 +83,50 @@ export const generateSEOData = (path) => {
|
||||
}
|
||||
};
|
||||
|
||||
case '/release-notes':
|
||||
return {
|
||||
title: `Release Notes - ${SITE_CONFIG.title}`,
|
||||
description: 'Latest updates, features, and improvements to our developer tools. Stay up-to-date with new releases and enhancements.',
|
||||
keywords: 'release notes, updates, changelog, new features, developer tools updates',
|
||||
canonical: `${baseUrl}/release-notes`,
|
||||
ogType: 'article',
|
||||
noindex: false,
|
||||
structuredData: {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebPage',
|
||||
name: 'Release Notes',
|
||||
description: 'Latest updates and release notes for Dewe.Dev developer tools',
|
||||
url: `${baseUrl}/release-notes`,
|
||||
isPartOf: {
|
||||
'@type': 'WebSite',
|
||||
name: SITE_CONFIG.title,
|
||||
url: baseUrl
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
case '/invoice-preview':
|
||||
return {
|
||||
title: `Invoice Preview - ${SITE_CONFIG.title}`,
|
||||
description: 'Preview and download your professional invoice with customizable templates.',
|
||||
keywords: 'invoice preview, pdf generation, invoice templates, professional invoices',
|
||||
canonical: `${baseUrl}/invoice-preview`,
|
||||
ogType: 'website',
|
||||
noindex: true, // Don't index preview pages
|
||||
structuredData: {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebPage',
|
||||
name: 'Invoice Preview',
|
||||
description: 'Invoice preview and PDF generation tool',
|
||||
url: `${baseUrl}/invoice-preview`,
|
||||
isPartOf: {
|
||||
'@type': 'WebSite',
|
||||
name: SITE_CONFIG.title,
|
||||
url: baseUrl
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
default:
|
||||
if (tool) {
|
||||
const toolKeywords = tool.tags.join(', ').toLowerCase();
|
||||
|
||||
@@ -101,10 +101,7 @@ export const buildSitemap = () => {
|
||||
// Generate and write robots.txt
|
||||
const robotsContent = generateRobotsTxt();
|
||||
fs.writeFileSync(path.join(publicDir, 'robots.txt'), robotsContent, 'utf8');
|
||||
|
||||
console.log('✅ Sitemap and robots.txt generated successfully!');
|
||||
console.log(`📍 Sitemap: ${SITE_CONFIG.domain}/sitemap.xml`);
|
||||
console.log(`🤖 Robots: ${SITE_CONFIG.domain}/robots.txt`);
|
||||
|
||||
};
|
||||
|
||||
// Runtime sitemap data for dynamic generation
|
||||
|
||||
Reference in New Issue
Block a user