@campxdev/shared 1.10.92 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.10.92",
3
+ "version": "1.10.93",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -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
- address: string
6
- title?: string
12
+ imageSize?: string
13
+ containerSx?: SxProps
7
14
  }
8
15
 
9
- export const ReportHeader = ({ logo, address, title }: ReportHeaderProps) => {
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: '40px',
34
+ height: imageSize ? imageSize : '80px',
22
35
  objectFit: 'contain',
23
36
  }}
24
37
  src={logo}
25
38
  />
26
39
 
27
- <Typography variant="h5" style={{ fontSize: '15px' }}>
28
- {address}
29
- </Typography>
30
- {title && (
31
- <Typography variant="h2" style={{ fontSize: '13px' }}>
32
- {title}
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
  }
@@ -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 + `/campx_dev`)
38
+ window.location.replace(window.location.origin + `/aupulse`)
39
39
  }
40
40
  if (campxTenantKey)
41
41
  window.location.replace(window.location.origin + `/${campxTenantKey}`)