@7shifts/sous-chef 3.76.0-beta.3 → 3.76.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +7 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/layout/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -6,7 +6,7 @@ import ReactDOM from 'react-dom';
|
|
|
6
6
|
import 'react-toastify/dist/ReactToastify.css';
|
|
7
7
|
import { debounce } from 'lodash-es';
|
|
8
8
|
import parseTime from 'time-autocomplete/src/core/AMPMParser';
|
|
9
|
-
import { Link as Link$1 } from 'react-router-dom';
|
|
9
|
+
import { Link as Link$1, useResolvedPath, useMatch } from 'react-router-dom';
|
|
10
10
|
import ReactModal from 'react-modal';
|
|
11
11
|
import { DayPicker } from 'react-day-picker';
|
|
12
12
|
import dateFnsFormat from 'date-fns/format';
|
|
@@ -8296,6 +8296,11 @@ var styles$T = {"menu-item":"_SebbU","menu-item--active":"_CDEVl"};
|
|
|
8296
8296
|
const MenuItem = ({
|
|
8297
8297
|
menu
|
|
8298
8298
|
}) => {
|
|
8299
|
+
const resolved = useResolvedPath(menu.to);
|
|
8300
|
+
const match = useMatch({
|
|
8301
|
+
path: resolved.pathname,
|
|
8302
|
+
end: true
|
|
8303
|
+
});
|
|
8299
8304
|
if (menu.reloadDocument) {
|
|
8300
8305
|
return React__default.createElement("li", {
|
|
8301
8306
|
className: classnames(styles$T['menu-item'], {
|
|
@@ -8307,7 +8312,7 @@ const MenuItem = ({
|
|
|
8307
8312
|
}
|
|
8308
8313
|
return React__default.createElement("li", {
|
|
8309
8314
|
className: classnames(styles$T['menu-item'], {
|
|
8310
|
-
[styles$T['menu-item--active']]: menu.isActive
|
|
8315
|
+
[styles$T['menu-item--active']]: menu.isActive || !!match
|
|
8311
8316
|
})
|
|
8312
8317
|
}, React__default.createElement(Link$1, {
|
|
8313
8318
|
to: menu.to
|