Completes the Bootstrap 4->5 migration now that every jQuery/BS4 widget is React
(navbar, carousel, dropdowns) — plus the feedback toggle here (Feedback.js:
global `$('#feedback-form').toggle()` -> React state).
- Load Bootstrap 5 CSS from the `bootstrap` npm package in client/index.js
(imported first so app + component styles and react-bootstrap override it).
- Remove the `alexwine:bootstrap-4` meteor package (BS4 CSS + jQuery + BS4 JS).
jQuery for jquery-validation still comes from the npm `jquery` dep.
- Utility renames to BS5: ml-auto->ms-auto, float-right->float-end,
btn-block->w-100, data-toggle->data-bs-toggle (FromNow tooltip).
- forms.scss `.form-label` is no longer a shim (BS5 ships it); comment updated.
Full-app build boots clean; server suite 36 passing. Needs a visual staging pass
across all pages (BS4->5 shifts grid gutters/typography); forms should improve
since react-bootstrap v2 already emitted BS5 markup.
28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
/* global */
|
|
// Bootstrap 5 CSS (npm) replaces the old `alexwine:bootstrap-4` meteor package.
|
|
// Import it first so the app + component stylesheets below (and react-bootstrap,
|
|
// which targets BS5) override it.
|
|
import 'bootstrap/dist/css/bootstrap.css';
|
|
import React from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
import { HelmetProvider } from 'react-helmet-async';
|
|
import { Meteor } from 'meteor/meteor';
|
|
import '/imports/startup/client/modernizr';
|
|
import App from '../../ui/layouts/App/App';
|
|
|
|
import '../../ui/stylesheets/app.scss';
|
|
|
|
// https://stackoverflow.com/questions/19562207/jquery-detect-browser-ie9-and-below-and-throw-up-a-modal-to-upgrade
|
|
const isIE9OrBelow = () => /MSIE\s/.test(navigator.userAgent) && parseFloat(navigator.appVersion.split('MSIE')[1]) < 10;
|
|
|
|
if (isIE9OrBelow()) window.alert('You are using an outdated browser. Please use Chrome or Firefox to display this site.');
|
|
else {
|
|
Modernizr.on('webp', (result) => {
|
|
if (Meteor.isDevelopment) console.log(`webp ${result ? '' : 'not '}supported`);
|
|
});
|
|
Meteor.startup(() => createRoot(document.getElementById('react-root')).render(
|
|
<HelmetProvider>
|
|
<App />
|
|
</HelmetProvider>
|
|
));
|
|
}
|