-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from upendraTekdi/shiksha-2.0
Issue #PS-326 feat: Extra session card on dashboard, Cohort details card on dashboard and Cohort details card on dashboard (my timetable)
- Loading branch information
Showing
8 changed files
with
336 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React from 'react'; | ||
import { Card, CardContent, Typography, Box } from '@mui/material'; | ||
import EditOutlined from '@mui/icons-material/EditOutlined'; | ||
import ContentCopyRoundedIcon from '@mui/icons-material/ContentCopyRounded'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { truncateURL } from '@/utils/Helper'; | ||
import { ExtraSessionsCardProps } from '@/utils/Interfaces'; | ||
|
||
const ExtraSessionsCard: React.FC<ExtraSessionsCardProps> = ({ | ||
subject, | ||
instructor, | ||
dateAndTime, | ||
meetingURL, | ||
onEditClick, | ||
onCopyClick, | ||
}) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Box> | ||
<Card | ||
sx={{ border: '1px solid #ccc', borderRadius: '8px', margin: '15px' }} | ||
> | ||
<CardContent sx={{ alignItems: 'center' }}> | ||
<Box display={'flex'} justifyContent={'space-between'}> | ||
<Typography | ||
margin={0} | ||
fontSize={'16px'} | ||
color={'black'} | ||
fontFamily={'Poppins'} | ||
fontWeight={'400'} | ||
> | ||
{subject} - {t('DASHBOARD.EXTRA_CLASS')} | ||
</Typography> | ||
{onEditClick && ( | ||
<EditOutlined | ||
color="secondary" | ||
fontSize="small" | ||
onClick={onEditClick} | ||
/> | ||
)} | ||
</Box> | ||
<Typography | ||
color={'#7C766F'} | ||
fontSize={'14px'} | ||
fontWeight={'400'} | ||
margin={0} | ||
> | ||
{instructor} | ||
</Typography> | ||
<Typography | ||
margin={0} | ||
color={'#7C766F'} | ||
fontSize={'14px'} | ||
fontWeight={'400'} | ||
> | ||
{dateAndTime} | ||
</Typography> | ||
<Box | ||
margin={0} | ||
color={'#0D599E'} | ||
display={'flex'} | ||
justifyContent={'space-between'} | ||
> | ||
<Typography>{truncateURL(meetingURL, 30)}</Typography> | ||
{onCopyClick && ( | ||
<ContentCopyRoundedIcon | ||
onClick={onCopyClick} | ||
color="secondary" | ||
fontSize="small" | ||
/> | ||
)} | ||
</Box> | ||
</CardContent> | ||
</Card> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default ExtraSessionsCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import { Card, CardContent, Typography, Grid, Box } from '@mui/material'; | ||
import { TimeTableCardProps } from '@/utils/Interfaces'; | ||
import ApartmentIcon from '@mui/icons-material/Apartment'; | ||
|
||
const TimeTableCard: React.FC<TimeTableCardProps> = ({ | ||
subject, | ||
instructor, | ||
time, | ||
}) => { | ||
return ( | ||
<Box> | ||
<Card | ||
sx={{ border: '1px solid #ccc', borderRadius: '8px', margin: '15px' }} | ||
> | ||
<CardContent sx={{ alignItems: 'center' }}> | ||
<Grid container spacing={2} sx={{ alignItems: 'center' }}> | ||
<Grid item xs={1.5}> | ||
<ApartmentIcon /> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<Typography | ||
variant="h5" | ||
sx={{ fontWeight: '400', fontSize: '16px' }} | ||
component="div" | ||
> | ||
{subject} | ||
</Typography> | ||
<Typography | ||
margin={0} | ||
color={'#7C766F'} | ||
fontSize={'14px'} | ||
fontWeight={'400'} | ||
variant="body2" | ||
> | ||
{instructor} | ||
</Typography> | ||
</Grid> | ||
<Grid item xs={4.5}> | ||
<Typography | ||
margin={0} | ||
color={'#7C766F'} | ||
fontSize={'14px'} | ||
fontWeight={'400'} | ||
// variant="h5" | ||
component="div" | ||
> | ||
{time} | ||
</Typography> | ||
</Grid> | ||
</Grid> | ||
</CardContent> | ||
</Card> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default TimeTableCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.