Skip to content

Commit

Permalink
chore: improve course ui
Browse files Browse the repository at this point in the history
  • Loading branch information
leofvo committed Feb 15, 2023
1 parent f87de9b commit a8b6922
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/polyflix/public/locales/en/courses.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}
},
"collections": "Modules",
"collectionNumber": "Module {{number}}",
"introduction": "Getting started",
"courseCard": {
"footerElements": "{{count}} module(s) in this course",
Expand Down
1 change: 1 addition & 0 deletions apps/polyflix/public/locales/fr/courses.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}
},
"collections": "Modules",
"collectionNumber": "Module {{number}}",
"introduction": "Présentation",
"courseCard": {
"footerElements": "{{count}} module(s) dans ce cours",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const ItemCollectionTimeline = ({
<TimelineSeparator>
<TimelineDot
color={+query.get('index')! === index ? 'primary' : 'grey'}
sx={{ textAlign: 'center' }}
>
<Icon name={elementIcon(element.type)} />
</TimelineDot>
Expand All @@ -116,17 +117,22 @@ export const ItemCollectionTimeline = ({
variant="body1"
sx={{
textDecoration: isHover ? 'underline' : 'none',
color: 'black',
}}
color={(theme) =>
+query.get('index')! === index
? theme.palette.primary.main
: theme.palette.grey[500]
}
>
{element.name}
</Typography>
<Typography
variant="caption"
sx={{
textTransform: 'capitalize',
color: 'black',
opacity: 0.7,
}}
color={(theme) => theme.palette.grey[500]}
>
{element.type}
</Typography>
Expand Down
4 changes: 3 additions & 1 deletion apps/polyflix/src/modules/courses/pages/[slug].page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const CourseSlugPage = () => {
<>
<Stack spacing={2}>
<Typography variant="h4">{t('collections')}</Typography>
{course?.modules?.map((module) => (
{course?.modules?.map((module, index) => (
<>
{module.visibility === 'private' &&
user?.id != module.user?.id &&
Expand All @@ -230,6 +230,7 @@ export const CourseSlugPage = () => {
width: 'auto',
}}
>
{t('collectionNumber', { number: index + 1 })} -{' '}
{module.name}
</Typography>
<Alert severity="error">
Expand All @@ -251,6 +252,7 @@ export const CourseSlugPage = () => {
width: 'auto',
}}
>
{t('collectionNumber', { number: index + 1 })} -{' '}
{module.name}
</Typography>
</Link>
Expand Down

0 comments on commit a8b6922

Please sign in to comment.