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 90c1c547f..5561f595c 100644 --- a/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.styles.ts +++ b/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.styles.ts @@ -1,27 +1,5 @@ -import palette from '~/styles/app-theme/app.pallete' - export const styles = { - root: { - display: 'flex', - alignItems: 'center', - border: `1px solid ${palette.basic.pinkishRed}`, - backgroundColor: palette.basic.softGray, - borderRadius: '5px', - padding: '24px', - justifyContent: 'space-between', - gap: '16px' - }, - span: { - fontWeight: '500' - }, - title: { - color: palette.basic.mediumRed, - fontWeight: '500', - display: 'flex', - gap: '8px', - mb: '4px' - }, - body: { - color: palette.basic.darkGray + boldText: { + fontWeight: 500 } } diff --git a/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.tsx b/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.tsx index 543dc85c2..2bf0bb493 100644 --- a/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.tsx +++ b/src/containers/my-cooperations/accept-cooperation-close/AcceptCooperationClosing.tsx @@ -1,42 +1,44 @@ -import { Box, styled, Typography } from '@mui/material' -import { FC } from 'react' -import { styles } from './AcceptCooperationClosing.styles' import { ErrorOutlineRounded } from '@mui/icons-material' -import Button from '~/design-system/components/button/Button' +import { Typography } from '@mui/material' import { useTranslation } from 'react-i18next' +import CooperationActionBanner from '~/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner' +import Button from '~/design-system/components/button/Button' + +import { styles } from './AcceptCooperationClosing.styles' interface AcceptCooperationClosureProps { user: string onAccept: () => void } -const BoldText = styled('span')({ - fontWeight: 500 -}) - -const AcceptCooperationClosing: FC = ({ +const AcceptCooperationClosing: React.FC = ({ user, onAccept }) => { const { t } = useTranslation() + return ( - - - - - {t('titles.acceptCooperationClosing')} - - - {user} + + {t('cooperationDetailsPage.acceptBtn')} + + } + description={ + <> + + {user} + {t('cooperationDetailsPage.closingMessage1')} - {t('cooperationDetailsPage.accessDuration')} + + {t('cooperationDetailsPage.accessDuration')} + {t('cooperationDetailsPage.closingMessage2')} - - - - + + } + icon={} + title={t('titles.acceptCooperationClosing')} + /> ) } diff --git a/src/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.styles.ts b/src/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.styles.ts new file mode 100644 index 000000000..3848d1301 --- /dev/null +++ b/src/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.styles.ts @@ -0,0 +1,44 @@ +import { type SxProps } from '@mui/material' + +import palette from '~/styles/app-theme/app.pallete' + +export const styles = { + container: { + display: 'flex', + flexDirection: 'column', + rowGap: '20px', + padding: '24px', + border: `1px solid ${palette.basic.pinkishRed}`, + borderRadius: '5px', + backgroundColor: palette.basic.softGray + }, + header: { + display: 'flex', + alignItems: 'center', + columnGap: '8px', + color: palette.basic.mediumRed + }, + description: { + color: palette.basic.darkGray, + marginTop: '4px' + }, + mainContentWrapper: { + width: '100%', + display: 'flex', + flexDirection: { + xs: 'column', + sm: 'row' + }, + justifyContent: 'space-between', + gap: '30px' + }, + buttonsWrapper: { + display: 'flex', + columnGap: '15px', + alignItems: 'center', + alignSelf: { + xs: 'end', + sm: 'auto' + } + } +} satisfies Record diff --git a/src/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.tsx b/src/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.tsx new file mode 100644 index 000000000..0ffdafb17 --- /dev/null +++ b/src/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.tsx @@ -0,0 +1,38 @@ +import { Box, Typography } from '@mui/material' + +import { type ReactNode } from 'react' +import { styles } from './CooperationActionBanner.styles' + +type Properties = { + actionButtons?: ReactNode + children?: ReactNode + description: ReactNode + icon?: ReactNode + title: string +} + +const CooperationActionBanner: React.FC = ({ + actionButtons, + children, + description, + icon, + title +}) => { + return ( + + + + + {icon} + {title} + + {description} + + {actionButtons && {actionButtons}} + + {children && {children}} + + ) +} + +export default CooperationActionBanner diff --git a/tests/unit/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.spec.jsx b/tests/unit/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.spec.jsx new file mode 100644 index 000000000..54c92879b --- /dev/null +++ b/tests/unit/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner.spec.jsx @@ -0,0 +1,34 @@ +import { ErrorOutlineRounded } from '@mui/icons-material' +import { render, screen } from '@testing-library/react' +import { beforeEach, expect } from 'vitest' + +import CooperationActionBanner from '~/containers/my-cooperations/cooperation-action-banner/CooperationActionBanner' + +describe('CooperationActionBanner', () => { + beforeEach(() => { + render( + } + /> + ) + }) + + it('should render the CooperationActionBanner with title, description, icon and children', () => { + const titleText = screen.getByText('titles.acceptCooperationClosing') + const descriptionText = screen.getByText( + 'cooperationDetailsPage.closingMessage' + ) + const childrenContent = screen.getByText( + 'cooperationDetailsPage.someAdditionalText' + ) + const icon = screen.getByTestId('icon-example') + + expect(titleText).toBeInTheDocument() + expect(descriptionText).toBeInTheDocument() + expect(childrenContent).toBeInTheDocument() + expect(icon).toBeInTheDocument() + }) +})