@argusoft/medplat-app-shell 1.0.6 → 1.0.8
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 +139 -141
- package/src/GlobalErrorBoundary.jsx +31 -0
- package/src/SilentErrorFallback.jsx +68 -0
- package/src/TrackingProviderWrapper.jsx +40 -0
- package/src/_tests_/__mocks__/MockTranslationProvider.jsx +21 -0
- package/src/_tests_/__mocks__/ckeditor.js +45 -0
- package/src/_tests_/__mocks__/fileMock.js +1 -0
- package/src/_tests_/__mocks__/useranalytics.js +5 -0
- package/src/_tests_/views/components/Dashboard/DashboardUI.test.jsx +137 -0
- package/src/_tests_/views/components/Dashboard/DashboardUIMock.js +877 -0
- package/src/_tests_/views/components/ForgotPassword/ForgotPassword.test.jsx +314 -0
- package/src/_tests_/views/components/LocationDirective/LocationDirective.test.jsx.disable +229 -0
- package/src/_tests_/views/components/LocationDirective/mockLocationDirective.js +810 -0
- package/src/_tests_/views/components/LocationType/MockLocationType.js +42259 -0
- package/src/_tests_/views/components/LocationType/addlocationtype.test.jsx.disable +276 -0
- package/src/_tests_/views/components/LocationType/editlocationtype.test.jsx.disable +262 -0
- package/src/_tests_/views/components/LocationType/locationtype.test.jsx.disable +148 -0
- package/src/_tests_/views/components/Profile/UpdateProfileModalData.js +4396 -0
- package/src/_tests_/views/components/Profile/updateprofilemodal.test.jsx +282 -0
- package/src/_tests_/views/components/SideBar/MockSideBar.js +1379 -0
- package/src/_tests_/views/components/SideBar/SideBar.test.jsx +98 -0
- package/src/_tests_/views/components/SystemConfig/ManageSystemConfig/AddManageSystemConfig.test.jsx.disable +164 -0
- package/src/_tests_/views/components/SystemConfig/ManageSystemConfig/UpdateManageSystemConfig.test.jsx.disable +157 -0
- package/src/_tests_/views/components/SystemConfig/MockSystemConfig.js +1280 -0
- package/src/_tests_/views/components/SystemConfig/SystemConfig.test.jsx.disable +165 -0
- package/src/_tests_/views/components/login/Login.test.jsx +276 -0
- package/src/_tests_/views/components/login/MockAuthorise.js +2414 -0
- package/src/_tests_/views/components/login/ServiceResponse.js +595 -0
- package/src/_tests_/views/components/user/MockManageUser.js +7965 -0
- package/src/_tests_/views/components/user/manageuser.test.jsx.disable +989 -0
- package/src/_tests_/views/components/user/mockUsersData.js +582 -0
- package/src/assets/img/OASISLogin.png +0 -0
- package/src/assets/img/bahaarNew.png +0 -0
- package/src/assets/img/dnhdd4K.png +0 -0
- package/src/assets/img/govtofup.png +0 -0
- package/src/assets/img/sewarural4K.png +0 -0
- package/src/assets/img/techo4K.png +0 -0
- package/src/assets/img/up4K.png +0 -0
- package/src/common/HolidayList.jsx +573 -0
- package/src/common/MalaciaousInputUtil.js +23 -0
- package/src/common/SafeHtml.jsx +17 -0
- package/src/common/VersionManager.jsx +109 -0
- package/src/common/constants/PerformanceDashboard.js +514 -0
- package/src/common/constants/app.constant.js +781 -0
- package/src/common/constants/cccVerificationConstants.js +18 -0
- package/src/common/constants/fhsrConstant.js +33 -0
- package/src/common/constants/gvk-verification.constant.js +76 -0
- package/src/common/constants/search.constant.js +23 -0
- package/src/common/constants/teleconsulatationConstant.jsx +1339 -0
- package/src/common/directives/SearchTemplate.jsx +784 -0
- package/src/common/directives/SearchTemplate.scss +14 -0
- package/src/common/dynamicView/DynamicView.jsx +353 -0
- package/src/common/dynamicView/InputFieldComponent.jsx +1501 -0
- package/src/common/dynamicView/InputViewComponent.jsx +298 -0
- package/src/common/dynamicView/InputViewComponent.scss +15 -0
- package/src/common/env.js +5 -0
- package/src/common/filters/locationNameFilter.js +26 -0
- package/src/common/fontAwesomeIcons/FontAwesomeIcons.jsx +27 -0
- package/src/common/fontAwesomeIcons/FontAwesomeIconsNames.js +1968 -0
- package/src/common/fontPreferences/fontSizeProvider.jsx +34 -0
- package/src/common/fontPreferences/fontSizeSelector.jsx +116 -0
- package/src/common/getAssignedFeature/getAssignedFeature.js +32 -0
- package/src/common/interceptors/AxiosInterceptor.js +216 -0
- package/src/common/languageTranslator/TranslationContext.js +5 -0
- package/src/common/languageTranslator/TranslationProvider.jsx +24 -0
- package/src/common/languageTranslator/i18n.js +49 -0
- package/src/common/services/AuthenticateService.js +116 -0
- package/src/common/services/DownloadFile.js +35 -0
- package/src/common/services/ForgotPassword.js +18 -0
- package/src/common/services/FormConfiguratorService.js +195 -0
- package/src/common/services/GlobalApis.js +84 -0
- package/src/common/services/InterceptorNavigationService.js +17 -0
- package/src/common/services/LocationService.js +65 -0
- package/src/common/services/LocationType.js +11 -0
- package/src/common/services/QueryBuilder.js +36 -0
- package/src/common/services/Roles.js +28 -0
- package/src/common/services/SyncWithServer.js +15 -0
- package/src/common/services/SystemConfig.js +15 -0
- package/src/common/services/TranslationService.js +70 -0
- package/src/common/services/TwoFactorService.js +7 -0
- package/src/common/services/Users.js +91 -0
- package/src/common/services/Webtasks.js +27 -0
- package/src/common/services/util/Convert-pad-data-to-API-format.jsx +167 -0
- package/src/common/services/util/Convert-to-UI-format.jsx +82 -0
- package/src/common/services/util/EmptyPrescriptionPadData.jsx +11 -0
- package/src/common/services/util/GeneralUtil.js +456 -0
- package/src/common/services/util/Prescription-pad-util.js +339 -0
- package/src/common/services/util/PrescriptionPadData.js +67 -0
- package/src/common/services/util/PrescriptionpadCommonUtil.js +96 -0
- package/src/common/services/util/ReportFieldUtil.jsx +398 -0
- package/src/common/services/util/WebSocketContext.jsx +261 -0
- package/src/common/syncWithServer/SyncWithServerDialog.jsx +170 -0
- package/src/common/syncWithServer/SyncWithServerDialogSkeleton.jsx +67 -0
- package/src/common/tests/CustomWrapper.jsx +49 -0
- package/src/common/tests/TranslationWrapper.jsx +38 -0
- package/src/common/themeProvider/ColorInputs.jsx +97 -0
- package/src/common/themeProvider/EditableColorInput.jsx +128 -0
- package/src/common/themeProvider/ThemeEditor.jsx +319 -0
- package/src/common/themeProvider/ThemeProvider.jsx +210 -0
- package/src/common/themeProvider/themeConfig.js +558 -0
- package/src/common/toaster/toaster.jsx +30 -0
- package/src/firebaseConfig.js +24 -0
- package/src/global.scss +221 -0
- package/src/hooks/.gitkeep +0 -0
- package/src/hooks/useAESEncryption.js +56 -0
- package/src/hooks/useCaching.js +43 -0
- package/src/hooks/useDebounce.js +34 -0
- package/src/hooks/useDebounceFn.js +50 -0
- package/src/hooks/useDownloadPdf.js +358 -0
- package/src/hooks/useDownloadXlsx.js +55 -0
- package/src/hooks/useListValueFieldValues.js +30 -0
- package/src/hooks/useLocationHierarchies.js +63 -0
- package/src/hooks/useLocationHierarchyTranslate.js +16 -0
- package/src/hooks/useOnline.js +27 -0
- package/src/hooks/usePagination.js +63 -0
- package/src/hooks/useRefreshToken.js +87 -0
- package/src/hooks/useScript.js +25 -0
- package/src/hooks/useStopwatch.js +75 -0
- package/src/hooks/useTrackEvent.js +22 -0
- package/src/hooks/useWebAudioRecorder.js +115 -0
- package/src/layout/LoaderComponet.jsx +22 -0
- package/src/layout/LoaderContext.jsx +29 -0
- package/src/layout/mainLayout/AdaptiveZoom.jsx +27 -0
- package/src/layout/mainLayout/Chatbot.jsx +243 -0
- package/src/layout/mainLayout/Layout.jsx +445 -0
- package/src/layout/mainLayout/Profile/UpdateProfileModal.jsx +684 -0
- package/src/layout/mainLayout/header/LogoutModal.jsx +131 -0
- package/src/layout/mainLayout/header/Navbar.jsx +1677 -0
- package/src/layout/mainLayout/header/Navbar.scss +4 -0
- package/src/layout/mainLayout/header/index.js +0 -0
- package/src/layout/mainLayout/sidebar/SideBar.jsx +1402 -0
- package/src/layout/mainLayout/sidebar/Sidebar.css +159 -0
- package/src/layout/mainLayout/sidebar/index.js +0 -0
- package/src/logo.svg +1 -0
- package/src/reportWebVitals.js +13 -0
- package/src/setupFirebaseMessaging.js +28 -0
- package/src/setupTests.js +8 -0
- package/src/store/actions/AuthenticationActions.js +0 -0
- package/src/store/actions/ReportsActions.js +0 -0
- package/src/store/actions/TranslationAction.js +0 -0
- package/src/store/index.js +8 -0
- package/src/store/reducer.js +46 -0
- package/src/store/reducers/AuthenticationReducer.js +50 -0
- package/src/store/reducers/CalendarEventReducer.js +41 -0
- package/src/store/reducers/ConditionClipboardReducer.js +45 -0
- package/src/store/reducers/FeatureReducer.js +27 -0
- package/src/store/reducers/FormConfiguratorReducer.js +38 -0
- package/src/store/reducers/LoadingReducer.js +20 -0
- package/src/store/reducers/MembersAuthenticationReducer.js +28 -0
- package/src/store/reducers/PrescriptionPadReducer.js +329 -0
- package/src/store/reducers/QuestionaireReducer.js +29 -0
- package/src/store/reducers/ReportsReducer.js +24 -0
- package/src/store/reducers/SkeletonReducer.js +20 -0
- package/src/store/reducers/ThemeReducer.js +106 -0
- package/src/store/reducers/TranslationReducer.js +126 -0
- package/src/store/reducers/dashboardEditorSlice.js +77 -0
- package/src/store/reducers/districtHealthDashboardSlice.js +58 -0
- package/src/store/reducers/immunizationSlice.js +234 -0
- package/src/store/slices/dashboardPagesSlice.js +51 -0
- package/src/store/slices/dashboardSlice.js +14 -0
- package/src/utils/.gitkeep +0 -0
- package/src/utils/FormConstants.js +2629 -0
- package/src/utils/GujaratTopoChart.jsx +483 -0
- package/src/utils/UUIDgenerator.js +8 -0
- package/src/utils/appointment-utils/appointment-utils.js +123 -0
- package/src/utils/feature.js +42 -0
- package/src/utils/getThemeColor.js +12 -0
- package/src/utils/localStorageHelper.js +11 -0
- package/src/utils/notifications/enable-push-notifications.js +27 -0
- package/src/utils/resolveAppliedStyle.js +11 -0
- package/src/utils/themeConfigs.js +1483 -0
- package/src/views/custom-components/.gitkeep +0 -0
- package/src/views/custom-components/AgIconButton/RIf.jsx +14 -0
- package/src/views/custom-components/AgIconButton/button.jsx +108 -0
- package/src/views/custom-components/AgIconButton/waterDrop.jsx +95 -0
- package/src/views/custom-components/AgIconButton/waterDrop.scss +37 -0
- package/src/views/custom-components/AlertPlaceholder.jsx +32 -0
- package/src/views/custom-components/AllFaIconsSelector.jsx +56 -0
- package/src/views/custom-components/CkEditor/CkEditor.js +102 -0
- package/src/views/custom-components/CustomAccordion.jsx +72 -0
- package/src/views/custom-components/CustomActionIcons.jsx +118 -0
- package/src/views/custom-components/CustomAutoComplete.jsx +188 -0
- package/src/views/custom-components/CustomCheckBox.jsx +60 -0
- package/src/views/custom-components/CustomConfirmationModal.jsx +118 -0
- package/src/views/custom-components/CustomCountrySelect.jsx +129 -0
- package/src/views/custom-components/CustomDatePicker.jsx +122 -0
- package/src/views/custom-components/CustomDropdown.jsx +191 -0
- package/src/views/custom-components/CustomFileUpload.jsx +387 -0
- package/src/views/custom-components/CustomFullCalendar.jsx +514 -0
- package/src/views/custom-components/CustomInfiniteScroll.jsx +126 -0
- package/src/views/custom-components/CustomRadioComponent.jsx +65 -0
- package/src/views/custom-components/CustomStatsComponent.jsx +114 -0
- package/src/views/custom-components/CustomSvgUpload.jsx +170 -0
- package/src/views/custom-components/CustomSwitch.jsx +37 -0
- package/src/views/custom-components/CustomTabPanel.jsx +19 -0
- package/src/views/custom-components/CustomTextArea.jsx +62 -0
- package/src/views/custom-components/CustomTextArea.scss +27 -0
- package/src/views/custom-components/CustomTextField.jsx +116 -0
- package/src/views/custom-components/CustomToggleSwitch.jsx +138 -0
- package/src/views/custom-components/CustomTooltip.jsx +51 -0
- package/src/views/custom-components/CustomZoomImage.jsx +134 -0
- package/src/views/custom-components/CustomizedTable/CustomizedTableV2.jsx +1407 -0
- package/src/views/custom-components/CustomizedTable/VirtualizeTableBody.jsx +295 -0
- package/src/views/custom-components/CustomizedTable/helper.jsx +159 -0
- package/src/views/custom-components/CustomizedTable.jsx +532 -0
- package/src/views/custom-components/EditInputField.jsx +174 -0
- package/src/views/custom-components/FieldDescription.jsx +22 -0
- package/src/views/custom-components/FileDisplayComponent.jsx +138 -0
- package/src/views/custom-components/FormItem.jsx +53 -0
- package/src/views/custom-components/GenericChart.jsx +80 -0
- package/src/views/custom-components/InfoBadge.jsx +60 -0
- package/src/views/custom-components/PostgresEditor.jsx +801 -0
- package/src/views/custom-components/ResizableEditAutocompleteField.jsx +249 -0
- package/src/views/custom-components/ResizableEditInputField.jsx +215 -0
- package/src/views/custom-components/ResizeableEditSelectField.jsx +197 -0
- package/src/views/custom-components/SideOverlay.jsx +113 -0
- package/src/views/custom-components/SideOverlay.scss +42 -0
- package/src/views/custom-components/calendar.scss +571 -0
- package/src/views/feature-components/.gitkeep +0 -0
- package/src/views/feature-components/Dashboard/DashboardUI.jsx +1043 -0
- package/src/views/feature-components/Dashboard/DhnddModal/AshaDataQualityVerificationModal.jsx +278 -0
- package/src/views/feature-components/Dashboard/PinFeatureModal.jsx +143 -0
- package/src/views/feature-components/Dashboard/QuickLinks.jsx +163 -0
- package/src/views/feature-components/Dashboard/Taskbar.jsx +56 -0
- package/src/views/feature-components/Dashboard/WebtasksFilterForm.jsx +109 -0
- package/src/views/feature-components/Dashboard/WidgetCard.jsx +161 -0
- package/src/views/feature-components/Dashboard/actionModal.jsx +263 -0
- package/src/views/feature-components/Dashboard/ekavachModal/HealthWorkerIncorrectDetailsModal.jsx +332 -0
- package/src/views/feature-components/Dashboard/ekavachModal/MoMaternalDeathVerifcationModal.jsx +275 -0
- package/src/views/feature-components/Dashboard/ekavachModal/MoVerficationForChildScreeningMoadal.jsx +566 -0
- package/src/views/feature-components/FeatureUsageAnalytics/FeatureUsageAnalytics.jsx +989 -0
- package/src/views/feature-components/Features/NewServerManagement.jsx +217 -0
- package/src/views/feature-components/Features/ServerManagement.scss +120 -0
- package/src/views/feature-components/ForgotPassword/ForgotPassword.jsx +226 -0
- package/src/views/feature-components/LocationDirective/LocationDirective.jsx +992 -0
- package/src/views/feature-components/LocationDirective/LocationDirectiveV2.jsx +909 -0
- package/src/views/feature-components/NotFound.jsx +66 -0
- package/src/views/feature-components/Onboarding/Onboarding.jsx +1400 -0
- package/src/views/feature-components/Skeletons.js +115 -0
- package/src/views/feature-components/Unauthorized.jsx +48 -0
- package/src/views/feature-components/VerifyRoute.jsx +88 -0
- package/src/views/feature-components/YearlyRecap/YearlyRecap.jsx +357 -0
- package/src/views/feature-components/YearlyRecap/components/RecapSlide.jsx +183 -0
- package/src/views/feature-components/YearlyRecap/languageTranslator/TranslationContext.js +5 -0
- package/src/views/feature-components/YearlyRecap/languageTranslator/TranslationProvider.jsx +26 -0
- package/src/views/feature-components/YearlyRecap/languageTranslator/i18n.js +46 -0
- package/src/views/feature-components/YearlyRecap/languageTranslator/translations.json +167 -0
- package/src/views/feature-components/YearlyRecap/slides/IntroSlide.jsx +233 -0
- package/src/views/feature-components/YearlyRecap/slides/MaternalHealthSlide.jsx +146 -0
- package/src/views/feature-components/YearlyRecap/slides/MetricSlide.jsx +227 -0
- package/src/views/feature-components/YearlyRecap/slides/OutroSlide.jsx +701 -0
- package/src/views/feature-components/YearlyRecap/slides/ReachSlide.jsx +273 -0
- package/src/views/feature-components/login/Login.jsx +840 -0
- package/src/views/feature-components/login/Login.scss +154 -0
- package/src/views/feature-components/login/LoginConfigurator.jsx +1149 -0
- package/src/views/feature-components/login/TwoFactorSetupModal.jsx +411 -0
- package/src/views/feature-components/login/simplifyMenu.js +45 -0
- package/src/views/feature-components/system-config/ManageSystemConfigs.jsx +284 -0
- package/src/views/feature-components/system-config/SystemConfig.jsx +299 -0
- package/src/views/feature-components/users/ChangePasswordModal.jsx +243 -0
- package/src/views/feature-components/users/PasswordField.jsx +56 -0
- package/dist/index.css +0 -1
- package/dist/index.js +0 -32001
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { Box, Container, IconButton, Fab } from '@mui/material';
|
|
3
|
+
import { motion, AnimatePresence } from 'framer-motion';
|
|
4
|
+
import FontAwesomeIcons from '@/common/fontAwesomeIcons/FontAwesomeIcons';
|
|
5
|
+
import html2canvas from 'html2canvas';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
|
|
8
|
+
const RecapSlide = ({
|
|
9
|
+
children,
|
|
10
|
+
onNext,
|
|
11
|
+
onPrev,
|
|
12
|
+
showNext = true,
|
|
13
|
+
showPrev = true,
|
|
14
|
+
isActive,
|
|
15
|
+
bgGradient = 'radial-gradient(circle at 50% 50%, #FFD700 0%, #FF4081 50%, #7C4DFF 100%)',
|
|
16
|
+
}) => {
|
|
17
|
+
const [showControls, setShowControls] = useState(false);
|
|
18
|
+
const slideRef = useRef(null);
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!isActive) return;
|
|
22
|
+
|
|
23
|
+
setShowControls(false);
|
|
24
|
+
const timer = setTimeout(() => {
|
|
25
|
+
setShowControls(true);
|
|
26
|
+
}, 1000);
|
|
27
|
+
|
|
28
|
+
return () => clearTimeout(timer);
|
|
29
|
+
}, [isActive]);
|
|
30
|
+
|
|
31
|
+
const handleDownload = async () => {
|
|
32
|
+
if (slideRef.current) {
|
|
33
|
+
const canvas = await html2canvas(slideRef.current, {
|
|
34
|
+
useCORS: true,
|
|
35
|
+
scale: 2,
|
|
36
|
+
backgroundColor: null,
|
|
37
|
+
});
|
|
38
|
+
const data = canvas.toDataURL('image/png');
|
|
39
|
+
const link = document.createElement('a');
|
|
40
|
+
link.href = data;
|
|
41
|
+
link.download = `techo-recap-${Date.now()}.png`;
|
|
42
|
+
link.click();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Box
|
|
48
|
+
ref={slideRef}
|
|
49
|
+
sx={{
|
|
50
|
+
width: '100vw',
|
|
51
|
+
height: '100vh',
|
|
52
|
+
background: bgGradient,
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
position: 'relative',
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
flexShrink: 0,
|
|
59
|
+
scrollSnapAlign: 'start',
|
|
60
|
+
'&::before': {
|
|
61
|
+
content: '""',
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
top: 0,
|
|
64
|
+
left: 0,
|
|
65
|
+
width: '100%',
|
|
66
|
+
height: '100%',
|
|
67
|
+
backgroundImage:
|
|
68
|
+
"url(\"data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E\")",
|
|
69
|
+
pointerEvents: 'none',
|
|
70
|
+
zIndex: 0,
|
|
71
|
+
},
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
<Container
|
|
75
|
+
maxWidth="sm"
|
|
76
|
+
sx={{
|
|
77
|
+
height: '100%',
|
|
78
|
+
display: 'flex',
|
|
79
|
+
flexDirection: 'column',
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
position: 'relative',
|
|
83
|
+
zIndex: 2,
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
{children}
|
|
87
|
+
</Container>
|
|
88
|
+
|
|
89
|
+
<AnimatePresence>
|
|
90
|
+
{showControls && (
|
|
91
|
+
<>
|
|
92
|
+
{/* Download Button */}
|
|
93
|
+
{showNext && (
|
|
94
|
+
<Fab
|
|
95
|
+
size="small"
|
|
96
|
+
onClick={handleDownload}
|
|
97
|
+
component={motion.button}
|
|
98
|
+
initial={{ opacity: 0, scale: 0 }}
|
|
99
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
100
|
+
exit={{ opacity: 0, scale: 0 }}
|
|
101
|
+
sx={{
|
|
102
|
+
position: 'absolute',
|
|
103
|
+
top: 20,
|
|
104
|
+
right: 20,
|
|
105
|
+
// bgcolor: 'rgba(255,255,255,0.8)',
|
|
106
|
+
color: 'rgba(5, 3, 3, 0.6)',
|
|
107
|
+
// '&:hover': { bgcolor: '#fff' },
|
|
108
|
+
zIndex: 10,
|
|
109
|
+
// boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
<FontAwesomeIcons iconName="faDownload" />
|
|
113
|
+
</Fab>
|
|
114
|
+
)}
|
|
115
|
+
|
|
116
|
+
{/* Navigation Buttons */}
|
|
117
|
+
{showPrev && onPrev && (
|
|
118
|
+
<IconButton
|
|
119
|
+
onClick={onPrev}
|
|
120
|
+
component={motion.button}
|
|
121
|
+
initial={{ x: -50, opacity: 0 }}
|
|
122
|
+
animate={{ x: 0, opacity: 1 }}
|
|
123
|
+
exit={{ x: -50, opacity: 0 }}
|
|
124
|
+
whileHover={{ scale: 1.1 }}
|
|
125
|
+
whileTap={{ scale: 0.9 }}
|
|
126
|
+
sx={{
|
|
127
|
+
position: 'absolute',
|
|
128
|
+
left: 20,
|
|
129
|
+
top: '50%',
|
|
130
|
+
transform: 'translateY(-50%)',
|
|
131
|
+
// bgcolor: 'rgba(255,255,255,0.6)',
|
|
132
|
+
color: 'rgba(5, 3, 3, 0.6)',
|
|
133
|
+
// '&:hover': { bgcolor: 'rgba(255,255,255,0.9)' },
|
|
134
|
+
zIndex: 10,
|
|
135
|
+
// boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
138
|
+
<FontAwesomeIcons iconName="faChevronLeft" />
|
|
139
|
+
</IconButton>
|
|
140
|
+
)}
|
|
141
|
+
|
|
142
|
+
{showNext && onNext && (
|
|
143
|
+
<IconButton
|
|
144
|
+
onClick={onNext}
|
|
145
|
+
component={motion.button}
|
|
146
|
+
initial={{ x: 50, opacity: 0 }}
|
|
147
|
+
animate={{ x: 0, opacity: 1 }}
|
|
148
|
+
exit={{ x: 50, opacity: 0 }}
|
|
149
|
+
whileHover={{ scale: 1.1 }}
|
|
150
|
+
whileTap={{ scale: 0.9 }}
|
|
151
|
+
sx={{
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
right: 20,
|
|
154
|
+
top: '50%',
|
|
155
|
+
transform: 'translateY(-50%)',
|
|
156
|
+
// bgcolor: 'rgba(255,255,255,0.6)',
|
|
157
|
+
color: 'rgba(5, 3, 3, 0.6)',
|
|
158
|
+
// '&:hover': { bgcolor: 'rgba(255,255,255,0.9)' },
|
|
159
|
+
zIndex: 10,
|
|
160
|
+
// boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
<FontAwesomeIcons iconName="faChevronRight" />
|
|
164
|
+
</IconButton>
|
|
165
|
+
)}
|
|
166
|
+
</>
|
|
167
|
+
)}
|
|
168
|
+
</AnimatePresence>
|
|
169
|
+
</Box>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
RecapSlide.propTypes = {
|
|
174
|
+
children: PropTypes.node,
|
|
175
|
+
onNext: PropTypes.func,
|
|
176
|
+
onPrev: PropTypes.func,
|
|
177
|
+
showNext: PropTypes.bool,
|
|
178
|
+
showPrev: PropTypes.bool,
|
|
179
|
+
isActive: PropTypes.bool,
|
|
180
|
+
bgGradient: PropTypes.string,
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export default RecapSlide;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { TranslationContext } from './TranslationContext';
|
|
5
|
+
|
|
6
|
+
const TranslationProvider = ({ children }) => {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
|
|
9
|
+
const translate = (value, options = {}) => {
|
|
10
|
+
if (!value) return value;
|
|
11
|
+
// Remove interpolation placeholders and spaces to create a clean key
|
|
12
|
+
const key = value.replace(/\{\{.*?\}\}/g, '').replace(/\s+/g, '');
|
|
13
|
+
const translatedValue = t(key, options);
|
|
14
|
+
return translatedValue !== key ? translatedValue : value;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const contextValue = React.useMemo(() => ({ translate }), [translate]);
|
|
18
|
+
|
|
19
|
+
return <TranslationContext.Provider value={contextValue}>{children}</TranslationContext.Provider>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
TranslationProvider.propTypes = {
|
|
23
|
+
children: PropTypes.node,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default TranslationProvider;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// i18n.js
|
|
2
|
+
import i18n from 'i18next';
|
|
3
|
+
import { initReactI18next } from 'react-i18next';
|
|
4
|
+
import localTranslations from './translations.json';
|
|
5
|
+
|
|
6
|
+
export const initializeI18n = (translations, preferredLanguage) => {
|
|
7
|
+
const resources = {
|
|
8
|
+
en: {
|
|
9
|
+
translation: {
|
|
10
|
+
...(Object.values(translations['en'] || {})?.reduce((acc, obj) => ({ ...acc, ...obj }), {}) || {}),
|
|
11
|
+
...localTranslations.en,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
gu: {
|
|
15
|
+
translation: {
|
|
16
|
+
...(Object.values(translations['gu'] || {})?.reduce((acc, obj) => ({ ...acc, ...obj }), {}) || {}),
|
|
17
|
+
...localTranslations.gu,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
hi: {
|
|
21
|
+
translation: {
|
|
22
|
+
...(Object.values(translations['hi'] || {})?.reduce((acc, obj) => ({ ...acc, ...obj }), {}) || {}),
|
|
23
|
+
...localTranslations.hi,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
pa: {
|
|
27
|
+
translation: {
|
|
28
|
+
...(Object.values(translations['pa'] || {})?.reduce((acc, obj) => ({ ...acc, ...obj }), {}) || {}),
|
|
29
|
+
...localTranslations.pa,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
i18n
|
|
35
|
+
.use(initReactI18next) // Passes i18n instance to react-i18next
|
|
36
|
+
.init({
|
|
37
|
+
resources,
|
|
38
|
+
lng: preferredLanguage || 'en', // Default language
|
|
39
|
+
fallbackLng: 'en',
|
|
40
|
+
interpolation: {
|
|
41
|
+
escapeValue: false, // React already escapes strings
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return i18n;
|
|
46
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"Welcome": "Welcome",
|
|
4
|
+
"Oneyear.": "One year.",
|
|
5
|
+
"Manyhomes.": "Many homes.",
|
|
6
|
+
"Yourcarereachedeveryone.": "Your care reached everyone.",
|
|
7
|
+
"Thankyouforyourserviceanddedication.": "Thank you for your service and dedication.",
|
|
8
|
+
"Abigyear,youstoodwith": "A big year, you stood with",
|
|
9
|
+
"families": "families",
|
|
10
|
+
"Youreffortstouchedthelivesof": "Your efforts touched the lives of",
|
|
11
|
+
"people": "people",
|
|
12
|
+
"Becauseofyou,": "Because of you,",
|
|
13
|
+
"childrenarehealthiertoday": "children are healthier today",
|
|
14
|
+
"EnsuringSafeMotherhood": "Ensuring Safe Motherhood",
|
|
15
|
+
"PregnanciesRegistered": "Pregnancies Registered",
|
|
16
|
+
"High-RiskPregnanciesManaged": "High-Risk Pregnancies Managed",
|
|
17
|
+
"LiveBirthsGiven": "Live Births Given",
|
|
18
|
+
"Youguidedmothersthrougheverystep—ensuringcare,safety,andlife🤍": "You guided mothers through every step — ensuring care, safety, and life 🤍",
|
|
19
|
+
"AntenatalCare": "Antenatal Care",
|
|
20
|
+
"ANCVisitsCompleted": "ANC Visits Completed",
|
|
21
|
+
"ImmunisationServices": "Immunisation Services",
|
|
22
|
+
"VaccinationsProvided": "Vaccinations Provided",
|
|
23
|
+
"PostnatalCare": "Postnatal Care",
|
|
24
|
+
"PostnatalHomeVisitsCompleted": "Postnatal Home Visits Completed",
|
|
25
|
+
"ChildHealth": "Child Health",
|
|
26
|
+
"ChildServiceProvided": "Child Service Provided",
|
|
27
|
+
"NPCB": "NPCB",
|
|
28
|
+
"NPCBScreenings": "NPCB Screenings",
|
|
29
|
+
"NPCBScreeningsDone": "NPCB Screenings Done",
|
|
30
|
+
"percentile_ranking": "You’re in the top {{percentile}}% of workers",
|
|
31
|
+
"You’reinthetop%ofworkers": "You’re in the top {{percentile}}% of workers",
|
|
32
|
+
"HappyNewYear!🎉": "Happy New Year! 🎉",
|
|
33
|
+
"Thankyouforeverythingyoudidthisyear.": "Thank you for everything you did this year.",
|
|
34
|
+
"Share": "Share",
|
|
35
|
+
"Download": "Download",
|
|
36
|
+
"SharetoWhatsApp": "Share to WhatsApp",
|
|
37
|
+
"Processing...": "Processing...",
|
|
38
|
+
"My2025Recap": "My 2025 Recap",
|
|
39
|
+
"Here’sasnapshotoftheworkIdidthisyear.": "Here’s a snapshot of the work I did this year.",
|
|
40
|
+
"Everycontributionmatters": "Every contribution matters",
|
|
41
|
+
"Yourpresencesupportedthehealthcaresystemthisyear.": "Your presence supported the healthcare system this year.",
|
|
42
|
+
"Yourfocusonmadearealdifference": "Your focus on {{label}} made a real difference",
|
|
43
|
+
"Consistenteffortbuildsstrongoutcomes.": "Consistent effort builds strong outcomes.",
|
|
44
|
+
"Youmadeanimpactacrossmultipleservices": "You made an impact across multiple services",
|
|
45
|
+
"Balancedeffortslikeyoursstrengthencommunityhealth.": "Balanced efforts like yours strengthen community health.",
|
|
46
|
+
"Yousupportedcarebeyondwhat’sshownhere": "You supported care beyond what’s shown here",
|
|
47
|
+
"Everyvisit,follow-up,andrecordcounted.": "Every visit, follow-up, and record counted.",
|
|
48
|
+
"Thankyouforbeingpartofthesystem": "Thank you for being part of the system",
|
|
49
|
+
"Yourroleenablescaredelivery.": "Your role enables care delivery.",
|
|
50
|
+
"CBAC": "CBAC",
|
|
51
|
+
"CBACFormsFilled": "CBAC Forms Filled",
|
|
52
|
+
"NCD": "NCD",
|
|
53
|
+
"NCDScreeningsDone": "NCD Screenings Done",
|
|
54
|
+
"ABHA": "ABHA",
|
|
55
|
+
"ABHAIncentivesGiven": "ABHA Incentives Given"
|
|
56
|
+
},
|
|
57
|
+
"hi": {
|
|
58
|
+
"Welcome": "नमस्ते",
|
|
59
|
+
"Oneyear.": "एक साल।",
|
|
60
|
+
"Manyhomes.": "कई घर।",
|
|
61
|
+
"Yourcarereachedeveryone.": "आपकी देखभाल सब तक पहुँची।",
|
|
62
|
+
"Thankyouforyourserviceanddedication.": "आपकी सेवा और समर्पण के लिए धन्यवाद।",
|
|
63
|
+
"Abigyear,youstoodwith": "एक बड़ा साल, आप साथ खड़े रहे",
|
|
64
|
+
"families": "परिवारों के",
|
|
65
|
+
"Youreffortstouchedthelivesof": "आपके प्रयासों ने जीवन को छुआ",
|
|
66
|
+
"people": "लोगों के",
|
|
67
|
+
"Becauseofyou,": "आपकी वजह से,",
|
|
68
|
+
"childrenarehealthiertoday": "बच्चे आज स्वस्थ हैं",
|
|
69
|
+
"EnsuringSafeMotherhood": "सुरक्षित मातृत्व सुनिश्चित करना",
|
|
70
|
+
"PregnanciesRegistered": "पंजीकृत गर्भधारण",
|
|
71
|
+
"High-RiskPregnanciesManaged": "प्रबंधित उच्च जोखिम वाले गर्भधारण",
|
|
72
|
+
"LiveBirthsGiven": "दिए गए जीवित जन्म",
|
|
73
|
+
"Youguidedmothersthrougheverystep—ensuringcare,safety,andlife🤍": "आपने हर कदम पर माताओं का मार्गदर्शन किया - देखभाल, सुरक्षा और जीवन सुनिश्चित करना 🤍",
|
|
74
|
+
"AntenatalCare": "प्रसवपूर्व देखभाल",
|
|
75
|
+
"ANCVisitsCompleted": "ANC विज़िट पूरी हुईं",
|
|
76
|
+
"ImmunisationServices": "टीकाकरण सेवाएँ",
|
|
77
|
+
"VaccinationsProvided": "प्रदान किए गए टीकाकरण",
|
|
78
|
+
"PostnatalCare": "प्रसवोत्तर देखभाल",
|
|
79
|
+
"PostnatalHomeVisitsCompleted": "प्रसवोत्तर गृह विज़िट पूरी हुईं",
|
|
80
|
+
"ChildHealth": "बाल स्वास्थ्य",
|
|
81
|
+
"ChildServiceProvided": "प्रदान की गई बाल सेवा",
|
|
82
|
+
"NPCB": "एनपीसीबी",
|
|
83
|
+
"NPCBScreenings": "NPCB स्क्रीनिंग",
|
|
84
|
+
"NPCBScreeningsDone": "NPCB स्क्रीनिंग पूरी हुई",
|
|
85
|
+
"percentile_ranking": "आप शीर्ष {{percentile}}% कार्यकर्ताओं में से हैं",
|
|
86
|
+
"You’reinthetop%ofworkers": "आप शीर्ष {{percentile}}% कार्यकर्ताओं में से हैं",
|
|
87
|
+
"HappyNewYear!🎉": "नया साल मुबारक हो! 🎉",
|
|
88
|
+
"Thankyouforeverythingyoudidthisyear.": "इस साल आपने जो कुछ भी किया उसके लिए धन्यवाद।",
|
|
89
|
+
"Share": "साझा करें",
|
|
90
|
+
"Download": "डाउनलोड करें",
|
|
91
|
+
"SharetoWhatsApp": "व्हाट्सएप पर साझा करें",
|
|
92
|
+
"Processing...": "प्रक्रिया जारी है...",
|
|
93
|
+
"My2025Recap": "मेरा 2025 रिकैप",
|
|
94
|
+
"Here’sasnapshotoftheworkIdidthisyear.": "यहाँ इस वर्ष मेरे द्वारा किए गए कार्यों का एक स्नैपशॉट है।",
|
|
95
|
+
"Everycontributionmatters": "हर योगदान मायने रखता है",
|
|
96
|
+
"Yourpresencesupportedthehealthcaresystemthisyear.": "आपकी उपस्थिति ने इस वर्ष स्वास्थ्य सेवा प्रणाली का समर्थन किया।",
|
|
97
|
+
"Yourfocusonmadearealdifference": "{{label}} पर आपके ध्यान ने वास्तव में बदलाव लाया",
|
|
98
|
+
"Consistenteffortbuildsstrongoutcomes.": "निरंतर प्रयास मजबूत परिणाम देते हैं।",
|
|
99
|
+
"Youmadeanimpactacrossmultipleservices": "आपने कई सेवाओं में प्रभाव डाला",
|
|
100
|
+
"Balancedeffortslikeyoursstrengthencommunityhealth.": "आप जैसे संतुलित प्रयास सामुदायिक स्वास्थ्य को मजबूत करते हैं।",
|
|
101
|
+
"Yousupportedcarebeyondwhat’sshownhere": "आपने यहाँ दिखाए गए कार्यों से परे देखभाल का समर्थन किया",
|
|
102
|
+
"Everyvisit,follow-up,andrecordcounted.": "हर विज़िट, फॉलो-अप और रिकॉर्ड मायने रखता है।",
|
|
103
|
+
"Thankyouforbeingpartofthesystem": "प्रणाली का हिस्सा बनने के लिए धन्यवाद",
|
|
104
|
+
"Yourroleenablescaredelivery.": "आपकी भूमिका देखभाल वितरण को सक्षम बनाती है।",
|
|
105
|
+
"CBAC": "सीबीएसी",
|
|
106
|
+
"CBACFormsFilled": "सीबीएसी फॉर्म भरे गए",
|
|
107
|
+
"NCD": "एनसीडी",
|
|
108
|
+
"NCDScreeningsDone": "एनसीडी स्क्रीनिंग पूरी हुई",
|
|
109
|
+
"ABHA": "आभा",
|
|
110
|
+
"ABHAIncentivesGiven": "आभा प्रोत्साहन दिया गया"
|
|
111
|
+
},
|
|
112
|
+
"gu": {
|
|
113
|
+
"Welcome": "સ્વાગત છે",
|
|
114
|
+
"Oneyear.": "એક વર્ષ.",
|
|
115
|
+
"Manyhomes.": "અનેક ઘર.",
|
|
116
|
+
"Yourcarereachedeveryone.": "તમારી સંભાળ બધાં સુધી પહોંચી.",
|
|
117
|
+
"Thankyouforyourserviceanddedication.": "તમારી સેવા અને સમર્પણ બદલ આભાર.",
|
|
118
|
+
"Abigyear,youstoodwith": "એક મોટું વર્ષ, તમે સાથે રહ્યા",
|
|
119
|
+
"families": "પરિવારોની",
|
|
120
|
+
"Youreffortstouchedthelivesof": "તમારા પ્રયત્નોએ જીવનને સ્પર્શ્યું",
|
|
121
|
+
"people": "લોકોના",
|
|
122
|
+
"Becauseofyou,": "તમારા કારણે,",
|
|
123
|
+
"childrenarehealthiertoday": "બાળકો આજે સ્વસ્થ છે",
|
|
124
|
+
"EnsuringSafeMotherhood": "સુરક્ષિત માતૃત્વ સુનિશ્ચિત કરવું",
|
|
125
|
+
"PregnanciesRegistered": "નોંધાયેલ સગર્ભાવસ્થા",
|
|
126
|
+
"High-RiskPregnanciesManaged": "સંચાલિત ઉચ્ચ જોખમ ધરાવતી સગર્ભાવસ્થા",
|
|
127
|
+
"LiveBirthsGiven": "આપેલ જીવંત જન્મ",
|
|
128
|
+
"Youguidedmothersthrougheverystep—ensuringcare,safety,andlife🤍": "તમે દરેક પગલે માતાઓને માર્ગદર્શન આપ્યું - સંભાળ, સુરક્ષા અને જીવન સુનિશ્ચિત કર્યું 🤍",
|
|
129
|
+
"AntenatalCare": "પ્રસૂતિ પૂર્વેની સંભાળ",
|
|
130
|
+
"ANCVisitsCompleted": "ANC મુલાકાતો પૂર્ણ થઈ",
|
|
131
|
+
"ImmunisationServices": "રસીકરણ સેવાઓ",
|
|
132
|
+
"VaccinationsProvided": "આપેલ રસીકરણ",
|
|
133
|
+
"PostnatalCare": "પ્રસૂતિ પછીની સંભાળ",
|
|
134
|
+
"PostnatalHomeVisitsCompleted": "પ્રસૂતિ પછીની હોમ વિઝિટ પૂર્ણ થઈ",
|
|
135
|
+
"ChildHealth": "બાળ આરોગ્ય",
|
|
136
|
+
"ChildServiceProvided": "આપેલ બાળ સેવા",
|
|
137
|
+
"NPCB": "એનપીસીબી",
|
|
138
|
+
"NPCBScreenings": "NPCB સ્ક્રિનિંગ",
|
|
139
|
+
"NPCBScreeningsDone": "NPCB સ્ક્રિનિંગ પૂર્ણ થયું",
|
|
140
|
+
"percentile_ranking": "તમે ટોચના {{percentile}}% કાર્યકરોમાં છો",
|
|
141
|
+
"You’reinthetop%ofworkers": "તમે ટોચના {{percentile}}% કાર્યકરોમાં છો",
|
|
142
|
+
"HappyNewYear!🎉": "નવું વર્ષ મુબારક! 🎉",
|
|
143
|
+
"Thankyouforeverythingyoudidthisyear.": "તમે આ વર્ષે જે કંઈ કર્યું તે બદલ આભાર.",
|
|
144
|
+
"Share": "શેર કરો",
|
|
145
|
+
"Download": "ડાઉનલોડ કરો",
|
|
146
|
+
"SharetoWhatsApp": "વોટ્સએપ પર શેર કરો",
|
|
147
|
+
"Processing...": "પ્રક્રિયા ચાલુ છે...",
|
|
148
|
+
"My2025Recap": "મારું 2025 રિકેપ",
|
|
149
|
+
"Here’sasnapshotoftheworkIdidthisyear.": "મેં આ વર્ષે કરેલા કામનો સ્નેપશોટ અહીં છે.",
|
|
150
|
+
"Everycontributionmatters": "દરેક યોગદાન મહત્વનું છે",
|
|
151
|
+
"Yourpresencesupportedthehealthcaresystemthisyear.": "તમારી હાજરીએ આ વર્ષે આરોગ્ય સંભાળ પ્રણાલીને ટેકો આપ્યો.",
|
|
152
|
+
"Yourfocusonmadearealdifference": "{{label}} પર તમારા ધ્યાને ખરેખર ફરક પાડ્યો છે",
|
|
153
|
+
"Consistenteffortbuildsstrongoutcomes.": "સતત પ્રયત્નો મજબૂત પરિણામો લાવે છે.",
|
|
154
|
+
"Youmadeanimpactacrossmultipleservices": "તમે બહુવિધ સેવાઓમાં પ્રભાવ પાડ્યો છે",
|
|
155
|
+
"Balancedeffortslikeyoursstrengthencommunityhealth.": "તમારા જેવા સંતુલિત પ્રયત્નો સામુદાયિક સ્વાસ્થ્યને મજબૂત બનાવે છે.",
|
|
156
|
+
"Yousupportedcarebeyondwhat’sshownhere": "તમે અહીં બતાવેલ સંભાળથી આગળ વધીને ટેકો આપ્યો",
|
|
157
|
+
"Everyvisit,follow-up,andrecordcounted.": "દરેક મુલાકાત, ફોલો-અપ અને રેકોર્ડ ગણાય છે.",
|
|
158
|
+
"Thankyouforbeingpartofthesystem": "સિસ્ટમનો ભાગ બનવા બદલ આભાર",
|
|
159
|
+
"Yourroleenablescaredelivery.": "તમારી ભૂમિકા સંભાળ વિતરણને સક્ષમ કરે છે.",
|
|
160
|
+
"CBAC": "સીબીએસી",
|
|
161
|
+
"CBACFormsFilled": "સીબીએસી ફોર્મ ભર્યા",
|
|
162
|
+
"NCD": "એનસીડી",
|
|
163
|
+
"NCDScreeningsDone": "એનસીડી સ્ક્રિનિંગ પૂર્ણ થયું",
|
|
164
|
+
"ABHA": "આભા",
|
|
165
|
+
"ABHAIncentivesGiven": "આભા પ્રોત્સાહનો આપવામાં આવ્યા"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Typography, Box } from '@mui/material';
|
|
3
|
+
import { motion, AnimatePresence, useAnimation } from 'framer-motion';
|
|
4
|
+
import RecapSlide from '../components/RecapSlide';
|
|
5
|
+
import { useTranslateProvider } from '@/common/languageTranslator/TranslationContext';
|
|
6
|
+
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
|
|
9
|
+
const IntroSlide = ({ data, onNext, isActive }) => {
|
|
10
|
+
const titleControls = useAnimation();
|
|
11
|
+
const circle1Controls = useAnimation();
|
|
12
|
+
const circle2Controls = useAnimation();
|
|
13
|
+
const text1Controls = useAnimation();
|
|
14
|
+
const text2Controls = useAnimation();
|
|
15
|
+
const waveControls = useAnimation();
|
|
16
|
+
const { translate } = useTranslateProvider();
|
|
17
|
+
|
|
18
|
+
const gratitudeLines = [translate('One year.'), translate('Many homes.'), translate('Your care reached everyone.')];
|
|
19
|
+
const gratitudeText2 = translate('Thank you for your service and dedication.');
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!isActive) return;
|
|
23
|
+
|
|
24
|
+
(async () => {
|
|
25
|
+
// Welcome (UNCHANGED)
|
|
26
|
+
await titleControls.start('visible');
|
|
27
|
+
await new Promise((r) => setTimeout(r, 700));
|
|
28
|
+
await titleControls.start('pop');
|
|
29
|
+
|
|
30
|
+
// Circle 1 + Text 1
|
|
31
|
+
await circle1Controls.start('enter');
|
|
32
|
+
await text1Controls.start('center');
|
|
33
|
+
|
|
34
|
+
await new Promise((r) => setTimeout(r, 1000));
|
|
35
|
+
|
|
36
|
+
// Circle 2 + Text 2
|
|
37
|
+
await circle2Controls.start('enter');
|
|
38
|
+
await text2Controls.start('center');
|
|
39
|
+
|
|
40
|
+
await new Promise((r) => setTimeout(r, 600));
|
|
41
|
+
await waveControls.start('visible');
|
|
42
|
+
})();
|
|
43
|
+
}, [isActive, titleControls, circle1Controls, circle2Controls, text1Controls, text2Controls]);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<RecapSlide onNext={onNext} bgGradient="linear-gradient(to top, #fff1eb 0%, #ace0f9 100%)" isActive={isActive}>
|
|
47
|
+
<Box
|
|
48
|
+
sx={{
|
|
49
|
+
position: 'relative',
|
|
50
|
+
height: '100%',
|
|
51
|
+
overflow: 'hidden',
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
justifyContent: 'center',
|
|
55
|
+
textAlign: 'center',
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<AnimatePresence mode="wait">
|
|
59
|
+
{isActive && (
|
|
60
|
+
<>
|
|
61
|
+
{/* WELCOME */}
|
|
62
|
+
<Typography
|
|
63
|
+
component={motion.h1}
|
|
64
|
+
variants={{
|
|
65
|
+
hidden: { opacity: 0, scale: 0.6 },
|
|
66
|
+
visible: {
|
|
67
|
+
opacity: 1,
|
|
68
|
+
scale: 1,
|
|
69
|
+
transition: { duration: 1.2, ease: 'easeOut' },
|
|
70
|
+
},
|
|
71
|
+
pop: {
|
|
72
|
+
scale: 2.4,
|
|
73
|
+
opacity: 0,
|
|
74
|
+
transition: { duration: 0.6, ease: 'easeIn' },
|
|
75
|
+
},
|
|
76
|
+
}}
|
|
77
|
+
initial="hidden"
|
|
78
|
+
animate={titleControls}
|
|
79
|
+
variant="h2"
|
|
80
|
+
sx={{
|
|
81
|
+
fontWeight: 900,
|
|
82
|
+
fontSize: { xs: '2.5rem', sm: '3.75rem' },
|
|
83
|
+
background: 'linear-gradient(to top, #0c3483 0%, #a2b6df 100%)',
|
|
84
|
+
WebkitBackgroundClip: 'text',
|
|
85
|
+
WebkitTextFillColor: 'transparent',
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
zIndex: 6,
|
|
88
|
+
px: 2,
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
{translate('Welcome')}, {data.name}!
|
|
92
|
+
</Typography>
|
|
93
|
+
|
|
94
|
+
{/* CIRCLE 1*/}
|
|
95
|
+
<motion.div
|
|
96
|
+
initial={{ scale: 0 }}
|
|
97
|
+
animate={circle1Controls}
|
|
98
|
+
variants={{
|
|
99
|
+
enter: {
|
|
100
|
+
scale: 4,
|
|
101
|
+
transition: { duration: 1.4, ease: 'easeOut' },
|
|
102
|
+
},
|
|
103
|
+
}}
|
|
104
|
+
style={{
|
|
105
|
+
position: 'absolute',
|
|
106
|
+
width: '55%',
|
|
107
|
+
height: '27%',
|
|
108
|
+
borderRadius: '50%',
|
|
109
|
+
top: '-20%',
|
|
110
|
+
left: '-20%',
|
|
111
|
+
background: '#CFE9FF',
|
|
112
|
+
zIndex: 3,
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
{/* TEXT 1 (INSIDE CIRCLE 1) */}
|
|
117
|
+
<Typography
|
|
118
|
+
component={motion.div}
|
|
119
|
+
initial={{ opacity: 0, scale: 0.95 }}
|
|
120
|
+
animate={text1Controls}
|
|
121
|
+
variants={{
|
|
122
|
+
center: {
|
|
123
|
+
opacity: 1,
|
|
124
|
+
scale: 1,
|
|
125
|
+
transition: { duration: 0.9 },
|
|
126
|
+
},
|
|
127
|
+
}}
|
|
128
|
+
sx={{
|
|
129
|
+
position: 'relative',
|
|
130
|
+
zIndex: 4,
|
|
131
|
+
fontFamily: '"Poppins", sans-serif',
|
|
132
|
+
fontSize: { xs: '1.4rem', sm: '1.8rem' },
|
|
133
|
+
fontWeight: 700,
|
|
134
|
+
color: '#7c625aff',
|
|
135
|
+
maxWidth: { xs: 240, sm: 280 },
|
|
136
|
+
lineHeight: 1.4,
|
|
137
|
+
letterSpacing: '0.3px',
|
|
138
|
+
top: { xs: '-25%', sm: '-30%' },
|
|
139
|
+
left: { xs: '10%', sm: '20%' },
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
{gratitudeLines.map((line, index) => (
|
|
143
|
+
<motion.div
|
|
144
|
+
key={index}
|
|
145
|
+
initial={{ opacity: 0 }}
|
|
146
|
+
animate={text1Controls}
|
|
147
|
+
variants={{
|
|
148
|
+
center: {
|
|
149
|
+
opacity: 1,
|
|
150
|
+
transition: {
|
|
151
|
+
delay: index * 0.6,
|
|
152
|
+
duration: 0.8,
|
|
153
|
+
ease: 'easeIn',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
corner: {
|
|
157
|
+
opacity: 0.8,
|
|
158
|
+
transition: { duration: 0.8 },
|
|
159
|
+
},
|
|
160
|
+
}}
|
|
161
|
+
style={{
|
|
162
|
+
marginBottom: 6,
|
|
163
|
+
}}
|
|
164
|
+
>
|
|
165
|
+
{line}
|
|
166
|
+
</motion.div>
|
|
167
|
+
))}
|
|
168
|
+
</Typography>
|
|
169
|
+
|
|
170
|
+
{/* CIRCLE 2 */}
|
|
171
|
+
<motion.div
|
|
172
|
+
initial={{ scale: 0 }}
|
|
173
|
+
animate={circle2Controls}
|
|
174
|
+
variants={{
|
|
175
|
+
enter: {
|
|
176
|
+
scale: 4,
|
|
177
|
+
transition: { duration: 1.2, ease: 'easeOut' },
|
|
178
|
+
},
|
|
179
|
+
}}
|
|
180
|
+
style={{
|
|
181
|
+
position: 'absolute',
|
|
182
|
+
width: '55%',
|
|
183
|
+
height: '27%',
|
|
184
|
+
borderRadius: '50%',
|
|
185
|
+
bottom: '-15%',
|
|
186
|
+
right: '-15%',
|
|
187
|
+
background: '#FFD6C9',
|
|
188
|
+
zIndex: 2,
|
|
189
|
+
}}
|
|
190
|
+
/>
|
|
191
|
+
|
|
192
|
+
{/* TEXT 2 (INSIDE CIRCLE 2) */}
|
|
193
|
+
<Typography
|
|
194
|
+
component={motion.div}
|
|
195
|
+
initial={{ opacity: 0, scale: 0.95 }}
|
|
196
|
+
animate={text2Controls}
|
|
197
|
+
variants={{
|
|
198
|
+
center: {
|
|
199
|
+
opacity: 1,
|
|
200
|
+
scale: 1,
|
|
201
|
+
transition: { duration: 1.2 },
|
|
202
|
+
},
|
|
203
|
+
}}
|
|
204
|
+
sx={{
|
|
205
|
+
position: 'relative',
|
|
206
|
+
zIndex: 5,
|
|
207
|
+
fontFamily: '"Poppins", sans-serif',
|
|
208
|
+
fontSize: { xs: '1.2rem', sm: '1.5rem' },
|
|
209
|
+
fontWeight: 600,
|
|
210
|
+
color: '#213e58ff',
|
|
211
|
+
maxWidth: { xs: 220, sm: 260 },
|
|
212
|
+
mt: 2,
|
|
213
|
+
top: '30%',
|
|
214
|
+
right: '20%',
|
|
215
|
+
}}
|
|
216
|
+
>
|
|
217
|
+
{gratitudeText2}
|
|
218
|
+
</Typography>
|
|
219
|
+
</>
|
|
220
|
+
)}
|
|
221
|
+
</AnimatePresence>
|
|
222
|
+
</Box>
|
|
223
|
+
</RecapSlide>
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
IntroSlide.propTypes = {
|
|
228
|
+
data: PropTypes.any,
|
|
229
|
+
onNext: PropTypes.func,
|
|
230
|
+
isActive: PropTypes.bool,
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export default IntroSlide;
|