diff --git a/src/modals/AddCourseInstructor.tsx b/src/modals/AddCourseInstructor.tsx index 635286fa9..62e9bdd86 100644 --- a/src/modals/AddCourseInstructor.tsx +++ b/src/modals/AddCourseInstructor.tsx @@ -44,7 +44,7 @@ const AddCourseInstructor: React.FC = ({ onClose, addedInstructors, onIns if (loading) return ; return ( - + - - - - - ); -}; -export default CancelMatchRequestModal; diff --git a/src/modals/CourseConfirmationModal.tsx b/src/modals/ConfirmationModal.tsx similarity index 89% rename from src/modals/CourseConfirmationModal.tsx rename to src/modals/ConfirmationModal.tsx index 19eb09fe7..88b6c0c95 100644 --- a/src/modals/CourseConfirmationModal.tsx +++ b/src/modals/ConfirmationModal.tsx @@ -4,7 +4,7 @@ import { BaseModalProps, Modal, ModalFooter, ModalHeader, ModalTitle } from '@/c import { Typography } from '@/components/Typography'; import { Button } from '@/components/Button'; -interface CourseConfirmationModalProps extends BaseModalProps { +interface ConfirmationModalProps extends BaseModalProps { headline: string; confirmButtonText: string; description: ReactNode; @@ -12,7 +12,7 @@ interface CourseConfirmationModalProps extends BaseModalProps { variant?: 'default' | 'destructive'; isLoading?: boolean; } -const CourseConfirmationModal = ({ +const ConfirmationModal = ({ headline, confirmButtonText, description, @@ -21,7 +21,7 @@ const CourseConfirmationModal = ({ onOpenChange, variant = 'default', isLoading, -}: CourseConfirmationModalProps) => { +}: ConfirmationModalProps) => { const { t } = useTranslation(); return ( @@ -44,4 +44,4 @@ const CourseConfirmationModal = ({ ); }; -export default CourseConfirmationModal; +export default ConfirmationModal; diff --git a/src/pages/pupil/Dashboard.tsx b/src/pages/pupil/Dashboard.tsx index 4bd3093fb..80d5e8a18 100644 --- a/src/pages/pupil/Dashboard.tsx +++ b/src/pages/pupil/Dashboard.tsx @@ -1,4 +1,4 @@ -import { Text, Button, HStack, useTheme, VStack, useBreakpointValue, Flex, Alert, Box, Stack, Heading, Row } from 'native-base'; +import { Text, Button, HStack, useTheme, VStack, useBreakpointValue, Flex, Alert, Box, Stack } from 'native-base'; import { useCallback, useEffect, useMemo, useState } from 'react'; import AppointmentCard from '../../widgets/AppointmentCard'; import HSection from '../../widgets/HSection'; @@ -7,14 +7,11 @@ import { useNavigate } from 'react-router-dom'; import NotificationAlert from '../../components/notifications/NotificationAlert'; import { useTranslation } from 'react-i18next'; import { useMutation, useQuery } from '@apollo/client'; -import BooksIcon from '../../assets/icons/lernfair/lf-books.svg'; -import BarrierIcon from '../../assets/icons/barrier-block_green.svg'; import { DEACTIVATE_PUPIL_MATCH_REQUESTS } from '../../config'; import { DateTime } from 'luxon'; import { useMatomo } from '@jonkoops/matomo-tracker-react'; import CenterLoadingSpinner from '../../components/CenterLoadingSpinner'; import AsNavigationItem from '../../components/AsNavigationItem'; -import CancelMatchRequestModal from '../../modals/CancelMatchRequestModal'; import { getTrafficStatus } from '../../Utility'; import LearningPartner from '../../widgets/LearningPartner'; import ImportantInformation from '../../widgets/ImportantInformation'; @@ -22,9 +19,9 @@ import { gql } from '../../gql'; import SwitchLanguageButton from '../../components/SwitchLanguageButton'; import NextAppointmentCard from '../../widgets/NextAppointmentCard'; import { Lecture } from '../../gql/graphql'; -import CTACard from '../../widgets/CTACard'; import DisableableButton from '../../components/DisablebleButton'; import { useRoles } from '../../hooks/useApollo'; +import ConfirmationModal from '@/modals/ConfirmationModal'; type Props = {}; @@ -165,11 +162,6 @@ const Dashboard: React.FC = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - const isMobile = useBreakpointValue({ base: true, md: false }); - const startSummerVacation = new Date('2024-06-10'); - const endSummerVacation = new Date('2024-09-02'); - const isSummerVacation = startSummerVacation <= new Date() && endSummerVacation >= new Date(); - const ContainerWidth = useBreakpointValue({ base: '100%', lg: sizes['containerWidth'], @@ -197,7 +189,7 @@ const Dashboard: React.FC = () => { ); const cancelMatchRequestReaction = useCallback( - (shareFeedback: boolean, feedback?: string) => { + () => { trackEvent({ category: 'Schüler', action: 'Match Request zurückgezogen', @@ -345,11 +337,14 @@ const Dashboard: React.FC = () => { )} - setShowCancelModal(false)} - onShareFeedback={(feedback) => cancelMatchRequestReaction(true, feedback)} - onSkipShareFeedback={() => cancelMatchRequestReaction(false)} + ); diff --git a/src/pages/pupil/Matching.tsx b/src/pages/pupil/Matching.tsx index 6fa5e7a03..2f349e72e 100644 --- a/src/pages/pupil/Matching.tsx +++ b/src/pages/pupil/Matching.tsx @@ -1,6 +1,6 @@ import { useMutation, useQuery } from '@apollo/client'; import { useMatomo } from '@jonkoops/matomo-tracker-react'; -import { Button, Circle, Flex, Modal, Row, Stack, Text, useTheme, useToast, VStack } from 'native-base'; +import { Circle, Flex, Stack, Text, useTheme, useToast, VStack } from 'native-base'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useNavigate } from 'react-router-dom'; @@ -17,6 +17,7 @@ import SwitchLanguageButton from '../../components/SwitchLanguageButton'; import { Heading, useBreakpointValue } from 'native-base'; import DisableableButton from '../../components/DisablebleButton'; import { DEACTIVATE_PUPIL_MATCH_REQUESTS } from '../../config'; +import ConfirmationModal from '@/modals/ConfirmationModal'; type Props = {}; @@ -244,44 +245,27 @@ const Matching: React.FC = () => { }, ]} /> - - - {t('matching.request.check.deleteRequest')} - setShowCancelModal(false)} /> - {t('matching.request.check.areyousuretodelete')} - - - - - - - - - - {t('matching.request.check.editRequest')} - - {t('matching.request.check.editRequestDescription')} - - - - - - - - - + + + navigate('/request-match', { + state: { edit: true }, + }) + } + /> ); diff --git a/src/pages/pupil/single-course/PupilCourseButtons.tsx b/src/pages/pupil/single-course/PupilCourseButtons.tsx index eb7190834..3d074963e 100644 --- a/src/pages/pupil/single-course/PupilCourseButtons.tsx +++ b/src/pages/pupil/single-course/PupilCourseButtons.tsx @@ -2,7 +2,7 @@ import { ApolloQueryResult, useMutation, useQuery } from '@apollo/client'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation, Trans } from 'react-i18next'; import { Instructor, Lecture, Subcourse } from '../../../gql/graphql'; -import CourseConfirmationModal from '../../../modals/CourseConfirmationModal'; +import ConfirmationModal from '../../../modals/ConfirmationModal'; import { getTrafficStatus } from '../../../Utility'; import WaitinglistBanner from '../../../widgets/WaitinglistBanner'; import OpenCourseChatButton from '../../subcourse/OpenCourseChatButton'; @@ -266,7 +266,7 @@ const PupilCourseButtons: React.FC = ({ subcourse, refresh, i )} - , br:
}} />} @@ -276,7 +276,7 @@ const PupilCourseButtons: React.FC = ({ subcourse, refresh, i isLoading={loadingSubcourseJoined} /> - = ({ subcourse, refresh, i isLoading={loadingSubcourseLeft} /> - = ({ subcourse, refresh, i onConfirm={handleJoinWaitinglist} isLoading={loadingJoinedWaitinglist} /> - = () => { )} - - - {t('matching.request.check.deleteRequest')} - setShowCancelModal(false)} /> - {t('matching.request.check.areyousuretodelete')} - - - - - - + ); }; diff --git a/src/pages/student/onboarding/GroupOnboarding.tsx b/src/pages/student/onboarding/GroupOnboarding.tsx index babcd7cd8..94202b131 100644 --- a/src/pages/student/onboarding/GroupOnboarding.tsx +++ b/src/pages/student/onboarding/GroupOnboarding.tsx @@ -1,6 +1,6 @@ import { Box, useToast } from 'native-base'; import { useCallback, useState } from 'react'; -import CourseConfirmationModal from '../../../modals/CourseConfirmationModal'; +import ConfirmationModal from '../../../modals/ConfirmationModal'; import { useTranslation } from 'react-i18next'; import OnboardingCard from '../../../widgets/OnboardingCard'; import IconGroup from '../../../assets/icons/Icon_Gruppe.svg'; @@ -89,7 +89,7 @@ const GroupOnboarding: React.FC = ({ canRequest = false, waitFo )} - = ({ canRequest = false, waitForSupp /> )} -