@campxdev/shared 3.0.9 → 3.1.1

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": "3.0.9",
3
+ "version": "3.1.1",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,18 +1,84 @@
1
- .react-joyride__tooltip {
2
- background-color: 'rgb(255, 255, 255)';
3
-
4
- }
5
-
6
- div.react-joyride__tooltip > div:nth-child(1) {
7
- text-align: left !important;
8
- }
1
+ /* Modern ReactJoyride Styles */
2
+ .react-joyride__tooltip {
3
+ background-color: #ffffff !important;
4
+ border-radius: 12px !important;
5
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
6
+ border: 1px solid #f3f4f6 !important;
7
+ font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif !important;
8
+ padding-top: 16px !important;
9
+ }
10
+
11
+ .react-joyride__tooltip div {
12
+ text-align: left !important;
13
+ }
14
+
15
+
16
+ .react-joyride__tooltip > div:nth-child(1) div:nth-child(2) {
17
+ padding: 0 !important;
18
+ font-size: 14px !important;
19
+ line-height: 1.5 !important;
20
+ color: #4b5563 !important;
21
+ }
22
+
23
+ /* Adjust skip button positioning */
24
+ .react-joyride__tooltip button[data-action="skip"] {
25
+ top: 16px !important;
26
+ right: 16px !important;
27
+ }
28
+
29
+ /* Beacon styling */
30
+ .react-joyride__beacon {
31
+ background-color: #3b82f6 !important;
32
+ border: 3px solid #3b82f6 !important;
33
+ border-radius: 50% !important;
34
+ box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2) !important;
35
+ }
9
36
 
10
- div.react-joyride__tooltip > div:nth-child(1) div:nth-child(2) {
11
- padding: 20px 0px !important;
12
- }
37
+ .react-joyride__beacon::before {
38
+ background-color: #3b82f6 !important;
39
+ animation: joyride-beacon-pulse 1.5s ease-in-out infinite !important;
40
+ }
13
41
 
14
- div.react-joyride__tooltip > div:nth-child(2) {
15
- flex-direction: row-reverse !important;
16
- }
17
-
42
+ /* Button hover effects */
43
+ .react-joyride__tooltip button[data-action="next"]:hover {
44
+ background-color: #000000 !important;
45
+ transform: translateY(-1px) !important;
46
+ }
18
47
 
48
+ .react-joyride__tooltip button[data-action="back"]:hover {
49
+ background-color: #f9fafb !important;
50
+ border-color: #d1d5db !important;
51
+ }
52
+
53
+ .react-joyride__tooltip button[data-action="skip"]:hover {
54
+ background-color: #f3f4f6 !important;
55
+ color: #374151 !important;
56
+ }
57
+
58
+ /* Progress indicator */
59
+ .react-joyride__tooltip .react-joyride__tooltip-footer {
60
+ margin-top: 16px !important;
61
+ padding-top: 16px !important;
62
+ border-top: 1px solid #f3f4f6 !important;
63
+ }
64
+
65
+ /* Arrow styling */
66
+ .react-joyride__tooltip-arrow {
67
+ filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1)) !important;
68
+ }
69
+
70
+ /* Custom keyframe for beacon pulse */
71
+ @keyframes joyride-beacon-pulse {
72
+ 0% {
73
+ transform: scale(1);
74
+ opacity: 1;
75
+ }
76
+ 50% {
77
+ transform: scale(1.2);
78
+ opacity: 0.7;
79
+ }
80
+ 100% {
81
+ transform: scale(1);
82
+ opacity: 1;
83
+ }
84
+ }
@@ -127,7 +127,7 @@ export default function Form({
127
127
  fullWidth
128
128
  variant="outlined"
129
129
  onClick={() => {
130
- onCancel ? onCancel() : null
130
+ if (onCancel) onCancel()
131
131
  }}
132
132
  disabled={isLoading}
133
133
  {...buttonProps}
@@ -88,30 +88,40 @@ const RenderForm = ({
88
88
  width: '100%',
89
89
  }}
90
90
  >
91
- {fields?.map((item) => {
92
- return renderFormField({
93
- field: item,
94
- control,
95
- dropdown: dropdowns ? dropdowns[item?.name] : null,
96
- elementProps: item?.elementProps,
97
- value: data ? data[item?.name] : null,
98
- fieldArrayOptions,
99
- })
100
- })}
91
+ {fields?.map((item, index) => (
92
+ <RenderFormField
93
+ key={index}
94
+ field={item}
95
+ control={control}
96
+ dropdown={dropdowns ? dropdowns[item?.name] : null}
97
+ elementProps={item?.elementProps}
98
+ value={data ? data[item?.name] : null}
99
+ fieldArrayOptions={fieldArrayOptions}
100
+ />
101
+ ))}
101
102
  </Box>
102
103
  </>
103
104
  )
104
105
  }
105
106
  export default RenderForm
106
107
 
107
- const renderFormField = ({
108
+ interface RenderFormFieldProps {
109
+ field: Field
110
+ control: Control<any, any>
111
+ dropdown: Option[] | null
112
+ elementProps: any
113
+ value: any
114
+ fieldArrayOptions?: { index: number; name: string }
115
+ }
116
+
117
+ const RenderFormField = ({
108
118
  field,
109
119
  control,
110
120
  dropdown,
111
121
  elementProps,
112
122
  value,
113
123
  fieldArrayOptions,
114
- }) => {
124
+ }: RenderFormFieldProps) => {
115
125
  const name = fieldArrayOptions?.name
116
126
  ? `${fieldArrayOptions?.name}.${fieldArrayOptions?.index}.${field?.name}`
117
127
  : field?.name
@@ -84,7 +84,7 @@ const MyProfile = ({ close }) => {
84
84
  case 4:
85
85
  return '4th'
86
86
  default:
87
- ''
87
+ return ''
88
88
  }
89
89
  }
90
90
 
@@ -1,7 +1,7 @@
1
1
  import TourIcon from '@mui/icons-material/Tour'
2
- import { Box, IconButton } from '@mui/material'
2
+ import { Box, Button, Typography } from '@mui/material'
3
3
  import { ReactNode, useEffect, useState } from 'react'
4
- import ReactJoyride, { Step } from 'react-joyride'
4
+ import ReactJoyride, { Step, CallBackProps } from 'react-joyride'
5
5
  import { useQuery } from 'react-query'
6
6
  import axios from '../config/axios'
7
7
  import './CustomJoyRideStyles.css'
@@ -11,14 +11,13 @@ function ReactJoyRide({
11
11
  steps,
12
12
  children,
13
13
  tourName,
14
- iconPosition,
15
14
  }: {
16
15
  steps: Step[]
17
16
  children?: ReactNode
18
17
  tourName: string
19
- iconPosition?: 'left' | 'right'
20
18
  }) {
21
19
  const [run, setRun] = useState(false)
20
+ const [stepIndex, setStepIndex] = useState(0)
22
21
 
23
22
  const fetchTours = (params) => {
24
23
  return axios.get(`/square/tours`).then((res) => res.data)
@@ -39,25 +38,68 @@ function ReactJoyRide({
39
38
  }
40
39
  }
41
40
 
42
- const handleJoyRideCallback = (data) => {
43
- const { action, status } = data
41
+ const handleJoyRideCallback = (data: CallBackProps) => {
42
+ const { action, status, index } = data
43
+
44
+ if (action === 'next' || action === 'prev') {
45
+ setStepIndex(index + (action === 'next' ? 1 : 0))
46
+ }
44
47
 
45
48
  if (action === 'reset') {
46
49
  setRun(false)
50
+ setStepIndex(0)
47
51
  completeTour()
48
52
  }
49
53
  }
50
54
 
51
- const customSteps = steps.map((step) => ({
52
- ...step,
53
- content: (
54
- <div style={{ fontFamily: 'Roboto, sans-serif' }}>{step.content}</div>
55
- ),
56
- }))
57
-
58
- if (toursLoading) {
59
- return <Spinner />
60
- }
55
+ const customSteps = steps.map((step, index) => ({
56
+ ...step,
57
+ title: '', // Remove the automatic title
58
+ content: (
59
+ <Box sx={{ fontFamily: 'Roboto, sans-serif',display: 'flex', flexDirection: 'column', }}>
60
+
61
+ <Typography
62
+ variant="caption"
63
+ sx={{
64
+ color: '#6b7280',
65
+ fontWeight: 500,
66
+ textTransform: 'uppercase',
67
+ letterSpacing: '0.5px',
68
+ fontSize: '11px',
69
+ }}
70
+ >
71
+ Step {index + 1}
72
+ </Typography>
73
+ <Box sx={{ padding: '4px 0' }}>
74
+ <Typography
75
+ sx={{
76
+ lineHeight: 1.5,
77
+ color: '#4b5563',
78
+ fontFamily: 'Poppins, sans-serif',
79
+ fontSize: '16px',
80
+ fontWeight: '600',
81
+ marginTop: '12px',
82
+ }}
83
+ >
84
+ {step.title}
85
+ </Typography>
86
+ </Box>
87
+ <Box sx={{ padding: '4px 0' }}>
88
+ <Typography
89
+ sx={{
90
+ fontSize: '14px',
91
+ lineHeight: 1.5,
92
+ color: '#4b5563',
93
+ fontFamily: 'Heebo, sans-serif',
94
+ fontWeight: '500',
95
+ }}
96
+ >
97
+ {step.content}
98
+ </Typography>
99
+ </Box>
100
+ </Box>
101
+ ),
102
+ }))
61
103
 
62
104
  return (
63
105
  <>
@@ -67,48 +109,104 @@ function ReactJoyRide({
67
109
  run={run}
68
110
  steps={customSteps}
69
111
  styles={{
112
+ options: {
113
+ primaryColor: '#121212',
114
+ textColor: '#1f2937',
115
+ backgroundColor: '#ffffff',
116
+ overlayColor: 'rgba(0, 0, 0, 0.4)',
117
+ arrowColor: '#ffffff',
118
+ zIndex: 1000,
119
+ },
120
+ tooltip: {
121
+ borderRadius: '12px',
122
+ boxShadow: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
123
+ fontSize: '14px',
124
+ padding: '20px',
125
+ minWidth: '320px',
126
+ maxWidth: '400px',
127
+ },
128
+ tooltipContainer: {
129
+ textAlign: 'left',
130
+ },
131
+ tooltipTitle: {
132
+ fontSize: '16px',
133
+ fontWeight: '600',
134
+ color: '#1f2937',
135
+ fontFamily: 'Poppins, sans-serif',
136
+ },
137
+ tooltipContent: {
138
+ fontSize: '14px',
139
+ lineHeight: '1.5',
140
+ color: '#4b5563',
141
+ padding: '0',
142
+ fontFamily: 'Heebo, sans-serif !important',
143
+ fontWeight: '400'
144
+ },
70
145
  buttonNext: {
71
- backgroundColor: '#D27D2D',
146
+ backgroundColor: '#121212',
72
147
  color: 'white',
73
- height: '28px',
74
- width: '100px',
75
- padding: '0px',
148
+ borderRadius: '8px',
149
+ fontSize: '14px',
150
+ fontWeight: '500',
151
+ height: '40px',
152
+ minWidth: '80px',
153
+ padding: '0 16px',
154
+ border: 'none',
155
+ cursor: 'pointer',
156
+ transition: 'all 0.2s ease',
76
157
  fontFamily: 'Roboto, sans-serif',
77
158
  },
78
-
79
159
  buttonBack: {
80
160
  backgroundColor: 'transparent',
81
- color: 'black',
82
- borderRadius: '4px',
83
- height: '28px',
84
- width: '100px',
85
- gap: '10px',
86
- marginLeft: '5px',
87
- padding: '0px',
88
- border: '1px solid black',
161
+ color: '#121212',
162
+ borderRadius: '8px',
163
+ fontSize: '14px',
164
+ fontWeight: '500',
165
+ height: '40px',
166
+ minWidth: '80px',
167
+ padding: '0 16px',
168
+ border: '1.5px solid #e5e7eb',
169
+ cursor: 'pointer',
170
+ transition: 'all 0.2s ease',
171
+ marginRight: '8px',
89
172
  fontFamily: 'Roboto, sans-serif',
90
173
  },
91
-
92
174
  buttonSkip: {
93
175
  backgroundColor: 'transparent',
94
- color: 'cement',
95
- borderRadius: '0px',
96
- border: '0px',
176
+ color: '#6b7280',
97
177
  fontSize: '13px',
98
- padding: '21px 15px',
99
- right: '0px',
100
- top: '0px',
178
+ fontWeight: '500',
179
+ border: 'none',
180
+ cursor: 'pointer',
101
181
  position: 'absolute',
102
- lineHeight: 1,
182
+ top: '16px',
183
+ right: '16px',
184
+ padding: '4px 8px',
185
+ borderRadius: '6px',
186
+ transition: 'all 0.2s ease',
103
187
  fontFamily: 'Roboto, sans-serif',
104
188
  },
189
+ buttonClose: {
190
+ display: 'none',
191
+ },
192
+ beacon: {
193
+ backgroundColor: '#3b82f6',
194
+ borderRadius: '50%',
195
+ border: '3px solid #3b82f6',
196
+ boxShadow: '0 0 0 6px rgba(59, 130, 246, 0.2)',
197
+ },
198
+ beaconInner: {
199
+ backgroundColor: '#3b82f6',
200
+ borderRadius: '50%',
201
+ },
105
202
  }}
106
203
  continuous
107
204
  showSkipButton
205
+ showProgress
108
206
  scrollToFirstStep
109
- disableOverlay
207
+ disableOverlay={false}
110
208
  disableOverlayClose
111
- disableScrolling
209
+ disableScrolling={false}
112
210
  hideCloseButton
113
211
  locale={{
114
212
  last: 'Finish',
@@ -120,22 +218,44 @@ function ReactJoyRide({
120
218
 
121
219
  {children}
122
220
 
123
- <IconButton
221
+ <Button
124
222
  onClick={() => setRun(true)}
223
+ variant="contained"
125
224
  sx={{
126
225
  position: 'fixed',
127
- bottom: '85px',
128
- left: iconPosition === 'left' ? '235px' : 'auto',
129
- right: iconPosition === 'right' ? '20px' : 'auto',
226
+ top: '50%',
227
+ right: '0px',
228
+ transform: 'translateY(-50%)',
130
229
  zIndex: 1000,
131
- borderRadius: '50%',
132
- width: '50px',
133
- height: '50px',
134
- backgroundColor: '#FF0244',
230
+ borderRadius: '8px 0 0 8px',
231
+ backgroundColor: '#E0E0E7',
232
+ color: '#4b5261ff',
233
+ fontSize: '14px',
234
+ fontWeight: 500,
235
+ padding: '60px 4px',
236
+ minWidth: 'auto',
237
+ textTransform: 'none',
238
+ border: '1px solid #D0D0E3',
239
+ borderRight: 'none',
240
+ fontFamily: 'Roboto, sans-serif',
241
+ letterSpacing: '0.025em',
242
+ writingMode: 'vertical-rl',
243
+ textOrientation: 'mixed',
244
+ whiteSpace: 'nowrap',
245
+ transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 2)',
246
+ '&:hover': {
247
+ backgroundColor: '#1E027F',
248
+ color: 'white',
249
+ boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
250
+ transform: 'translateY(-50%) translateX(-4px)',
251
+ },
252
+ '&:active': {
253
+ transform: 'translateY(-50%) translateX(0px)',
254
+ },
135
255
  }}
136
256
  >
137
- <TourIcon sx={{ color: 'white' }} />
138
- </IconButton>
257
+ Take a Tour
258
+ </Button>
139
259
  </Box>
140
260
  </>
141
261
  )
@@ -0,0 +1,240 @@
1
+ import React, { ReactNode, useState } from 'react'
2
+ import TourIcon from '@mui/icons-material/Tour'
3
+ import { Box, Button, Typography } from '@mui/material'
4
+ import ReactJoyride, { Step, CallBackProps } from 'react-joyride'
5
+ // import './CustomJoyRideStyles.css'
6
+
7
+ function ReactJoyRideDemo({
8
+ steps,
9
+ children,
10
+ tourName,
11
+ }: {
12
+ steps: Step[]
13
+ children?: ReactNode
14
+ tourName: string
15
+ }) {
16
+ const [run, setRun] = useState(false)
17
+ const [stepIndex, setStepIndex] = useState(0)
18
+ const handleJoyRideCallback = (data: CallBackProps) => {
19
+ const { action, status, index } = data
20
+
21
+ if (action === 'next' || action === 'prev') {
22
+ setStepIndex(index + (action === 'next' ? 1 : 0))
23
+ }
24
+
25
+ if (action === 'reset') {
26
+ setRun(false)
27
+ setStepIndex(0)
28
+ // For demo purposes, we'll just log instead of making API calls
29
+ console.log('Tour completed:', tourName)
30
+ }
31
+ }
32
+
33
+ const customSteps = steps.map((step, index) => ({
34
+ ...step,
35
+ content: (
36
+ <Box sx={{ fontFamily: 'Roboto, sans-serif',display: 'flex', flexDirection: 'column', }}>
37
+
38
+ <Typography
39
+ variant="caption"
40
+ sx={{
41
+ color: '#6b7280',
42
+ fontWeight: 500,
43
+ textTransform: 'uppercase',
44
+ letterSpacing: '0.5px',
45
+ fontSize: '11px',
46
+ }}
47
+ >
48
+ Step {index + 1}
49
+ </Typography>
50
+ <Box sx={{ padding: '4px 0' }}>
51
+ <Typography
52
+ sx={{
53
+ lineHeight: 1.5,
54
+ color: '#4b5563',
55
+ fontFamily: 'Poppins, sans-serif',
56
+ fontSize: '16px',
57
+ fontWeight: '600',
58
+ marginTop: '12px',
59
+ }}
60
+ >
61
+ {step.title}
62
+ </Typography>
63
+ </Box>
64
+ <Box sx={{ padding: '4px 0' }}>
65
+ <Typography
66
+ sx={{
67
+ fontSize: '14px',
68
+ lineHeight: 1.5,
69
+ color: '#4b5563',
70
+ fontFamily: 'Heebo, sans-serif',
71
+ fontWeight: '500',
72
+ }}
73
+ >
74
+ {step.content}
75
+ </Typography>
76
+ </Box>
77
+ </Box>
78
+ ),
79
+ }))
80
+
81
+ return (
82
+ <>
83
+ <Box>
84
+ <ReactJoyride
85
+ callback={handleJoyRideCallback}
86
+ run={run}
87
+ steps={customSteps}
88
+ styles={{
89
+ options: {
90
+ primaryColor: '#121212',
91
+ textColor: '#1f2937',
92
+ backgroundColor: '#ffffff',
93
+ overlayColor: 'rgba(0, 0, 0, 0.4)',
94
+ arrowColor: '#ffffff',
95
+ zIndex: 1000,
96
+ },
97
+ tooltip: {
98
+ borderRadius: '12px',
99
+ boxShadow: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
100
+ fontSize: '14px',
101
+ padding: '20px',
102
+ minWidth: '320px',
103
+ maxWidth: '400px',
104
+ },
105
+ tooltipContainer: {
106
+ textAlign: 'left',
107
+ },
108
+ tooltipTitle: {
109
+ fontSize: '16px',
110
+ fontWeight: '600',
111
+ color: '#1f2937',
112
+ marginBottom: '8px',
113
+ display: 'none',
114
+ },
115
+ tooltipContent: {
116
+ fontSize: '14px',
117
+ lineHeight: '1.5',
118
+ color: '#4b5563',
119
+ padding: '0',
120
+ },
121
+ buttonNext: {
122
+ backgroundColor: '#121212',
123
+ color: 'white',
124
+ borderRadius: '8px',
125
+ fontSize: '14px',
126
+ fontWeight: '500',
127
+ height: '40px',
128
+ minWidth: '80px',
129
+ padding: '0 16px',
130
+ border: 'none',
131
+ cursor: 'pointer',
132
+ transition: 'all 0.2s ease',
133
+ fontFamily: 'Roboto, sans-serif',
134
+ },
135
+ buttonBack: {
136
+ backgroundColor: 'transparent',
137
+ color: '#121212',
138
+ borderRadius: '8px',
139
+ fontSize: '14px',
140
+ fontWeight: '500',
141
+ height: '40px',
142
+ minWidth: '80px',
143
+ padding: '0 16px',
144
+ border: '1.5px solid #e5e7eb',
145
+ cursor: 'pointer',
146
+ transition: 'all 0.2s ease',
147
+ marginRight: '8px',
148
+ fontFamily: 'Roboto, sans-serif',
149
+ },
150
+ buttonSkip: {
151
+ backgroundColor: 'transparent',
152
+ color: '#6b7280',
153
+ fontSize: '13px',
154
+ fontWeight: '500',
155
+ border: 'none',
156
+ cursor: 'pointer',
157
+ position: 'absolute',
158
+ top: '16px',
159
+ right: '16px',
160
+ padding: '4px 8px',
161
+ borderRadius: '6px',
162
+ transition: 'all 0.2s ease',
163
+ fontFamily: 'Roboto, sans-serif',
164
+ },
165
+ buttonClose: {
166
+ display: 'none',
167
+ },
168
+ beacon: {
169
+ backgroundColor: '#3b82f6',
170
+ borderRadius: '50%',
171
+ border: '3px solid #3b82f6',
172
+ boxShadow: '0 0 0 6px rgba(59, 130, 246, 0.2)',
173
+ },
174
+ beaconInner: {
175
+ backgroundColor: '#3b82f6',
176
+ borderRadius: '50%',
177
+ },
178
+ }}
179
+ continuous
180
+ showSkipButton
181
+ showProgress
182
+ scrollToFirstStep
183
+ disableOverlay={false}
184
+ disableOverlayClose
185
+ disableScrolling={false}
186
+ hideCloseButton
187
+ locale={{
188
+ last: 'Finish',
189
+ next: 'Next',
190
+ skip: 'Skip',
191
+ back: 'Previous',
192
+ }}
193
+ />
194
+
195
+ {children}
196
+
197
+ <Button
198
+ onClick={() => setRun(true)}
199
+ variant="contained"
200
+ startIcon={<TourIcon />}
201
+ sx={{
202
+ position: 'fixed',
203
+ top: '50%',
204
+ right: '20px',
205
+ transform: 'translateY(-50%)',
206
+ zIndex: 1000,
207
+ borderRadius: '12px',
208
+ backgroundColor: '#3b82f6',
209
+ color: 'white',
210
+ fontSize: '14px',
211
+ fontWeight: 600,
212
+ padding: '12px 20px',
213
+ minWidth: 'auto',
214
+ textTransform: 'none',
215
+ boxShadow: '0 10px 25px -5px rgba(59, 130, 246, 0.4), 0 4px 6px -2px rgba(59, 130, 246, 0.05)',
216
+ border: 'none',
217
+ fontFamily: 'Roboto, sans-serif',
218
+ letterSpacing: '0.025em',
219
+ transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
220
+ '&:hover': {
221
+ backgroundColor: '#2563eb',
222
+ boxShadow: '0 20px 25px -5px rgba(59, 130, 246, 0.4), 0 10px 10px -5px rgba(59, 130, 246, 0.1)',
223
+ transform: 'translateY(-50%) translateY(-1px)',
224
+ },
225
+ '& .MuiButton-startIcon': {
226
+ marginRight: '8px',
227
+ '& svg': {
228
+ fontSize: '18px',
229
+ },
230
+ },
231
+ }}
232
+ >
233
+ Take a Tour
234
+ </Button>
235
+ </Box>
236
+ </>
237
+ )
238
+ }
239
+
240
+ export default ReactJoyRideDemo
@@ -1,5 +1,4 @@
1
1
  import { ReactNode } from 'react'
2
- import { campxTenantKey } from '../contexts/Providers'
3
2
 
4
3
  // Configuration for tenant-specific batch suffixes
5
4
  const tenantBatchConfig = {
@@ -21,7 +20,7 @@ export const batchOptions = (() => {
21
20
  })
22
21
 
23
22
  // Check if current tenant has specific batch configuration
24
- const tenantConfig = tenantBatchConfig[campxTenantKey]
23
+ const tenantConfig = tenantBatchConfig[window.location.hostname.split('.')[0]]
25
24
 
26
25
  if (tenantConfig) {
27
26
  const { batchConfigs } = tenantConfig
@@ -49,7 +49,7 @@ export default function Providers({ children }: { children: ReactNode }) {
49
49
  }
50
50
 
51
51
  useEffect(() => {
52
- if (location.pathname === '/' && institutionCode && tenantCode) {
52
+ if (window.location.pathname === '/' && institutionCode && tenantCode) {
53
53
  window.location.replace(window.location.origin + `/${institutionCode}`)
54
54
  }
55
55
  }, [])