diff --git a/src/constants/translations/en/cooperation-details.json b/src/constants/translations/en/cooperation-details.json index 5a92b8b50..83e61f3df 100644 --- a/src/constants/translations/en/cooperation-details.json +++ b/src/constants/translations/en/cooperation-details.json @@ -29,5 +29,9 @@ "yourProgress": "Your progress", "completed": "completed", "needToComplete": "to complete" - } + }, + "closingMessage1": " started a closing process for the current cooperation. You will have ", + "accessDuration": "1 month of access", + "closingMessage2": " to study materials after the cooperation has been closed.", + "acceptBtn": "Accept" } diff --git a/src/constants/translations/en/titles.json b/src/constants/translations/en/titles.json index 73812ccdb..35bf7d745 100644 --- a/src/constants/translations/en/titles.json +++ b/src/constants/translations/en/titles.json @@ -2,5 +2,6 @@ "confirmTitle": "Please Confirm", "discardOffer": "Discard offer changes?", "discardChanges": "Discard recent changes?", - "confirmCooperationClosing": "Confirmation of cooperation closing" + "confirmCooperationClosing": "Confirmation of cooperation closing", + "acceptCooperationClosing": "Cooperation closing process" } diff --git a/src/constants/translations/uk/cooperation-details.json b/src/constants/translations/uk/cooperation-details.json index ec734340e..6bffddeee 100644 --- a/src/constants/translations/uk/cooperation-details.json +++ b/src/constants/translations/uk/cooperation-details.json @@ -29,5 +29,9 @@ "yourProgress": "Ваш прогрес", "completed": "виконано", "needToComplete": "до завершення" - } + }, + "closingMessage1": " ініціював(-ла) процес припинення співпраці. У вас залишиться доступ до матеріалів поточної співпраці протягом ", + "accessDuration": "1 місяця", + "closingMessage2": " з моменту закриття.", + "acceptBtn": "Прийняти" } diff --git a/src/constants/translations/uk/cooperations-page.json b/src/constants/translations/uk/cooperations-page.json index 358a535d8..4506e3dd7 100644 --- a/src/constants/translations/uk/cooperations-page.json +++ b/src/constants/translations/uk/cooperations-page.json @@ -86,6 +86,6 @@ "confirmDeletionTitle": "Ви підтверджуєте видалення нотатки?" }, "closeCooperationModal": { - "message": "Ви впевнені, що хочете завершити кооперацію?" + "message": "Ви впевнені, що хочете завершити співпрацю?" } } diff --git a/src/constants/translations/uk/titles.json b/src/constants/translations/uk/titles.json index af4eec393..2f028fd50 100644 --- a/src/constants/translations/uk/titles.json +++ b/src/constants/translations/uk/titles.json @@ -2,5 +2,6 @@ "confirmTitle": "Підтвердіть вихід", "discardOffer": "Відхилити зміни пропозиції?", "discardChanges": "Зберегти останні зміни?", - "confirmCooperationClosing": "Підтвердження закриття кооперації" + "confirmCooperationClosing": "Підтвердження припинення cпівпраці", + "acceptCooperationClosing": "Процес припинення співпраці" } diff --git a/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.styles.ts b/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.styles.ts index 30f2d530a..90c1c547f 100644 --- a/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.styles.ts +++ b/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.styles.ts @@ -3,12 +3,12 @@ import palette from '~/styles/app-theme/app.pallete' export const styles = { root: { display: 'flex', - flexDirection: 'row', alignItems: 'center', border: `1px solid ${palette.basic.pinkishRed}`, backgroundColor: palette.basic.softGray, borderRadius: '5px', padding: '24px', + justifyContent: 'space-between', gap: '16px' }, span: { @@ -18,15 +18,10 @@ export const styles = { color: palette.basic.mediumRed, fontWeight: '500', display: 'flex', - flexDirection: 'row', gap: '8px', mb: '4px' }, body: { color: palette.basic.darkGray - }, - button: { - color: `${palette.basic.deepRed} !important`, - backgroundColor: `${palette.basic.lightRed} !important` } } diff --git a/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.tsx b/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.tsx index 29f2d9623..543dc85c2 100644 --- a/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.tsx +++ b/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.tsx @@ -1,42 +1,41 @@ -import { Box, Typography } from '@mui/material' +import { Box, styled, Typography } from '@mui/material' import { FC } from 'react' -import AppButton from '~/components/app-button/AppButton' - import { styles } from './AcceptCooperationClosing.styles' import { ErrorOutlineRounded } from '@mui/icons-material' -import { SizeEnum } from '~/types' +import Button from '~/design-system/components/button/Button' +import { useTranslation } from 'react-i18next' interface AcceptCooperationClosureProps { user: string onAccept: () => void } +const BoldText = styled('span')({ + fontWeight: 500 +}) + const AcceptCooperationClosing: FC = ({ user, onAccept }) => { + const { t } = useTranslation() return ( - Cooperation closing process + {t('titles.acceptCooperationClosing')} - {user} started a closing process for - the current cooperation. You will have{' '} - 1 month of access to study materials - after the cooperation has been closed. + {user} + {t('cooperationDetailsPage.closingMessage1')} + {t('cooperationDetailsPage.accessDuration')} + {t('cooperationDetailsPage.closingMessage2')} - - Accept - + ) } diff --git a/src/containers/my-cooperations/cooperation-completion/CooperationCompletion.styles.ts b/src/containers/my-cooperations/cooperation-completion/CooperationCompletion.styles.ts index 8cb424154..4c0ed2435 100644 --- a/src/containers/my-cooperations/cooperation-completion/CooperationCompletion.styles.ts +++ b/src/containers/my-cooperations/cooperation-completion/CooperationCompletion.styles.ts @@ -18,14 +18,5 @@ export const styles = { dropdown: { maxWidth: '216px', ml: '15px' - }, - closeCooperationModal: { - text: { - padding: '30px' - }, - button: { - display: 'flex', - justifyContent: 'center' - } } } diff --git a/src/containers/my-cooperations/cooperation-details/CooperationDetails.tsx b/src/containers/my-cooperations/cooperation-details/CooperationDetails.tsx index e4637db67..0302b2451 100644 --- a/src/containers/my-cooperations/cooperation-details/CooperationDetails.tsx +++ b/src/containers/my-cooperations/cooperation-details/CooperationDetails.tsx @@ -46,7 +46,7 @@ import { setCooperationStatus, setIsActivityCreated } from '~/redux/features/cooperationsSlice' -import AcceptCooperationClosing from '../accept-cooperation-close/AcceptCooperationClosing' +import AcceptCooperationClosing from '~/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing' const CooperationDetails = () => { const dispatch = useAppDispatch() @@ -139,7 +139,7 @@ const CooperationDetails = () => { return cooperationContent } - const handleCooperationStatusUpdate = async () => { + const isCooperationStatusUpdated = async () => { await cooperationService.updateCooperation({ _id: id, status: StatusEnum.Closed @@ -149,7 +149,7 @@ const CooperationDetails = () => { } const handleCooperationCloseAccept = () => { - void handleCooperationStatusUpdate() + void isCooperationStatusUpdated() } const cooperationCompletionConditions = diff --git a/src/containers/my-cooperations/my-cooperations-details/MyCooperationsDetails.tsx b/src/containers/my-cooperations/my-cooperations-details/MyCooperationsDetails.tsx index 57c88b41d..0c6e3245e 100644 --- a/src/containers/my-cooperations/my-cooperations-details/MyCooperationsDetails.tsx +++ b/src/containers/my-cooperations/my-cooperations-details/MyCooperationsDetails.tsx @@ -133,7 +133,7 @@ const MyCooperationsDetails = () => { const handleCooperationStatusUpdate = async () => { const confirmed = await checkConfirmation({ - title: 'titles.confirmCooperationClosing', + title: t('titles.confirmCooperationClosing'), message: t('cooperationsPage.closeCooperationModal.message'), check: true })