|
1 | | -import React, { useContext } from 'react' |
2 | | -import { GraphicalIcon, Icon } from '@/components/common' |
| 1 | +import React from 'react' |
| 2 | +import { Icon } from '@/components/common' |
3 | 3 | import { FormButton } from '@/components/common/FormButton' |
4 | 4 | import { ErrorBoundary, ErrorMessage } from '@/components/ErrorBoundary' |
5 | | -import { SenioritySurveyModalContext } from './SenioritySurveyModal' |
6 | 5 | import { useAppTranslation } from '@/i18n/useAppTranslation' |
7 | 6 | import { Trans } from 'react-i18next' |
| 7 | +import { MutationStatus } from '@tanstack/react-query' |
8 | 8 |
|
9 | 9 | const DEFAULT_ERROR = new Error('Unable to dismiss modal') |
10 | 10 |
|
11 | | -export function BootcampAdvertismentView() { |
12 | | - const { patchCloseModal, links } = useContext(SenioritySurveyModalContext) |
| 11 | +type BootcampAdvertismentViewProps = { |
| 12 | + patchCloseModal: { |
| 13 | + mutate: () => void |
| 14 | + status: string |
| 15 | + error: unknown |
| 16 | + } |
| 17 | + links: { |
| 18 | + codingFundamentalsCourse: string |
| 19 | + } |
| 20 | +} |
| 21 | + |
| 22 | +export function BootcampAdvertismentView({ |
| 23 | + patchCloseModal, |
| 24 | + links, |
| 25 | +}: BootcampAdvertismentViewProps) { |
13 | 26 | const { t } = useAppTranslation('components/modals/seniority-survey-modal') |
14 | 27 |
|
15 | 28 | return ( |
@@ -86,7 +99,7 @@ export function BootcampAdvertismentView() { |
86 | 99 | {t('bootcampAd.learnMore')} |
87 | 100 | </a> |
88 | 101 | <FormButton |
89 | | - status={patchCloseModal.status} |
| 102 | + status={patchCloseModal.status as MutationStatus} |
90 | 103 | className="btn-secondary btn-l w-[140px]" |
91 | 104 | type="button" |
92 | 105 | onClick={patchCloseModal.mutate} |
|
0 commit comments