@campxdev/shared 1.11.7-1.alpha.10 → 1.11.7-1.alpha.12

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.11.7-1.alpha.10",
3
+ "version": "1.11.7-1.alpha.12",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -9,6 +9,7 @@ interface ImageProps {
9
9
  fit?: 'cover' | 'contain' | 'fill'
10
10
  radius?: string | number
11
11
  defaultImage?: any
12
+ svg?: boolean
12
13
  }
13
14
 
14
15
  export default function Image({
@@ -19,6 +20,7 @@ export default function Image({
19
20
  fit = 'contain',
20
21
  radius = '10px',
21
22
  defaultImage = null,
23
+ svg = false,
22
24
  }: ImageProps) {
23
25
  return (
24
26
  <Box
@@ -33,13 +35,17 @@ export default function Image({
33
35
  },
34
36
  }}
35
37
  >
36
- <img
37
- src={src || defaultImage}
38
- alt={alt}
39
- onError={(e: any) => {
40
- e.target.src = defaultImage ? defaultImage : brokenImage
41
- }}
42
- />
38
+ {svg ? (
39
+ src
40
+ ) : (
41
+ <img
42
+ src={src || defaultImage}
43
+ alt={alt}
44
+ onError={(e: any) => {
45
+ e.target.src = defaultImage ? defaultImage : brokenImage
46
+ }}
47
+ />
48
+ )}
43
49
  </Box>
44
50
  )
45
51
  }
@@ -61,6 +61,9 @@ export function LoginForm({
61
61
  ...deviceState.deviceInformation,
62
62
  },
63
63
  })
64
+ Cookies.remove('campx_session_key')
65
+ Cookies.remove('campx_tenant')
66
+ Cookies.remove('campx_institution')
64
67
  Cookies.set('campx_session_key', res.data?.token)
65
68
  Cookies.set('campx_tenant', res.data?.subDomain)
66
69
  Cookies.set('campx_institution', res.data?.institutionCode)
@@ -6,12 +6,14 @@ interface Props {
6
6
  imageSrc: string
7
7
  height?: string
8
8
  message?: string | ReactNode
9
+ svg?: boolean
9
10
  }
10
11
 
11
12
  export default function NoData({
12
13
  imageSrc,
13
14
  height = '300px',
14
15
  message = 'No Data Found',
16
+ svg = false,
15
17
  }: Props) {
16
18
  return (
17
19
  <Box
@@ -19,7 +21,13 @@ export default function NoData({
19
21
  marginTop: '20px',
20
22
  }}
21
23
  >
22
- <Image alt="No Data Found" height={height} width="auto" src={imageSrc} />
24
+ <Image
25
+ alt="No Data Found"
26
+ height={height}
27
+ width="auto"
28
+ src={imageSrc}
29
+ svg={svg}
30
+ />
23
31
  {typeof message === 'string' ? (
24
32
  <StyledTypography variant="h6">{message}</StyledTypography>
25
33
  ) : (
@@ -12,6 +12,7 @@ const tenantCode = isDevelopment
12
12
  const institutionCode = window.location.pathname.split('/')[1]
13
13
 
14
14
  const openPaymentsKey = Cookies.get('campx_open_payments_key')
15
+ console.log(openPaymentsKey)
15
16
 
16
17
  export const formatParams = (params) => {
17
18
  return Object.fromEntries(
@@ -26,7 +26,9 @@ export default function Providers({ children }: { children: ReactNode }) {
26
26
  var baseName = '/'
27
27
  var tenantCode
28
28
  var institutionCode =
29
- Cookies.get('campx_institution') ?? window.location.pathname.split('/')[1]
29
+ window.location.pathname.split('/')[1] != ''
30
+ ? window.location.pathname.split('/')[1]
31
+ : Cookies.get('campx_institution')
30
32
 
31
33
  if (isDevelopment) {
32
34
  tenantCode = Cookies.get('campx_tenant')