Skip to content

Commit 8bd40fd

Browse files
authored
Merge pull request #623 from AkshataKatwal16/login-fix
Issue feat: login, profile fixes
2 parents 1ac2fba + b462ad7 commit 8bd40fd

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ const LoginPage = () => {
2222
const router = useRouter();
2323
const theme = useTheme();
2424
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
25-
const handleAddAccount = () => {};
25+
const handleAddAccount = () => {
26+
router.push('/');
27+
};
2628

2729
useEffect(() => {
2830
const init = async () => {

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import UserProfileCard from '@learner/components/UserProfileCard/UserProfileCard
77
import CourseCertificateCard from '@learner/components/CourseCertificateCard/CourseCertificateCard';
88
import { courseWiseLernerList } from '@shared-lib-v2/utils/CertificateService/coursesCertificates';
99
import { CertificateModal, get } from '@shared-lib';
10+
1011
import { baseurl } from '@learner/utils/API/EndUrls';
1112
type FilterDetails = {
1213
status?: string[];
@@ -16,10 +17,8 @@ type FilterDetails = {
1617
const ProfilePage = () => {
1718
const [filters] = useState<FilterDetails>({
1819
status: ['completed', 'viewCertificate'],
19-
tenantId:
20-
(typeof window !== 'undefined' && localStorage.getItem('tenantId')) || '',
21-
userId:
22-
(typeof window !== 'undefined' && localStorage.getItem('userId')) || '',
20+
tenantId: localStorage.getItem('tenantId') || '',
21+
userId: localStorage.getItem('userId') || '',
2322
});
2423
const [showCertificate, setShowCertificate] = useState(false);
2524
const [certificateId, setCertificateId] = useState('');
@@ -61,7 +60,7 @@ const ProfilePage = () => {
6160
userId: item.userId,
6261
courseId: item.courseId,
6362
certificateId: item.certificateId,
64-
completedOn: item.completedOn,
63+
completedOn: item.issuedOn,
6564
description: courseDetails.description || '',
6665
posterImage: courseDetails.posterImage || '',
6766
program: courseDetails.program || [],

apps/learner-web-app/src/components/CourseCertificateCard/CourseCertificateCard.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const CourseCertificateCard: React.FC<CertificateCardProps> = ({
4141
<CardMedia
4242
component="img"
4343
height="200"
44-
image={imageUrl || '/images/default.png'}
44+
image={imageUrl || '/images/image_ver.png'}
4545
alt={title}
4646
sx={{
4747
width: '100%',
@@ -71,7 +71,14 @@ const CourseCertificateCard: React.FC<CertificateCardProps> = ({
7171
fontSize: 12,
7272
}}
7373
>
74-
Completed on {completionDate}
74+
Issued certificate on{' '}
75+
{new Date(completionDate)
76+
.toLocaleDateString('en-US', {
77+
day: 'numeric',
78+
month: 'long',
79+
year: 'numeric',
80+
})
81+
.replace(',', ',')}
7582
</Typography>
7683
</Box>
7784
</Box>

apps/learner-web-app/src/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const App: React.FC<LayoutProps> = ({ children, ...props }) => {
5151
title: t('LEARNER_APP.COMMON.PROFILE'),
5252
icon: <AccountBox />,
5353
to: () => router.push('/profile'),
54-
isActive: currentPage === '/content',
54+
isActive: currentPage === '/profile',
5555
},
5656
]);
5757
}, [t, router]);

0 commit comments

Comments
 (0)