Skip to content

Commit 3989b2a

Browse files
authored
Merge pull request #2430 from tekdi/release-1.13.0-prod-register
Release 1.13.0 prod register to admin qa
2 parents e123f8b + 8b1de38 commit 3989b2a

File tree

22 files changed

+1203
-525
lines changed

22 files changed

+1203
-525
lines changed

apps/learner-web-app/src/app/landing/page.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use client';
22

33
import { Box, Button, Card, CardContent, Container, Grid, Typography } from '@mui/material';
4-
import Image from 'next/image';
54
import { useRouter } from 'next/navigation';
65
import { useEffect, useState } from 'react';
76
import Header from '@learner/components/Header/Header';
87
import { getTenantInfo, getPrathamTenantId } from '@learner/utils/API/ProgramService';
98
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
109
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
10+
import { useTranslation } from '@shared-lib';
1111
import 'swiper/css';
1212
import 'swiper/css/autoplay';
1313
import 'swiper/css/navigation';
@@ -38,6 +38,7 @@ interface Program {
3838

3939
export default function LandingPage() {
4040
const router = useRouter();
41+
const { t } = useTranslation();
4142
const [programs, setPrograms] = useState<Program[]>([]);
4243
const [loading, setLoading] = useState(true);
4344

@@ -121,8 +122,7 @@ export default function LandingPage() {
121122
}
122123
};
123124

124-
const aboutPrathamText =
125-
'Pratham Education Foundation (Pratham) is one of the largest education NGOs in India with a record of innovative, rigorously evaluated programs that have inspired similar programs across three continents. With a history spanning 30 years, Pratham\'s work today extends from programs for early and elementary years to girls and women, and youth skilling.\n\nThrough programs covering 25 states and Union Territories, in an average year, Pratham usually reaches over 6 million children and youth. This is achieved through a combination of efforts: directly working with children and youth in communities, as well as through collaborations with state and district-level governments. Pratham has received notable awards such as the Lui Che Woo Prize, WISE Prize for Innovation, Skoll Award for Social Entrepreneurship, the Henry R Kravis Prize in Leadership and the CNN-IBN Indian of the Year for Public Service. Pratham also received the 2021 Yidan Prize for Education Development and the Yashraj Bharati Samman in 2025.';
125+
const aboutPrathamText = t('LANDING.ABOUT_PRATHAM_TEXT');
126126

127127
return (
128128
<>
@@ -183,7 +183,7 @@ export default function LandingPage() {
183183
color: '#fff',
184184
}}
185185
>
186-
Welcome to the Pratham Learning Platform!
186+
{t('LANDING.WELCOME_TO_PRATHAM_LEARNING_PLATFORM')}
187187
</Typography>
188188
<Typography
189189
variant="h5"
@@ -198,7 +198,7 @@ export default function LandingPage() {
198198
color: '#fff',
199199
}}
200200
>
201-
Your Learning Journey Begins here
201+
{t('LANDING.YOUR_LEARNING_JOURNEY_BEGINS_HERE')}
202202
</Typography>
203203
<Button
204204
variant="contained"
@@ -222,7 +222,7 @@ export default function LandingPage() {
222222
},
223223
}}
224224
>
225-
Get Started!
225+
{t('LANDING.GET_STARTED')}
226226
</Button>
227227
<Box sx={{ mt: 1 }}>
228228
<Typography
@@ -232,7 +232,7 @@ export default function LandingPage() {
232232
display: 'inline',
233233
}}
234234
>
235-
Already signed up?{' '}
235+
{t('LANDING.ALREADY_SIGNED_UP')}{' '}
236236
<Typography
237237
component="span"
238238
variant="body2"
@@ -246,9 +246,9 @@ export default function LandingPage() {
246246
}}
247247
onClick={handleLogin}
248248
>
249-
Click here
249+
{t('LANDING.CLICK_HERE')}
250250
</Typography>
251-
{' '}to login
251+
{' '}{t('LANDING.TO_LOGIN')}
252252
</Typography>
253253
</Box>
254254
<Box sx={{ mt: 1 }}>
@@ -259,7 +259,7 @@ export default function LandingPage() {
259259
display: 'inline',
260260
}}
261261
>
262-
Are you a Pratham Employee?{' '}
262+
{t('LANDING.ARE_YOU_PRATHAM_EMPLOYEE')}{' '}
263263
<Typography
264264
component="span"
265265
variant="body2"
@@ -273,9 +273,9 @@ export default function LandingPage() {
273273
}}
274274
onClick={handlePragyanpath}
275275
>
276-
Click here
276+
{t('LANDING.CLICK_HERE')}
277277
</Typography>
278-
{' '}to get access to Pragyanpath
278+
{' '}{t('LANDING.TO_GET_ACCESS_TO_PRAGYANPATH')}
279279
</Typography>
280280
</Box>
281281
</Box>
@@ -324,7 +324,7 @@ export default function LandingPage() {
324324
color: '#1F1B13',
325325
}}
326326
>
327-
About Pratham
327+
{t('LANDING.ABOUT_PRATHAM')}
328328
</Typography>
329329
<Typography
330330
variant="body1"
@@ -364,7 +364,7 @@ export default function LandingPage() {
364364
color: '#FFC107',
365365
}}
366366
>
367-
About Pratham Learning Platform
367+
{t('LANDING.ABOUT_PRATHAM_LEARNING_PLATFORM')}
368368
</Typography>
369369
<Typography
370370
variant="body1"
@@ -397,16 +397,16 @@ export default function LandingPage() {
397397
color: '#1F1B13',
398398
}}
399399
>
400-
Our Programs
400+
{t('LANDING.OUR_PROGRAMS')}
401401
</Typography>
402402

403403
{loading ? (
404404
<Box sx={{ py: 4 }}>
405-
<Typography>Loading programs...</Typography>
405+
<Typography>{t('LANDING.LOADING_PROGRAMS')}</Typography>
406406
</Box>
407407
) : programs.length === 0 ? (
408408
<Box sx={{ py: 4 }}>
409-
<Typography>No programs available at the moment.</Typography>
409+
<Typography>{t('LANDING.NO_PROGRAMS_AVAILABLE')}</Typography>
410410
</Box>
411411
) : (
412412
<Grid container spacing={4}>
@@ -638,7 +638,7 @@ export default function LandingPage() {
638638
},
639639
}}
640640
>
641-
Get Started With Your Learning Journey Now!
641+
{t('LANDING.GET_STARTED_WITH_YOUR_LEARNING_JOURNEY_NOW')}
642642
</Button>
643643
</Container>
644644
</Box>

apps/learner-web-app/src/app/programs/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function ProgramsContent() {
6666

6767
return (
6868
<>
69-
<Header />
69+
<Header isShowLogout={true} />
7070

7171
<Box
7272
display="flex"
@@ -326,8 +326,9 @@ function ProgramsContent() {
326326
}
327327

328328
export default function Index() {
329+
const { t } = useTranslation();
329330
return (
330-
<Suspense fallback={<div>Loading...</div>}>
331+
<Suspense fallback={<div>{t('LEARNER_APP.PROGRAMS.LOADING')}</div>}>
331332
<ProgramsContent />
332333
</Suspense>
333334
);

apps/learner-web-app/src/app/registration/RegisterationFlow.tsx

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import DynamicForm from '@shared-lib-v2/DynamicForm/components/DynamicForm';
2424
import { fetchForm } from '@shared-lib-v2/DynamicForm/components/DynamicFormCallback';
2525
import { FormContext } from '@shared-lib-v2/DynamicForm/components/DynamicFormConstant';
2626
import { useRouter } from 'next/navigation';
27-
import { createUser } from '@shared-lib-v2/DynamicForm/services/CreateUserService';
27+
import { createUser, sendMessage } from '@shared-lib-v2/DynamicForm/services/CreateUserService';
2828
import { RoleId } from '@shared-lib-v2/DynamicForm/utils/app.constant';
2929
import { getUserId, login } from '@learner/utils/API/LoginService';
3030
import SignupSuccess from '@learner/components/SignupSuccess /SignupSuccess ';
@@ -314,9 +314,22 @@ const RegisterationFlow = () => {
314314
localStorage.removeItem('localPayload');
315315
localStorage.removeItem('formData');
316316

317+
//sent username and password
318+
sendMessage({
319+
"sms": {
320+
"to": [updated_payload.mobile],
321+
"body":"Hey",
322+
"templateId": "6948f41681326042a2454bb2",
323+
"replacements": {
324+
"var1": username,
325+
"var2": password
326+
}
327+
}
328+
});
329+
317330
setSignupSuccessModal(true);
318331
} else {
319-
showToastMessage('Username Already Exist', 'error');
332+
showToastMessage(t('LEARNER_APP.REGISTRATION_FLOW.USERNAME_ALREADY_EXIST'), 'error');
320333
}
321334

322335
console.log(responseUserData);
@@ -356,7 +369,7 @@ const RegisterationFlow = () => {
356369
const response = await userCheck(payload);
357370
const users = response?.result || [];
358371
if (users.length > 0 && isEmailCheck) {
359-
showToastMessage('Email already exists', 'error');
372+
showToastMessage(t('LEARNER_APP.REGISTRATION_FLOW.EMAIL_ALREADY_EXISTS'), 'error');
360373
} else if (users.length > 0) {
361374
const usernameList = users.map((user: any) => user.username);
362375

@@ -421,10 +434,10 @@ const RegisterationFlow = () => {
421434

422435
// router.push('/reset-Password');
423436
} else {
424-
showToastMessage('Please enter valid otp', 'error');
437+
showToastMessage(t('LEARNER_APP.REGISTRATION_FLOW.PLEASE_ENTER_VALID_OTP'), 'error');
425438
}
426439
} catch (error) {
427-
showToastMessage('Please enter valid otp', 'error');
440+
showToastMessage(t('LEARNER_APP.REGISTRATION_FLOW.PLEASE_ENTER_VALID_OTP'), 'error');
428441
} finally {
429442
setOtp(['', '', '', '']);
430443
}
@@ -820,10 +833,10 @@ const RegisterationFlow = () => {
820833
open={accountExistModal}
821834
onClose={handleCloseModal}
822835
showFooter
823-
primaryText={'Yes, Create Another Account'}
824-
modalTitle={'Account Already Exists'}
836+
primaryText={t('LEARNER_APP.REGISTRATION_FLOW.YES_CREATE_ANOTHER_ACCOUNT')}
837+
modalTitle={t('LEARNER_APP.REGISTRATION_FLOW.ACCOUNT_ALREADY_EXISTS')}
825838
primaryActionHandler={onCreateAnotherAccount}
826-
footerText="Are you sure you want to create another account?"
839+
footerText={t('LEARNER_APP.REGISTRATION_FLOW.ARE_YOU_SURE_CREATE_ANOTHER_ACCOUNT')}
827840
>
828841
<AccountExistsCard
829842
fullName={firstLetterInUpperCase(
@@ -838,8 +851,8 @@ const RegisterationFlow = () => {
838851
open={otpmodal && mobile ? true : false}
839852
onClose={handleOTPModal}
840853
showFooter
841-
primaryText={'Verify OTP'}
842-
modalTitle={'Verify Your Phone Number'}
854+
primaryText={t('LEARNER_APP.REGISTRATION_FLOW.VERIFY_OTP')}
855+
modalTitle={t('LEARNER_APP.REGISTRATION_FLOW.VERIFY_YOUR_PHONE_NUMBER')}
843856
primaryActionHandler={onVerify}
844857
>
845858
<OtpVerificationComponent
@@ -854,7 +867,7 @@ const RegisterationFlow = () => {
854867
open={verificationSuccessModal}
855868
onClose={onCloseSuccessModal}
856869
showFooter={false}
857-
primaryText={'Okay'}
870+
primaryText={t('LEARNER_APP.REGISTRATION_FLOW.OKAY')}
858871
primaryActionHandler={onCloseSuccessModal}
859872
>
860873
<Box p="10px">
@@ -866,7 +879,7 @@ const RegisterationFlow = () => {
866879
open={signupSuccessModal}
867880
onClose={onCloseSignupSuccessModal}
868881
showFooter={true}
869-
primaryText={'Start Exploring'}
882+
primaryText={t('LEARNER_APP.REGISTRATION_FLOW.START_EXPLORING')}
870883
primaryActionHandler={onSigin}
871884
>
872885
<Box p="10px">
@@ -885,7 +898,7 @@ const RegisterationFlow = () => {
885898
open={invalidLinkModal}
886899
onClose={onCloseInvalidLinkModal}
887900
showFooter={true}
888-
primaryText={'Okay'}
901+
primaryText={t('LEARNER_APP.REGISTRATION_FLOW.OKAY')}
889902
primaryActionHandler={renderHomePage}
890903
>
891904
<Box p="10px">{t('LEARNER_APP.REGISTRATION.INVALID_LINK')}</Box>

apps/learner-web-app/src/components/Content/CommonL1ContentList.tsx

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Button,
88
Grid,
99
Typography,
10+
Link,
1011
useMediaQuery,
1112
useTheme,
1213
} from '@mui/material';
@@ -140,19 +141,68 @@ const MyComponent: React.FC<CommonL1ContentListProps> = ({ notab = false }) => {
140141
flexShrink: 0,
141142
}}
142143
/>
143-
<Typography
144-
variant="h5"
144+
<Box
145145
sx={{
146-
textAlign: 'center',
147-
color: '#1F1B13',
148-
fontWeight: 600,
149-
fontSize: { xs: '12px', md: '16px' },
150-
lineHeight: { xs: '18px', md: '24px' },
146+
display: 'flex',
147+
flexDirection: 'column',
148+
gap: 1,
151149
maxWidth: '650px',
152150
}}
153151
>
154-
{t('LEARNER_APP.COURSE.SECOND_CHANCE_REGISTRATION_MESSAGE')}
155-
</Typography>
152+
<Typography
153+
variant="h5"
154+
sx={{
155+
textAlign: 'center',
156+
color: '#1F1B13',
157+
fontWeight: 600,
158+
fontSize: { xs: '12px', md: '16px' },
159+
lineHeight: { xs: '18px', md: '24px' },
160+
}}
161+
>
162+
{t('LEARNER_APP.COURSE.SECOND_CHANCE_REGISTRATION_MESSAGE')}
163+
</Typography>
164+
<Typography
165+
variant="body2"
166+
sx={{
167+
textAlign: 'center',
168+
color: '#1F1B13',
169+
fontWeight: 400,
170+
fontSize: { xs: '11px', md: '14px' },
171+
lineHeight: { xs: '16px', md: '20px' },
172+
}}
173+
>
174+
{t('LEARNER_APP.COURSE.PLAYSTORE_DOWNLOAD_MESSAGE')
175+
.split('{playStoreLink}')
176+
.map((part, index, array) => {
177+
if (index === array.length - 1) {
178+
return (
179+
<React.Fragment key={index}>{part}</React.Fragment>
180+
);
181+
}
182+
return (
183+
<React.Fragment key={index}>
184+
{part}
185+
<Link
186+
href="https://play.google.com/store/apps/details?id=com.pratham.learning"
187+
target="_blank"
188+
rel="noopener noreferrer"
189+
sx={{
190+
color: '#FDBE16',
191+
textDecoration: 'underline',
192+
fontWeight: 500,
193+
'&:hover': {
194+
color: '#fdbe16',
195+
textDecoration: 'underline',
196+
},
197+
}}
198+
>
199+
Play Store
200+
</Link>
201+
</React.Fragment>
202+
);
203+
})}
204+
</Typography>
205+
</Box>
156206
</Box>
157207
)}
158208
{!notab && (

0 commit comments

Comments
 (0)