diff --git a/src/components/notifications/MessageBox.tsx b/src/components/notifications/MessageBox.tsx index 6f6653549..4fc3cd683 100644 --- a/src/components/notifications/MessageBox.tsx +++ b/src/components/notifications/MessageBox.tsx @@ -8,6 +8,8 @@ import { Typography } from '../Typography'; import { cn } from '@/lib/Tailwind'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../Tooltip'; import { GlobalModalsContext } from '@/context/GlobalModalsProvider'; +import { IconX } from '@tabler/icons-react'; +import { Button } from '../Button'; interface MessageBoxProps { userNotification: Concrete_Notification; @@ -15,9 +17,10 @@ interface MessageBoxProps { isRead?: boolean; updateLastTimeChecked?: () => void; className?: string; + onClose?: () => void; } -const MessageBox = ({ userNotification, isStandalone, isRead, updateLastTimeChecked, className }: MessageBoxProps) => { +const MessageBox = ({ userNotification, isStandalone, isRead, updateLastTimeChecked, className, onClose }: MessageBoxProps) => { const [notificationModalOpen, setNotificationModalOpen] = useState(false); const navigate = useNavigate(); const { openLeavePageModal, openAchievementModal } = useContext(GlobalModalsContext); @@ -86,12 +89,22 @@ const MessageBox = ({ userNotification, isStandalone, isRead, updateLastTimeChec return ( + {onClose && ( + + )}
diff --git a/src/hooks/useBreadcrumb.ts b/src/hooks/useBreadcrumb.ts index 4a52c5ebf..57427dce1 100644 --- a/src/hooks/useBreadcrumb.ts +++ b/src/hooks/useBreadcrumb.ts @@ -14,6 +14,7 @@ export const useBreadcrumbRoutes = () => { EDIT_APPOINTMENT: { label: t('navigation.label.editAppointment'), route: '/edit-appointment' }, COURSES: { label: t('navigation.label.group'), route: '/group' }, CREATE_COURSE: { label: t('navigation.label.createCourse'), route: '/create-course' }, + EDIT_COURSE: { label: t('navigation.label.editCourse'), route: '/edit-course' }, MATCHING: { label: t('navigation.label.matching'), route: '/matching' }, REQUEST_MATCH: { label: t('navigation.label.requestMatch'), route: '/request-match' }, SETTINGS: { label: t('navigation.label.settings'), route: '/settings' }, diff --git a/src/lang/ar.json b/src/lang/ar.json index b252b9ac4..90bb121b3 100644 --- a/src/lang/ar.json +++ b/src/lang/ar.json @@ -2025,7 +2025,8 @@ "newEmail": "تغيير البريد الإلكتروني", "newPassword": "تغيير كلمة المرور", "install": "Lern-Fair التطبيق", - "progress": "إنجازات والتقدم" + "progress": "إنجازات والتقدم", + "editCourse": "تحرير الدورة التدريبية" } }, "screening": { diff --git a/src/lang/de.json b/src/lang/de.json index e365cf8ee..10d1d3f2d 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -2098,6 +2098,7 @@ "forPupils": "Wissens-Center", "requestMatch": "Ein neues Lernpaar bilden", "createCourse": "Kurse anlegen", + "editCourse": "Kurs editieren", "createAppointment": "Termin erstellen", "editAppointment": "Termin bearbeiten", "settings": "Einstellungen", diff --git a/src/lang/en.json b/src/lang/en.json index 7bdbfc66c..af38ebf5e 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -2025,7 +2025,8 @@ "newEmail": "Change e-mail", "newPassword": "Change password", "install": "The Lern-Fair app", - "progress": "Successes & progress" + "progress": "Successes & progress", + "editCourse": "Edit course" } }, "screening": { diff --git a/src/lang/ru.json b/src/lang/ru.json index 63a27a048..138db519b 100644 --- a/src/lang/ru.json +++ b/src/lang/ru.json @@ -2029,7 +2029,8 @@ "newEmail": "Изменить электронную почту", "newPassword": "Изменить пароль", "install": "Lern-Fair Приложение", - "progress": "Успехи и прогресс" + "progress": "Успехи и прогресс", + "editCourse": "Редактировать курс" } }, "screening": { diff --git a/src/lang/tr.json b/src/lang/tr.json index 35dbc3c09..660f03a41 100644 --- a/src/lang/tr.json +++ b/src/lang/tr.json @@ -2029,7 +2029,8 @@ "newEmail": "E-posta değiştir", "newPassword": "Şifre değiştirme", "install": "Lern-Fair Uygulama", - "progress": "Başarılar ve ilerleme" + "progress": "Başarılar ve ilerleme", + "editCourse": "Kursu düzenle" } }, "screening": { diff --git a/src/lang/uk.json b/src/lang/uk.json index cac2417bd..fc0b75b3f 100644 --- a/src/lang/uk.json +++ b/src/lang/uk.json @@ -2029,7 +2029,8 @@ "newEmail": "Змінити електронну пошту", "newPassword": "Змінити пароль", "install": "Lern-Fair Додаток", - "progress": "Успіхи та прогрес" + "progress": "Успіхи та прогрес", + "editCourse": "Редагувати курс" } }, "screening": { diff --git a/src/pages/CreateCourse.tsx b/src/pages/CreateCourse.tsx index ab83d9d22..dc94fac29 100644 --- a/src/pages/CreateCourse.tsx +++ b/src/pages/CreateCourse.tsx @@ -36,6 +36,7 @@ import { Course_Category_Enum, Course_Subject_Enum } from '../gql/graphql'; import SwitchLanguageButton from '../components/SwitchLanguageButton'; import useApollo, { useUserType } from '../hooks/useApollo'; import { Breadcrumb } from '@/components/Breadcrumb'; +import { useBreadcrumbRoutes } from '@/hooks/useBreadcrumb'; export type CreateCourseError = 'course' | 'subcourse' | 'set_image' | 'upload_image' | 'instructors' | 'lectures' | 'tags' | 'appointments'; export enum ChatType { @@ -98,6 +99,7 @@ const CreateCourse: React.FC = () => { const location = useLocation(); const state = location.state as { courseId?: number; currentStep?: number }; const prefillCourseId = state?.courseId; + const breadcrumbRoutes = useBreadcrumbRoutes(); const [courseId, setCourseId] = useState(''); const [courseName, setCourseName] = useState(''); @@ -911,8 +913,14 @@ const CreateCourse: React.FC = () => { }} > {(((roles.includes('INSTRUCTOR') && canCreateCourse?.allowed) || roles.includes('COURSE_SCREENER')) && ( - - + + {isEditing ? ( + + ) : ( + + )} = ({ {displayName} {position && ( - + {t('appointment.appointmentTile.lecture', { position: position }) + (title ? t('appointment.appointmentTile.title', { appointmentTitle: title }) : '')} diff --git a/src/widgets/InAppMessage.tsx b/src/widgets/InAppMessage.tsx index 2c5f08462..9cddfceeb 100644 --- a/src/widgets/InAppMessage.tsx +++ b/src/widgets/InAppMessage.tsx @@ -12,7 +12,7 @@ export const showInAppMessage = (notification: Concrete_Notification) => { toast.custom( () => (
- +
), {