-
-
- {capitalize(course.title)}
-
-
+
+
+
+
+ {capitalize(course.title)}
+
+
+
}
expandable={false}
fullWidth
>
-
+
)}
diff --git a/src/frontend/js/settings.ts b/src/frontend/js/settings.ts
index ec56aeb528..19d168b3ec 100644
--- a/src/frontend/js/settings.ts
+++ b/src/frontend/js/settings.ts
@@ -16,7 +16,7 @@ export const REACT_QUERY_SETTINGS = {
throttleTime: 500,
},
// Cache is garbage collected after this delay
- cacheTime: 24 * 60 * 60 * 1000, // 24h in ms
+ cacheTime: 0, // 24 * 60 * 60 * 1000, // 24h in ms
// Data are considered as stale after this delay
staleTimes: {
default: 0, // Stale immediately
@@ -35,4 +35,4 @@ export const PAYMENT_SETTINGS = {
pollLimit: 30,
};
-export const MOCK_SERVICE_WORKER_ENABLED = false;
+export const MOCK_SERVICE_WORKER_ENABLED = true;
diff --git a/src/frontend/js/widgets/Dashboard/components/CourseRunLabel/_styles.scss b/src/frontend/js/widgets/Dashboard/components/CourseRunLabel/_styles.scss
new file mode 100644
index 0000000000..299c3aa417
--- /dev/null
+++ b/src/frontend/js/widgets/Dashboard/components/CourseRunLabel/_styles.scss
@@ -0,0 +1,6 @@
+.course-run-label {
+ font-size: rem-calc(16px);
+ display: flex;
+ align-items: center;
+ gap: rem-calc(15px);
+}
diff --git a/src/frontend/js/widgets/Dashboard/components/CourseRunLabel/index.tsx b/src/frontend/js/widgets/Dashboard/components/CourseRunLabel/index.tsx
new file mode 100644
index 0000000000..02a776d559
--- /dev/null
+++ b/src/frontend/js/widgets/Dashboard/components/CourseRunLabel/index.tsx
@@ -0,0 +1,42 @@
+import { defineMessages, useIntl } from 'react-intl';
+import { Icon, IconTypeEnum } from 'components/Icon';
+import { CourseRun } from 'types/Joanie';
+
+const messages = defineMessages({
+ courseRunLabelDate: {
+ defaultMessage: 'Session from {from} to {to}',
+ description: 'Message displayed as course run label displayed as dates',
+ id: 'components.CourseRunLabel.courseRunLabelDate',
+ },
+});
+
+export enum CourseRunLabelVariantEnum {
+ TITLE = 'title',
+ DATE = 'date',
+}
+
+interface CourseRunLabelProps {
+ courseRun: CourseRun;
+ variant?: CourseRunLabelVariantEnum;
+}
+const CourseRunLabel = ({
+ courseRun,
+ variant = CourseRunLabelVariantEnum.TITLE,
+}: CourseRunLabelProps) => {
+ const intl = useIntl();
+ const displayedLabel = {
+ [CourseRunLabelVariantEnum.TITLE]: courseRun.title,
+ [CourseRunLabelVariantEnum.DATE]: intl.formatMessage(messages.courseRunLabelDate, {
+ from: intl.formatDate(new Date(courseRun.start)),
+ to: intl.formatDate(new Date(courseRun.end)),
+ }),
+ }[variant];
+ return (
+