qpp-style 9.34.1 → 9.34.2

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.
@@ -54,16 +54,9 @@ const SideNavUI = ({
54
54
 
55
55
  const collapseRef = useRef(null);
56
56
 
57
- const changeExpandedClass = (currentClass, newClass) => {
58
- document
59
- .querySelectorAll(`.${currentClass}`)
60
- .forEach((e) => e.classList.replace(currentClass, newClass));
61
- };
62
-
63
57
  const expand = () => {
64
58
  setSideNavExpanded(window.document, "true");
65
59
  setIsExpandedState(true);
66
- changeExpandedClass("animation-group-exit", "animation-group-enter");
67
60
  if (onExpanded) {
68
61
  onExpanded();
69
62
  }
@@ -72,7 +65,6 @@ const SideNavUI = ({
72
65
  const collapse = () => {
73
66
  setSideNavExpanded(window.document, "false");
74
67
  setIsExpandedState(false);
75
- changeExpandedClass("animation-group-enter", "animation-group-exit");
76
68
  if (onCollapsed) {
77
69
  onCollapsed();
78
70
  }
@@ -86,11 +78,6 @@ const SideNavUI = ({
86
78
  // some applications use the isExpanded prop instead of reading the cookie
87
79
  // this will ensure the application ignores the cookie
88
80
  if (isExpandedPropSet) {
89
- if (isExpanded) {
90
- changeExpandedClass("animation-group-exit", "animation-group-enter");
91
- } else {
92
- changeExpandedClass("animation-group-enter", "animation-group-exit");
93
- }
94
81
  setIsExpandedState(isExpanded);
95
82
  } else {
96
83
  isSideNavExpanded(window.document);
@@ -98,7 +85,7 @@ const SideNavUI = ({
98
85
  }, [isExpanded, isExpandedPropSet]);
99
86
 
100
87
  useEffect(() => {
101
- const initialExpandedState = isSideNavExpanded(window.document);
88
+ isSideNavExpanded(window.document);
102
89
  let cancelRequest = false;
103
90
  const { origin } = window.location;
104
91
  const isRunningLocally = origin.includes("localhost");
@@ -116,24 +103,7 @@ const SideNavUI = ({
116
103
  }
117
104
  }
118
105
  if (!cancelRequest) {
119
- const realInitialState = isExpandedPropSet
120
- ? isExpanded
121
- : initialExpandedState;
122
- if (realInitialState) {
123
- setSideNavContent(sideNavMenuItems);
124
- } else {
125
- // TODO: we are replacing the class here because the server does not take into account the
126
- // initial expand/collapse state of the sidenav.
127
- // Once we have confirmation that everyone has installed this version of QPP-Style we can
128
- // remove this if/else block (assuming the server has been updated to read the cookie and
129
- // render the appropriate class for each link)
130
- setSideNavContent(
131
- sideNavMenuItems.replaceAll(
132
- "animation-group-enter",
133
- "animation-group-exit",
134
- ),
135
- );
136
- }
106
+ setSideNavContent(sideNavMenuItems);
137
107
  }
138
108
  }
139
109
  getSideNavConfig();