Compare commits

..

2 Commits

Author SHA1 Message Date
4d498662f8 Merge pull request '#19 Неверные надписи в форме редактирования лекции' (#21) from bugfix/wrong-title-edit-lesson into master
All checks were successful
platform/bro/pipeline/head This commit looks good
Reviewed-on: https://git.inno-js.ru/bro-js/journal.pl/pulls/21
Reviewed-by: primakov <primakovpro@gmail.com>
2024-04-07 12:39:35 +03:00
1320a50af0 #19 Неверные надписи в форме редактирования лекции
All checks were successful
platform/bro/pipeline/head This commit looks good
platform/bro/pipeline/pr-master This commit looks good
2024-04-07 16:15:08 +10:00

View File

@ -65,6 +65,8 @@ interface LessonFormProps {
onCancel: () => void onCancel: () => void
onSubmit: (lesson: Lesson) => void onSubmit: (lesson: Lesson) => void
error?: string error?: string
title: string
nameButton: string
} }
const LessonForm = ({ const LessonForm = ({
@ -73,6 +75,8 @@ const LessonForm = ({
onCancel, onCancel,
onSubmit, onSubmit,
error, error,
title,
nameButton,
}: LessonFormProps) => { }: LessonFormProps) => {
const { const {
control, control,
@ -90,7 +94,7 @@ const LessonForm = ({
<Card align="left"> <Card align="left">
<CardHeader display="flex"> <CardHeader display="flex">
<Heading as="h2" mt="0"> <Heading as="h2" mt="0">
Создание лекции {title}
</Heading> </Heading>
<CloseButton <CloseButton
ml="auto" ml="auto"
@ -153,7 +157,7 @@ const LessonForm = ({
colorScheme="blue" colorScheme="blue"
isLoading={isLoading} isLoading={isLoading}
> >
Создать {nameButton}
</Button> </Button>
</Box> </Box>
</VStack> </VStack>
@ -343,6 +347,8 @@ const LessonList = () => {
}} }}
error={(crLQuery.error as any)?.error} error={(crLQuery.error as any)?.error}
lesson={editLesson} lesson={editLesson}
title={editLesson ? 'Редактирование лекции' : 'Создание лекции'}
nameButton={editLesson ? 'Редактировать' : 'Создать'}
/> />
) : ( ) : (
<Box p="2" m="2"> <Box p="2" m="2">