@undp/carbon-library 1.0.263-carbon-lib-test.2 → 1.0.263-carbon-lib-test.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +17 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Storybook/Decorators/InvestmentCreationI18nDecorator.d.ts +2 -0
- package/dist/cjs/types/Storybook/InvestmentCreationComponent.stories.d.ts +12 -0
- package/dist/esm/index.js +17 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Storybook/Decorators/InvestmentCreationI18nDecorator.d.ts +2 -0
- package/dist/esm/types/Storybook/InvestmentCreationComponent.stories.d.ts +12 -0
- package/package.json +1 -1
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
3
|
+
import "antd/dist/antd.css";
|
4
|
+
import ConnectionContextDecorator from './Decorators/ConnectionContextDecorator';
|
5
|
+
declare const meta: {
|
6
|
+
title: string;
|
7
|
+
component: (props: any) => import("react").JSX.Element;
|
8
|
+
decorators: (typeof ConnectionContextDecorator)[];
|
9
|
+
};
|
10
|
+
export default meta;
|
11
|
+
type Story = StoryObj<typeof meta>;
|
12
|
+
export declare const Primary: Story;
|
package/dist/esm/index.js
CHANGED
@@ -526,10 +526,16 @@ var ConnectionContextProvider = function (props) {
|
|
526
526
|
headers = { authorization: "Bearer ".concat(token.toString()) };
|
527
527
|
}
|
528
528
|
else {
|
529
|
-
localStorage.getItem('token')
|
530
|
-
|
531
|
-
|
532
|
-
|
529
|
+
if (localStorage.getItem('token')) {
|
530
|
+
headers = {
|
531
|
+
authorization: "Bearer ".concat(localStorage.getItem('token')),
|
532
|
+
};
|
533
|
+
}
|
534
|
+
else {
|
535
|
+
headers = {
|
536
|
+
authorization: "Bearer ".concat(process.env.STORYBOOK_ACCESS_TOKEN),
|
537
|
+
};
|
538
|
+
}
|
533
539
|
}
|
534
540
|
axios(__assign({ method: method, url: url, data: data, headers: headers }, config))
|
535
541
|
.then(function (response) {
|
@@ -670,23 +676,23 @@ var UserInformationContextProvider = function (_a) {
|
|
670
676
|
var token = useConnection().token;
|
671
677
|
var _b = useState(false), isTokenExpired = _b[0], setIsTokenExpired = _b[1];
|
672
678
|
var initialUserProps = {
|
673
|
-
id: localStorage.getItem('userId') ? localStorage.getItem('userId') : '',
|
674
|
-
userRole: localStorage.getItem('userRole') ? localStorage.getItem('userRole') : '',
|
679
|
+
id: localStorage.getItem('userId') ? localStorage.getItem('userId') : process.env.STORYBOOK_USER_ID ? process.env.STORYBOOK_USER_ID : '',
|
680
|
+
userRole: localStorage.getItem('userRole') ? localStorage.getItem('userRole') : process.env.STORYBOOK_USER_ROLE ? process.env.STORYBOOK_USER_ROLE : '',
|
675
681
|
companyRole: localStorage.getItem('companyRole')
|
676
682
|
? localStorage.getItem('companyRole')
|
677
|
-
: '',
|
683
|
+
: process.env.STORYBOOK_COMPANY_ROLE ? process.env.STORYBOOK_COMPANY_ROLE : '',
|
678
684
|
companyId: localStorage.getItem('companyId')
|
679
685
|
? parseInt(localStorage.getItem('companyId'))
|
680
|
-
: -1,
|
686
|
+
: process.env.STORYBOOK_COMPANY_ID ? parseInt(process.env.STORYBOOK_COMPANY_ID) : -1,
|
681
687
|
companyLogo: localStorage.getItem('companyLogo')
|
682
688
|
? localStorage.getItem('companyLogo')
|
683
|
-
: '',
|
689
|
+
: process.env.STORYBOOK_COMPANY_LOGO ? process.env.STORYBOOK_COMPANY_LOGO : '',
|
684
690
|
companyName: localStorage.getItem('companyName')
|
685
691
|
? localStorage.getItem('companyName')
|
686
|
-
: '',
|
692
|
+
: process.env.STORYBOOK_COMPANY_NAME ? process.env.STORYBOOK_COMPANY_NAME : '',
|
687
693
|
companyState: localStorage.getItem('companyState')
|
688
694
|
? parseInt(localStorage.getItem('companyState'))
|
689
|
-
: 0,
|
695
|
+
: process.env.STORYBOOK_COMPANY_STATE ? parseInt(process.env.STORYBOOK_COMPANY_STATE) : 0,
|
690
696
|
};
|
691
697
|
var _c = useState(initialUserProps), userInfoState = _c[0], setUserInfoState = _c[1];
|
692
698
|
var setUserInfo = function (value) {
|