@learningpool/ui 1.6.0-beta.14 → 1.6.0-beta.16
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.
|
@@ -17,14 +17,13 @@ import { StyledSwipeableDrawer, StyledBox, StyledListItem, StyledDivider, Styled
|
|
|
17
17
|
import { StreamSuiteLogo } from '../../../assets/Images';
|
|
18
18
|
import { motion } from 'framer-motion';
|
|
19
19
|
export default function SwipeableTemporaryDrawer(props) {
|
|
20
|
-
var isDrawerOpen = props.isDrawerOpen, setIsDrawerOpen = props.setIsDrawerOpen, items = props.items, secondaryItems = props.secondaryItems, logo = props.logo, logoText = props.logoText, logoOnClick = props.logoOnClick
|
|
20
|
+
var isDrawerOpen = props.isDrawerOpen, setIsDrawerOpen = props.setIsDrawerOpen, items = props.items, secondaryItems = props.secondaryItems, logo = props.logo, logoText = props.logoText, logoOnClick = props.logoOnClick;
|
|
21
21
|
var theme = useTheme();
|
|
22
22
|
var _a = React.useState(isDrawerOpen !== null && isDrawerOpen !== void 0 ? isDrawerOpen : false), isOpen = _a[0], setIsOpen = _a[1];
|
|
23
23
|
React.useEffect(function () { return handleOpenState(isDrawerOpen); }, [isDrawerOpen]);
|
|
24
24
|
var handleOpenState = function (open) {
|
|
25
25
|
setIsOpen(open);
|
|
26
26
|
setIsDrawerOpen(open);
|
|
27
|
-
console.log(children);
|
|
28
27
|
};
|
|
29
28
|
var toggleDrawer = function (open) {
|
|
30
29
|
return function (event) {
|
|
@@ -132,7 +131,7 @@ export default function SwipeableTemporaryDrawer(props) {
|
|
|
132
131
|
// @ts-expect-error
|
|
133
132
|
, __assign({
|
|
134
133
|
// @ts-expect-error
|
|
135
|
-
component: motion.button, variants: variantsLi, whileHover: { scale: 1.02 }, whileTap: { scale: 0.95 } },
|
|
134
|
+
component: motion.button, variants: variantsLi, whileHover: { scale: 1.02 }, whileTap: { scale: 0.95 } }, childItem, { children: _jsx(StyledChildListItemText, { primary: childItem.label }, childItem.label) })) }), childItem.label)); }) })))] }), label));
|
|
136
135
|
}) })), secondaryItems && secondaryItems.length > 0 && (_jsxs(_Fragment, { children: [_jsx(motion.div, __assign({ animate: isDrawerOpen ? 'open' : 'closed', variants: variantsDivider }, { children: _jsx(StyledDivider, {}) })), _jsx(StyledListSecondaryList
|
|
137
136
|
// @ts-expect-error
|
|
138
137
|
, __assign({
|
|
@@ -140,7 +140,7 @@ var AppSwitcher = function (props) {
|
|
|
140
140
|
return __generator(this, function (_a) {
|
|
141
141
|
switch (_a.label) {
|
|
142
142
|
case 0:
|
|
143
|
-
if (!(typeof token === 'string' && token !== window.localStorage.getItem(Constants.LocalStorageKey.Token))) return [3 /*break*/, 3];
|
|
143
|
+
if (!(token && typeof token === 'string' && token !== window.localStorage.getItem(Constants.LocalStorageKey.Token))) return [3 /*break*/, 3];
|
|
144
144
|
if (!userId) {
|
|
145
145
|
decodedToken = jwtDecode(token);
|
|
146
146
|
userId = decodedToken[Constants.HomeAttributes.UserId];
|
|
@@ -190,8 +190,8 @@ var AppSwitcher = function (props) {
|
|
|
190
190
|
userApplications = [];
|
|
191
191
|
if (!token) {
|
|
192
192
|
parsedQueryString = queryString.parse(window.location.search);
|
|
193
|
-
if (parsedQueryString.
|
|
194
|
-
token = parsedQueryString.
|
|
193
|
+
if (parsedQueryString.token && typeof parsedQueryString.token === 'string') {
|
|
194
|
+
token = parsedQueryString.token;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
if (!(!props.applications || props.applications.length === 0)) return [3 /*break*/, 2];
|