@campxdev/shared 1.10.91 → 1.10.93
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/package.json +1 -1
- package/src/components/IconButtons/IconButtons.tsx +12 -1
- package/src/components/IconButtons/Icons.tsx +22 -0
- package/src/components/IconButtons/index.tsx +2 -1
- package/src/components/ReportHeader.tsx +24 -13
- package/src/components/index.ts +1 -0
- package/src/config/axiosXTenant.ts +4 -0
- package/src/contexts/Providers.tsx +1 -1
package/package.json
CHANGED
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
DisabledDeleteIcon,
|
|
6
6
|
DisabledEditIcon,
|
|
7
7
|
EditIcon,
|
|
8
|
-
ViewIcon,
|
|
9
8
|
PrintIcon,
|
|
9
|
+
RestoreIcon,
|
|
10
|
+
ViewIcon,
|
|
10
11
|
} from './Icons'
|
|
11
12
|
|
|
12
13
|
interface ButtonProps extends IconButtonProps {
|
|
@@ -120,6 +121,16 @@ export function DeleteButton({
|
|
|
120
121
|
)
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
export const RestoreButton = ({ ...props }: ButtonProps) => {
|
|
125
|
+
return (
|
|
126
|
+
<>
|
|
127
|
+
<Button {...props}>
|
|
128
|
+
<RestoreIcon />
|
|
129
|
+
</Button>
|
|
130
|
+
</>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
123
134
|
const StyledIconButton = styled(IconButton)<{
|
|
124
135
|
actionType: 'delete' | 'edit' | 'view' | 'print'
|
|
125
136
|
}>(({ theme, actionType }) => ({
|
|
@@ -98,6 +98,28 @@ export const DeleteIcon = () => {
|
|
|
98
98
|
)
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
export const RestoreIcon = () => {
|
|
102
|
+
return (
|
|
103
|
+
<>
|
|
104
|
+
<svg
|
|
105
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
106
|
+
width="17.375"
|
|
107
|
+
height="17.375"
|
|
108
|
+
viewBox="0 0 17.375 17.375"
|
|
109
|
+
>
|
|
110
|
+
<path
|
|
111
|
+
id="Path_19300"
|
|
112
|
+
data-name="Path 19300"
|
|
113
|
+
d="M17.9,9.564A8.347,8.347,0,0,0,9.564,17.9a.333.333,0,0,0,.667,0,7.675,7.675,0,1,1,2.324,5.5h1.74a.333.333,0,1,0,0-.667h-2.5a.321.321,0,0,0-.08.016c-.01,0-.02,0-.03.006a.323.323,0,0,0-.076.042.312.312,0,0,0-.034.019s0,.006-.007.009a.9.9,0,0,0-.08.111s0,0,0,.007a.328.328,0,0,0-.025.129v2.5a.333.333,0,0,0,.667,0V23.914A8.337,8.337,0,1,0,17.9,9.564Z"
|
|
114
|
+
transform="translate(-9.214 -9.214)"
|
|
115
|
+
fill="#1c1c1c"
|
|
116
|
+
stroke="#1c1c1c"
|
|
117
|
+
stroke-width="0.7"
|
|
118
|
+
/>
|
|
119
|
+
</svg>
|
|
120
|
+
</>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
101
123
|
export const DisabledEditIcon = () => {
|
|
102
124
|
return (
|
|
103
125
|
<svg
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import { Box, Typography } from '@mui/material'
|
|
1
|
+
import { Box, SxProps, Typography } from '@mui/material'
|
|
2
|
+
import { Variant } from '@mui/material/styles/createTypography'
|
|
2
3
|
|
|
4
|
+
interface TypographyList {
|
|
5
|
+
text: string
|
|
6
|
+
sx?: SxProps
|
|
7
|
+
variant?: Variant
|
|
8
|
+
}
|
|
3
9
|
interface ReportHeaderProps {
|
|
10
|
+
typographyList?: TypographyList[]
|
|
4
11
|
logo: any
|
|
5
|
-
|
|
6
|
-
|
|
12
|
+
imageSize?: string
|
|
13
|
+
containerSx?: SxProps
|
|
7
14
|
}
|
|
8
15
|
|
|
9
|
-
export
|
|
16
|
+
export default function ReportHeader({
|
|
17
|
+
logo,
|
|
18
|
+
typographyList,
|
|
19
|
+
containerSx,
|
|
20
|
+
imageSize,
|
|
21
|
+
}: ReportHeaderProps) {
|
|
10
22
|
return (
|
|
11
23
|
<Box
|
|
12
24
|
sx={{
|
|
@@ -14,24 +26,23 @@ export const ReportHeader = ({ logo, address, title }: ReportHeaderProps) => {
|
|
|
14
26
|
flexDirection: 'column',
|
|
15
27
|
alignItems: 'center',
|
|
16
28
|
gap: '5px',
|
|
29
|
+
...containerSx,
|
|
17
30
|
}}
|
|
18
31
|
>
|
|
19
32
|
<img
|
|
20
33
|
style={{
|
|
21
|
-
height: '
|
|
34
|
+
height: imageSize ? imageSize : '80px',
|
|
22
35
|
objectFit: 'contain',
|
|
23
36
|
}}
|
|
24
37
|
src={logo}
|
|
25
38
|
/>
|
|
26
39
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
</Typography>
|
|
34
|
-
)}
|
|
40
|
+
{typographyList &&
|
|
41
|
+
typographyList.map((s) => (
|
|
42
|
+
<Typography variant={s.variant} sx={{ ...s.sx }}>
|
|
43
|
+
{s.text}
|
|
44
|
+
</Typography>
|
|
45
|
+
))}
|
|
35
46
|
</Box>
|
|
36
47
|
)
|
|
37
48
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -58,6 +58,7 @@ export { default as NoDataIllustration } from './NoDataIllustration'
|
|
|
58
58
|
export { PageContent } from './PageContent'
|
|
59
59
|
export { default as PageHeader } from './PageHeader'
|
|
60
60
|
export { default as useConfirm } from './PopupConfirm/useConfirm'
|
|
61
|
+
export { default as ReportHeader } from './ReportHeader'
|
|
61
62
|
export { default as ReportPageHeader } from './ReportPageHeader'
|
|
62
63
|
export { default as Spinner } from './Spinner'
|
|
63
64
|
export { default as PaymentStepper } from './Stepper'
|
|
@@ -7,6 +7,7 @@ import { formatParams } from './axios'
|
|
|
7
7
|
const sessionKey = Cookies.get('campx_session_key')
|
|
8
8
|
const clientId = window.location.pathname.split('/')[1] ?? 'campx_dev'
|
|
9
9
|
const evaluatorKey = Cookies.get('campx_evaluator_key')
|
|
10
|
+
const openPaymentsKey = Cookies.get('campx_open_payments_key')
|
|
10
11
|
|
|
11
12
|
const axiosTenant = Axios.create({
|
|
12
13
|
baseURL: process.env.REACT_APP_API_HOST,
|
|
@@ -20,6 +21,9 @@ const axiosTenant = Axios.create({
|
|
|
20
21
|
...(evaluatorKey && {
|
|
21
22
|
campx_evaluator_key: evaluatorKey,
|
|
22
23
|
}),
|
|
24
|
+
...(openPaymentsKey && {
|
|
25
|
+
campx_open_payments_key: openPaymentsKey,
|
|
26
|
+
}),
|
|
23
27
|
},
|
|
24
28
|
})
|
|
25
29
|
|
|
@@ -35,7 +35,7 @@ export default function Providers({ children }: { children: ReactNode }) {
|
|
|
35
35
|
useEffect(() => {
|
|
36
36
|
if (!urlTenantKey) {
|
|
37
37
|
if (isDevelopment) {
|
|
38
|
-
window.location.replace(window.location.origin + `/
|
|
38
|
+
window.location.replace(window.location.origin + `/aupulse`)
|
|
39
39
|
}
|
|
40
40
|
if (campxTenantKey)
|
|
41
41
|
window.location.replace(window.location.origin + `/${campxTenantKey}`)
|