-
Notifications
You must be signed in to change notification settings - Fork 15
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 #68 from shreyas1434shinde/coursePlaner
Issue #PS-1534 feat: Foundation Course detail view UI implementation
- Loading branch information
Showing
4 changed files
with
247 additions
and
0 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,42 @@ | ||
import React from 'react'; | ||
import { Box, Grid } from '@mui/material'; | ||
import { useTheme } from '@mui/material/styles'; | ||
import { CoursePlannerCardsProps } from '@/utils/Interfaces'; | ||
|
||
const CoursePlannerCards: React.FC<CoursePlannerCardsProps> = ({ | ||
title, | ||
subtitle, | ||
}) => { | ||
const theme = useTheme<any>(); | ||
|
||
return ( | ||
<Box> | ||
<Grid container spacing={2} sx={{ px: '16px !important' }}> | ||
<Grid item xs={6} md={2} sx={{ mt: 2 }}> | ||
<Box className="facilitator-bg"> | ||
<Box | ||
sx={{ | ||
fontSize: '16px', | ||
fontWeight: '500', | ||
color: theme?.palette?.warning['A400'], | ||
}} | ||
> | ||
{title} | ||
</Box> | ||
<Box | ||
sx={{ | ||
fontSize: '11px', | ||
fontWeight: '500', | ||
color: theme?.palette?.warning['A400'], | ||
}} | ||
> | ||
{subtitle} | ||
</Box> | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default CoursePlannerCards; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
import CoursePlannerCards from '@/components/CoursePlannerCards'; | ||
import Header from '@/components/Header'; | ||
import { logEvent } from '@/utils/googleAnalytics'; | ||
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'; | ||
import KeyboardBackspaceOutlinedIcon from '@mui/icons-material/KeyboardBackspaceOutlined'; | ||
import { | ||
Accordion, | ||
AccordionDetails, | ||
AccordionSummary, | ||
Box, | ||
Grid, | ||
Tab, | ||
Tabs, | ||
Typography, | ||
} from '@mui/material'; | ||
import { useTheme } from '@mui/material/styles'; | ||
import { useTranslation } from 'next-i18next'; | ||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; | ||
import React from 'react'; | ||
|
||
const TopicDetailView = () => { | ||
const [value, setValue] = React.useState(1); | ||
const theme = useTheme<any>(); | ||
const { t } = useTranslation(); | ||
const handleChange = (event: React.SyntheticEvent, newValue: number) => { | ||
setValue(newValue); | ||
}; | ||
const handleBackEvent = () => { | ||
window.history.back(); | ||
logEvent({ | ||
action: 'back-button-clicked-attendance-overview', | ||
category: 'Attendance Overview Page', | ||
label: 'Back Button Clicked', | ||
}); | ||
}; | ||
|
||
return ( | ||
<Box> | ||
<Box> | ||
<Header /> | ||
</Box> | ||
<Box sx={{ px: '16px' }}> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
justifyContent: 'left', | ||
alignItems: 'center', | ||
color: theme.palette.warning['A200'], | ||
padding: '15px 16px 5px', | ||
gap: '15px', | ||
}} | ||
width={'100%'} | ||
> | ||
<KeyboardBackspaceOutlinedIcon | ||
onClick={handleBackEvent} | ||
cursor={'pointer'} | ||
sx={{ color: theme.palette.warning['A200'] }} | ||
/> | ||
<Box> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
gap: '10px', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
fontSize: '16px', | ||
color: theme.palette.warning['300'], | ||
}} | ||
> | ||
Mathematics {/* will come from API */} | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
<Box sx={{ mt: 2 }}> | ||
<Box sx={{ width: '100%' }}> | ||
<Tabs | ||
value={value} | ||
onChange={handleChange} | ||
textColor="inherit" | ||
aria-label="secondary tabs example" | ||
sx={{ | ||
fontSize: '14px', | ||
borderBottom: `1px solid ${theme.palette.primary.contrastText}`, | ||
|
||
'& .MuiTab-root': { | ||
color: '#4D4639', | ||
padding: '0 20px', | ||
}, | ||
'& .Mui-selected': { | ||
color: '#4D4639', | ||
}, | ||
'& .MuiTabs-indicator': { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
backgroundColor: theme.palette.primary.main, | ||
borderRadius: '100px', | ||
height: '3px', | ||
}, | ||
'& .MuiTabs-scroller': { | ||
overflowX: 'unset !important', | ||
}, | ||
}} | ||
> | ||
<Tab value={1} label={t('COMMON.LEARNERS')} /> | ||
<Tab value={2} label={t('COMMON.FACILITATORS')} /> | ||
</Tabs> | ||
</Box> | ||
{value === 1 && ( | ||
<Box> | ||
<Box sx={{ mt: 2, mb: 1.5 }}> | ||
<Accordion | ||
sx={{ | ||
boxShadow: 'none !important', | ||
border: 'none !important', | ||
mt: 1.5, | ||
background: theme?.palette?.action?.selected, | ||
'&.MuiAccordion-root': { | ||
marginTop: 0, | ||
}, | ||
}} | ||
> | ||
<AccordionSummary | ||
expandIcon={ | ||
<ArrowDropDownIcon | ||
sx={{ color: theme?.palette?.warning['300'] }} | ||
/> | ||
} | ||
aria-controls="panel1-content" | ||
id="panel1-header" | ||
className="accordion-summary" | ||
sx={{ | ||
m: 0, | ||
background: theme?.palette?.action?.selected, | ||
px: '16px', | ||
height: '10px !important', | ||
'&.Mui-expanded': { | ||
minHeight: '48px', | ||
}, | ||
}} | ||
> | ||
<Typography | ||
fontWeight="500" | ||
fontSize="14px" | ||
sx={{ color: theme?.palette?.warning['300'] }} | ||
> | ||
{t('CENTER_SESSION.FACILITATORS')} | ||
</Typography> | ||
</AccordionSummary> | ||
<AccordionDetails | ||
sx={{ | ||
padding: '0px', | ||
background: theme?.palette?.warning['A400'], | ||
}} | ||
> | ||
<CoursePlannerCards | ||
title={t('CENTER_SESSION.TITLE')} | ||
subtitle={'Video'} | ||
/> | ||
</AccordionDetails> | ||
</Accordion> | ||
</Box> | ||
</Box> | ||
)} | ||
{value === 2 && ( | ||
<Box> | ||
<CoursePlannerCards | ||
title={t('CENTER_SESSION.TITLE')} | ||
subtitle={'Game'} | ||
/> | ||
</Box> | ||
)} | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export async function getStaticProps({ locale }: any) { | ||
return { | ||
props: { | ||
...(await serverSideTranslations(locale, ['common'])), | ||
// Will be passed to the page component as props | ||
}, | ||
}; | ||
} | ||
|
||
export default TopicDetailView; |
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