Skip to content

Commit

Permalink
Modifications to use new design system snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
oddballdave committed Dec 14, 2024
1 parent b9d4b2c commit d0c2f9a
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,27 @@ import { Alert, Pressable } from 'react-native'
import { StackScreenProps } from '@react-navigation/stack/lib/typescript/src/types'

import { Button } from '@department-of-veterans-affairs/mobile-component-library'
import { useSnackbar } from '@department-of-veterans-affairs/mobile-component-library'
import { RootNavStackParamList } from 'App'

import { BorderColorVariant, Box, LargePanel, RadioGroup, RadioGroupProps, TextView, VATextInput } from 'components'
import { Events } from 'constants/analytics'
import { NAMESPACE } from 'constants/namespaces'
import { logAnalyticsEvent } from 'utils/analytics'
import { checkStringForPII, showSnackBar } from 'utils/common'
import { checkStringForPII } from 'utils/common'
import getEnv from 'utils/env'
import { useAppDispatch, useBeforeNavBackListener, useExternalLink, useTheme } from 'utils/hooks'
import { useBeforeNavBackListener, useExternalLink, useTheme } from 'utils/hooks'

const { LINK_URL_OMB_PAGE } = getEnv()

type InAppFeedbackScreenProps = StackScreenProps<RootNavStackParamList, 'InAppFeedback'>

function InAppFeedbackScreen({ navigation, route }: InAppFeedbackScreenProps) {
const snackbar = useSnackbar()
const { t } = useTranslation(NAMESPACE.COMMON)
const theme = useTheme()
const [satisfaction, setSatisfaction] = useState('')
const [task, setTaskOverride] = useState('')
const dispatch = useAppDispatch()
const { screen } = route.params
let submittedCheck = false
const launchExternalLink = useExternalLink()
Expand All @@ -50,7 +51,7 @@ function InAppFeedbackScreen({ navigation, route }: InAppFeedbackScreenProps) {
logAnalyticsEvent(Events.vama_feedback_submitted(screen, newText, satisfaction))
submittedCheck = true
navigation.goBack()
showSnackBar(t('inAppFeedback.snackbar.success'), dispatch, undefined, true, false, false)
snackbar.show(t('inAppFeedback.snackbar.success'))
},
style: 'default',
},
Expand All @@ -59,7 +60,7 @@ function InAppFeedbackScreen({ navigation, route }: InAppFeedbackScreenProps) {
logAnalyticsEvent(Events.vama_feedback_submitted(screen, task, satisfaction))
submittedCheck = true
navigation.goBack()
showSnackBar(t('inAppFeedback.snackbar.success'), dispatch, undefined, true, false, false)
snackbar.show(t('inAppFeedback.snackbar.success'))
}
}

Expand Down

0 comments on commit d0c2f9a

Please sign in to comment.