-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add AppointmentMedicationWording to InPerson Phone & CC
- Loading branch information
1 parent
234e5f4
commit 5a695a3
Showing
11 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
.../Appointments/AppointmentTypeComponents/SharedComponents/AppointmentMedicationWording.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
import { Box, LinkWithAnalytics, TextView } from 'components' | ||
import { NAMESPACE } from 'constants/namespaces' | ||
import { | ||
AppointmentDetailsScreenType, | ||
AppointmentDetailsSubType, | ||
AppointmentDetailsSubTypeConstants, | ||
AppointmentDetailsTypeConstants, | ||
} from 'utils/appointments' | ||
import getEnv from 'utils/env' | ||
import { useRouteNavigation, useTheme } from 'utils/hooks' | ||
|
||
type AppointmentMedicationWordingProps = { | ||
subType: AppointmentDetailsSubType | ||
type: AppointmentDetailsScreenType | ||
} | ||
|
||
const { WEBVIEW_URL_WHAT_TO_BRING_TO_APPOINTMENTS } = getEnv() | ||
|
||
function AppointmentMedicationWording({ subType, type }: AppointmentMedicationWordingProps) { | ||
const theme = useTheme() | ||
const { t } = useTranslation(NAMESPACE.COMMON) | ||
const navigateTo = useRouteNavigation() | ||
|
||
switch (subType) { | ||
case AppointmentDetailsSubTypeConstants.Upcoming: | ||
case AppointmentDetailsSubTypeConstants.Canceled: | ||
switch (type) { | ||
case AppointmentDetailsTypeConstants.InPersonVA: | ||
case AppointmentDetailsTypeConstants.Phone: | ||
case AppointmentDetailsTypeConstants.CommunityCare: | ||
const body = t('appointmentsTab.medicationWording.default.body') | ||
return ( | ||
<Box mb={theme.dimensions.standardMarginBetween}> | ||
<TextView variant="MobileBodyBold" accessibilityRole="header"> | ||
{t('appointmentsTab.medicationWording.title')} | ||
</TextView> | ||
<TextView variant="MobileBody">{body}</TextView> | ||
<LinkWithAnalytics | ||
type="custom" | ||
icon={{ name: 'Launch' }} | ||
onPress={() => { | ||
navigateTo('Webview', { | ||
url: WEBVIEW_URL_WHAT_TO_BRING_TO_APPOINTMENTS, | ||
displayTitle: t('webview.vagov'), | ||
loadingMessage: t('loading'), | ||
}) | ||
}} | ||
text={t('appointmentsTab.medicationWording.whatToBringLink')} | ||
/> | ||
</Box> | ||
) | ||
default: | ||
return <></> | ||
} | ||
default: | ||
return <></> | ||
} | ||
} | ||
|
||
export default AppointmentMedicationWording |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters