Overhaul the app's color system by replacing all hardcoded Tailwind color classes with semantic theme variables to ensure consistent theming across all components, pages, and tests. Additional changes: - Add assigned date support for order item status updates: add `assignedDate` field to the order item status PATCH API, implement server-side normalization/validation, and add corresponding tests - Refactor purchase order PDF workflows to use the consolidated `purchase_orders.documents` field instead of the legacy separate `purchase_order_pdfs` collection - Fix quote number parsing and formatting to support both dashed (Q-YYYY-MM-NNN) and dashless (QYYYYMMNNN) formats - Rename `driver_pool` item status to `collection_pool` across the codebase - Add null handling for order item quantities and pricing to display "—" for missing values - Improve filter tab styling: make mobile tabs scrollable, prevent text wrapping, hide scrollbar - Add new utility scripts, API routes, migrations, and polish small UI/UX fixes including tsconfig updates and theme hook improvements
22 lines
713 B
XML
22 lines
713 B
XML
/**
|
|
* Inline script that runs in <head> before hydration.
|
|
*
|
|
* Reads the persisted theme id from localStorage and applies it to
|
|
* <html> so the user never sees a flash of the default theme.
|
|
*
|
|
* MUST stay dependency-free — it's bundled as a string and inlined.
|
|
*/
|
|
export function ThemeBootstrapScript() {
|
|
const code = `
|
|
(function() {
|
|
try {
|
|
var themeId = localStorage.getItem('wfdash-theme') || 'crisp';
|
|
var root = document.documentElement;
|
|
root.setAttribute('data-theme', themeId);
|
|
} catch (e) {
|
|
// localStorage may be blocked — fall back to the SSR-rendered theme
|
|
}
|
|
})();
|
|
`;
|
|
return <script dangerouslySetInnerHTML={{ __html: code }} />;
|
|
}
|