@stack-spot/portal-layout 2.12.0 → 2.13.0
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/CHANGELOG.md +7 -0
- package/dist/components/Rate/FeedbackModal.d.ts +5 -0
- package/dist/components/Rate/FeedbackModal.d.ts.map +1 -0
- package/dist/components/Rate/FeedbackModal.js +42 -0
- package/dist/components/Rate/FeedbackModal.js.map +1 -0
- package/dist/components/Rate/hook.d.ts +1 -0
- package/dist/components/Rate/hook.d.ts.map +1 -1
- package/dist/components/Rate/hook.js +5 -0
- package/dist/components/Rate/hook.js.map +1 -1
- package/dist/components/Rate/show-modals.d.ts +15 -0
- package/dist/components/Rate/show-modals.d.ts.map +1 -0
- package/dist/components/Rate/show-modals.js +14 -0
- package/dist/components/Rate/show-modals.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Rate/FeedbackModal.tsx +66 -0
- package/src/components/Rate/hook.tsx +6 -0
- package/src/components/Rate/show-modals.tsx +23 -0
- package/src/index.ts +1 -1
- package/dist/components/Rate/show-rating-modal.d.ts +0 -2
- package/dist/components/Rate/show-rating-modal.d.ts.map +0 -1
- package/dist/components/Rate/show-rating-modal.js +0 -11
- package/dist/components/Rate/show-rating-modal.js.map +0 -1
- package/src/components/Rate/show-rating-modal.tsx +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.13.0](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.12.0...portal-layout@v2.13.0) (2024-10-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add feedback modal ([65405cb](https://github.com/stack-spot/portal-commons/commit/65405cb85670e633ac20ba184d08e1fd919f35c0))
|
|
9
|
+
|
|
3
10
|
## [2.12.0](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.11.0...portal-layout@v2.12.0) (2024-10-11)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/FeedbackModal.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa,wBAAyB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,mDA+B/F,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Button, Flex, IconBox, Text } from '@citric/core';
|
|
3
|
+
import { ArrowRight, TimesMini } from '@citric/icons';
|
|
4
|
+
import { IconButton } from '@citric/ui';
|
|
5
|
+
import { theme } from '@stack-spot/portal-theme';
|
|
6
|
+
import { useTranslate } from '@stack-spot/portal-translate';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
const style = {
|
|
9
|
+
box: {
|
|
10
|
+
width: '438px',
|
|
11
|
+
bg: 'light.500',
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
bottom: 0,
|
|
14
|
+
right: 0,
|
|
15
|
+
p: 5,
|
|
16
|
+
borderRadius: '16px 16px 0 0',
|
|
17
|
+
boxShadow: `4px 4px 48px 0px ${theme.color.light[300]}`,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const FeedbackModal = ({ onClick, portal }) => {
|
|
21
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
22
|
+
const t = useTranslate(dictionary);
|
|
23
|
+
const handleClose = () => {
|
|
24
|
+
setIsVisible(false);
|
|
25
|
+
};
|
|
26
|
+
if (!isVisible)
|
|
27
|
+
return null;
|
|
28
|
+
return (_jsxs(Box, { sx: style.box, children: [_jsxs(Flex, { justifyContent: "space-between", flexWrap: "nowrap", children: [_jsxs(Text, { appearance: "h5", mb: 6, children: [t.title, portal, "?"] }), _jsx(IconButton, { onClick: handleClose, children: _jsx(TimesMini, {}) })] }), _jsx(Text, { sx: { lineHeight: '24px' }, children: t.description }), _jsx(Flex, { flexDirection: "row-reverse", mt: 7, mb: 4, children: _jsxs(Button, { onClick: onClick, size: "md", children: [t.buttonText, _jsx(IconBox, { colorIcon: "inverse.contrastText", ml: 2, children: _jsx(ArrowRight, {}) })] }) })] }));
|
|
29
|
+
};
|
|
30
|
+
const dictionary = {
|
|
31
|
+
en: {
|
|
32
|
+
title: 'How’s your experience with StackSpot ',
|
|
33
|
+
description: 'Your feedback helps us make the platform more useful and intuitive for you. It only takes a few minutes.',
|
|
34
|
+
buttonText: 'Share your feedback',
|
|
35
|
+
},
|
|
36
|
+
pt: {
|
|
37
|
+
title: 'Como está sua experiência com StackSpot ',
|
|
38
|
+
description: 'Seu feedback nos ajuda a tornar a plataforma mais útil e intuitiva para você. Leva apenas alguns minutos.',
|
|
39
|
+
buttonText: 'Compartilhe seu feedback',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=FeedbackModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedbackModal.js","sourceRoot":"","sources":["../../../src/components/Rate/FeedbackModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,IAAI,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,MAAM,KAAK,GAAW;IACpB,GA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,OAAO,IAAC,SAAS,EAAC,sBAAsB,EAAC,EAAE,EAAE,CAAC,YAC7C,KAAC,UAAU,KAAG,GACN,IACH,GACJ,IACH,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,0GAA0G;QACvH,UAAU,EAAE,qBAAqB;KAClC;IACD,EAAE,EAAE;QACF,KAAK,EAAE,0CAA0C;QACjD,WAAW,EAAE,2GAA2G;QACxH,UAAU,EAAE,0BAA0B;KACvC;CACmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/hook.tsx"],"names":[],"mappings":"AAYA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,WAaxD;AAED,wBAAgB,eAAe,SAS9B"}
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/hook.tsx"],"names":[],"mappings":"AAYA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,WAaxD;AAED,wBAAgB,uBAAuB,YAItC;AAED,wBAAgB,eAAe,SAS9B"}
|
|
@@ -19,6 +19,11 @@ export function isLessThan30Days(date1, date2) {
|
|
|
19
19
|
// Check if the difference is fewer than 30 days
|
|
20
20
|
return differenceInDays < 30;
|
|
21
21
|
}
|
|
22
|
+
export function isFirstThreeDaysOfMonth() {
|
|
23
|
+
const today = new Date();
|
|
24
|
+
const day = today.getDate();
|
|
25
|
+
return day >= 1 && day <= 3;
|
|
26
|
+
}
|
|
22
27
|
export function useRatingEffect() {
|
|
23
28
|
const handleInit = async () => {
|
|
24
29
|
await loadScript();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/components/Rate/hook.tsx"],"names":[],"mappings":"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A;IACxB,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,CAAA;IAC3B,OAAO,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;AAC7B,CAAC;AAED,MAAM,UAAU,eAAe;IAE7B,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC,CAAA;IAED,aAAa,CAAC,GAAG,EAAE;QACjB,UAAU,EAAE,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const showFeedbackModal: ({ onClick, portal }: {
|
|
2
|
+
onClick: () => void;
|
|
3
|
+
portal: 'EDP' | 'AI';
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
interface Props {
|
|
6
|
+
sub: string;
|
|
7
|
+
tenant: string;
|
|
8
|
+
portal: 'EDP' | 'AI';
|
|
9
|
+
formIdentifier: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const showRateUsModal: ({ title, ...props }: Props & {
|
|
12
|
+
title: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=show-modals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-modals.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/show-modals.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,wBAAyB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAA;CAAG,4CAEpG,CAAA;AAED,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,wBAAyB,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,SAO7E,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { overlay } from '../../LayoutOverlayManager.js';
|
|
3
|
+
import { FeedbackModal } from './FeedbackModal.js';
|
|
4
|
+
import { RateComponent } from './index.js';
|
|
5
|
+
export const showFeedbackModal = ({ onClick, portal }) => (_jsx(FeedbackModal, { onClick: onClick, portal: portal }));
|
|
6
|
+
export const showRateUsModal = ({ title, ...props }) => {
|
|
7
|
+
const { formIdentifier, sub, tenant, portal } = props;
|
|
8
|
+
overlay.showModal({
|
|
9
|
+
title: title,
|
|
10
|
+
children: _jsx(RateComponent, { tfLive: formIdentifier, userId: sub, orgId: tenant, portal: portal }),
|
|
11
|
+
size: 'large',
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=show-modals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-modals.js","sourceRoot":"","sources":["../../../src/components/Rate/show-modals.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAA;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAkD,EAAE,EAAE,CAAC,CACxG,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,CACpD,CAAA;AASD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAA6B,EAAE,EAAE;IAChF,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IACrD,OAAO,CAAC,SAAS,CAAC;QAChB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAC,aAAa,IAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI;QAC/F,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop.js';
|
|
2
2
|
export { showContactUsModal, showRateUsModal } from './components/Contact/show-contact-modal.js';
|
|
3
|
+
export { showFeedbackModal } from './components/Rate/show-modals.js';
|
|
3
4
|
export { Dialog } from './components/Dialog.js';
|
|
4
5
|
export { Header, HeaderProps } from './components/Header.js';
|
|
5
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
|
|
@@ -9,7 +10,6 @@ export { CLOSE_OVERLAY_ID, OverlayContent } from './components/OverlayContent.js
|
|
|
9
10
|
export { PortalSwitcher } from './components/PortalSwitcher.js';
|
|
10
11
|
export { RateComponent } from './components/Rate/index.js';
|
|
11
12
|
export { useRatingEffect } from './components/Rate/hook.js';
|
|
12
|
-
export { showRatingModal } from './components/Rate/show-rating-modal.js';
|
|
13
13
|
export * from './components/tour/index.js';
|
|
14
14
|
export * from './elements.js';
|
|
15
15
|
export * from './errors.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAC7F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,E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EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop.js';
|
|
2
2
|
export { showContactUsModal, showRateUsModal } from './components/Contact/show-contact-modal.js';
|
|
3
|
+
export { showFeedbackModal } from './components/Rate/show-modals.js';
|
|
3
4
|
export { Dialog } from './components/Dialog.js';
|
|
4
5
|
export { Header } from './components/Header.js';
|
|
5
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
|
|
@@ -9,7 +10,6 @@ export { CLOSE_OVERLAY_ID, OverlayContent } from './components/OverlayContent.js
|
|
|
9
10
|
export { PortalSwitcher } from './components/PortalSwitcher.js';
|
|
10
11
|
export { RateComponent } from './components/Rate/index.js';
|
|
11
12
|
export { useRatingEffect } from './components/Rate/hook.js';
|
|
12
|
-
export { showRatingModal } from './components/Rate/show-rating-modal.js';
|
|
13
13
|
export * from './components/tour/index.js';
|
|
14
14
|
export * from './elements.js';
|
|
15
15
|
export * from './errors.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAC7F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,gBA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flex, IconBox, Styles, Text } from '@citric/core'
|
|
2
|
+
import { ArrowRight, TimesMini } from '@citric/icons'
|
|
3
|
+
import { IconButton } from '@citric/ui'
|
|
4
|
+
import { theme } from '@stack-spot/portal-theme'
|
|
5
|
+
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
6
|
+
import { useState } from 'react'
|
|
7
|
+
|
|
8
|
+
const style: Styles = {
|
|
9
|
+
box: {
|
|
10
|
+
width: '438px',
|
|
11
|
+
bg: 'light.500',
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
bottom: 0,
|
|
14
|
+
right: 0,
|
|
15
|
+
p: 5,
|
|
16
|
+
borderRadius: '16px 16px 0 0',
|
|
17
|
+
boxShadow: `4px 4px 48px 0px ${theme.color.light[300]}`,
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const FeedbackModal = ({ onClick, portal }: { onClick: () => void, portal: 'EDP' | 'AI' }) => {
|
|
22
|
+
const [isVisible, setIsVisible] = useState(true)
|
|
23
|
+
const t = useTranslate(dictionary)
|
|
24
|
+
|
|
25
|
+
const handleClose = () => {
|
|
26
|
+
setIsVisible(false)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!isVisible) return null
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Box sx={style.box}>
|
|
33
|
+
<Flex justifyContent="space-between" flexWrap="nowrap">
|
|
34
|
+
<Text appearance="h5" mb={6}>{t.title}{portal}?</Text>
|
|
35
|
+
<IconButton onClick={handleClose}>
|
|
36
|
+
<TimesMini />
|
|
37
|
+
</IconButton>
|
|
38
|
+
</Flex>
|
|
39
|
+
<Text sx={{ lineHeight: '24px' }}>
|
|
40
|
+
{t.description}
|
|
41
|
+
</Text>
|
|
42
|
+
<Flex flexDirection="row-reverse" mt={7} mb={4}>
|
|
43
|
+
<Button onClick={onClick} size="md">
|
|
44
|
+
{t.buttonText}
|
|
45
|
+
<IconBox colorIcon="inverse.contrastText" ml={2}>
|
|
46
|
+
<ArrowRight />
|
|
47
|
+
</IconBox>
|
|
48
|
+
</Button>
|
|
49
|
+
</Flex>
|
|
50
|
+
</Box>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const dictionary = {
|
|
55
|
+
en: {
|
|
56
|
+
title: 'How’s your experience with StackSpot ',
|
|
57
|
+
description: 'Your feedback helps us make the platform more useful and intuitive for you. It only takes a few minutes.',
|
|
58
|
+
buttonText: 'Share your feedback',
|
|
59
|
+
},
|
|
60
|
+
pt: {
|
|
61
|
+
title: 'Como está sua experiência com StackSpot ',
|
|
62
|
+
description: 'Seu feedback nos ajuda a tornar a plataforma mais útil e intuitiva para você. Leva apenas alguns minutos.',
|
|
63
|
+
buttonText: 'Compartilhe seu feedback',
|
|
64
|
+
},
|
|
65
|
+
} satisfies Dictionary
|
|
66
|
+
|
|
@@ -25,6 +25,12 @@ export function isLessThan30Days(date1: Date, date2: Date) {
|
|
|
25
25
|
return differenceInDays < 30
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export function isFirstThreeDaysOfMonth() {
|
|
29
|
+
const today = new Date()
|
|
30
|
+
const day = today.getDate()
|
|
31
|
+
return day >= 1 && day <= 3
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
export function useRatingEffect() {
|
|
29
35
|
|
|
30
36
|
const handleInit = async () => {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { overlay } from '../../LayoutOverlayManager'
|
|
2
|
+
import { FeedbackModal } from './FeedbackModal'
|
|
3
|
+
import { RateComponent } from '.'
|
|
4
|
+
|
|
5
|
+
export const showFeedbackModal = ({ onClick, portal }: { onClick: () => void, portal: 'EDP' | 'AI' }) => (
|
|
6
|
+
<FeedbackModal onClick={onClick} portal={portal} />
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
sub: string,
|
|
11
|
+
tenant: string,
|
|
12
|
+
portal: 'EDP' | 'AI',
|
|
13
|
+
formIdentifier: string,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const showRateUsModal = ({ title, ...props }: Props & { title: string }) => {
|
|
17
|
+
const { formIdentifier, sub, tenant, portal } = props
|
|
18
|
+
overlay.showModal({
|
|
19
|
+
title: title,
|
|
20
|
+
children: <RateComponent tfLive={formIdentifier} userId={sub} orgId={tenant} portal={portal} />,
|
|
21
|
+
size: 'large',
|
|
22
|
+
})
|
|
23
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Backdrop } from './components/Backdrop'
|
|
2
2
|
export { showContactUsModal, showRateUsModal } from './components/Contact/show-contact-modal'
|
|
3
|
+
export { showFeedbackModal } from './components/Rate/show-modals'
|
|
3
4
|
export { Dialog } from './components/Dialog'
|
|
4
5
|
export { Header, HeaderProps } from './components/Header'
|
|
5
6
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent'
|
|
@@ -9,7 +10,6 @@ export { CLOSE_OVERLAY_ID, OverlayContent } from './components/OverlayContent'
|
|
|
9
10
|
export { PortalSwitcher } from './components/PortalSwitcher'
|
|
10
11
|
export { RateComponent } from './components/Rate'
|
|
11
12
|
export { useRatingEffect } from './components/Rate/hook'
|
|
12
|
-
export { showRatingModal } from './components/Rate/show-rating-modal'
|
|
13
13
|
export * from './components/tour'
|
|
14
14
|
export * from './elements'
|
|
15
15
|
export * from './errors'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"show-rating-modal.d.ts","sourceRoot":"","sources":["../../../src/components/Rate/show-rating-modal.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,QAAS,MAAM,UAAU,MAAM,UAAU,KAAK,GAAG,IAAI,kBAAkB,MAAM,SAAS,MAAM,SAMvH,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { overlay } from '../../LayoutOverlayManager.js';
|
|
3
|
-
import { RateComponent } from './index.js';
|
|
4
|
-
export const showRatingModal = (sub, tenant, portal, formIdentifier, title) => {
|
|
5
|
-
overlay.showModal({
|
|
6
|
-
title,
|
|
7
|
-
children: _jsx(RateComponent, { tfLive: formIdentifier, userId: sub, orgId: tenant, portal: portal }),
|
|
8
|
-
size: 'large',
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=show-rating-modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"show-rating-modal.js","sourceRoot":"","sources":["../../../src/components/Rate/show-rating-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAA;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,MAAc,EAAE,MAAoB,EAAE,cAAsB,EAAE,KAAa,EAAE,EAAE;IAC1H,OAAO,CAAC,SAAS,CAAC;QAChB,KAAK;QACL,QAAQ,EAAE,KAAC,aAAa,IAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI;QAC/F,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { overlay } from '../../LayoutOverlayManager'
|
|
2
|
-
import { RateComponent } from '.'
|
|
3
|
-
|
|
4
|
-
export const showRatingModal = (sub: string, tenant: string, portal: 'EDP' | 'AI', formIdentifier: string, title: string) => {
|
|
5
|
-
overlay.showModal({
|
|
6
|
-
title,
|
|
7
|
-
children: <RateComponent tfLive={formIdentifier} userId={sub} orgId={tenant} portal={portal} />,
|
|
8
|
-
size: 'large',
|
|
9
|
-
})
|
|
10
|
-
}
|