diff --git a/packages/legacy/core/App/components/tour/CredentialOfferTourSteps.tsx b/packages/legacy/core/App/components/tour/CredentialOfferTourSteps.tsx index a3f4d1802..71a1015e0 100644 --- a/packages/legacy/core/App/components/tour/CredentialOfferTourSteps.tsx +++ b/packages/legacy/core/App/components/tour/CredentialOfferTourSteps.tsx @@ -6,7 +6,7 @@ import { useTheme } from '../../contexts/theme' import { RenderProps, TourStep } from '../../contexts/tour/tour-context' import { TourBox } from './TourBox' -import useHandleStop from '../../hooks/close-modal-tour' +import useCloseModalTour from '../../hooks/close-modal-tour' import { DispatchAction } from '../../contexts/reducers/store' export const credentialOfferTourSteps: TourStep[] = [ @@ -15,18 +15,18 @@ export const credentialOfferTourSteps: TourStep[] = [ const { currentTour, currentStep, next, stop, previous } = props const { t } = useTranslation() const { ColorPallet, TextTheme } = useTheme() - const handleStop = useHandleStop() + const closeModalTour = useCloseModalTour() return ( handleStop(stop, DispatchAction.UPDATE_SEEN_CREDENTIAL_OFFER_TOUR)} + onRight={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_CREDENTIAL_OFFER_TOUR)} currentTour={currentTour} currentStep={currentStep} previous={previous} - stop={() => handleStop(stop, DispatchAction.UPDATE_SEEN_CREDENTIAL_OFFER_TOUR)} + stop={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_CREDENTIAL_OFFER_TOUR)} next={next} > handleStop(stop, DispatchAction.UPDATE_SEEN_CREDENTIALS_TOUR)} + onRight={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_CREDENTIALS_TOUR)} currentTour={currentTour} currentStep={currentStep} previous={previous} - stop={() => handleStop(stop, DispatchAction.UPDATE_SEEN_CREDENTIALS_TOUR)} + stop={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_CREDENTIALS_TOUR)} next={next} > { + const { ColorPallet, TextTheme } = useTheme() + + const textStyle: TextStyle = { + ...TextTheme.normal, + color: ColorPallet.notification.infoText, + } + + return { textStyle } +} + export const homeTourSteps: TourStep[] = [ { Render: (props: RenderProps) => { const { currentTour, currentStep, next, stop, previous } = props const { t } = useTranslation() - const { ColorPallet, TextTheme } = useTheme() - const handleStop = useHandleStop() + const { textStyle } = useCommonStyles() + const closeModalTour = useCloseModalTour() return ( handleStop(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} + onLeft={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} onRight={next} currentTour={currentTour} currentStep={currentStep} previous={previous} - stop={() => handleStop(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} + stop={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} next={next} > - + {t('Tour.AddAndShareDescription')} @@ -47,8 +52,8 @@ export const homeTourSteps: TourStep[] = [ Render: (props: RenderProps) => { const { currentTour, currentStep, next, stop, previous } = props const { t } = useTranslation() - const { ColorPallet, TextTheme } = useTheme() - const handleStop = useHandleStop() + const { textStyle } = useCommonStyles() + const closeModalTour = useCloseModalTour() return ( handleStop(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} + stop={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} previous={previous} > - + {t('Tour.NotificationsDescription')} @@ -80,8 +79,8 @@ export const homeTourSteps: TourStep[] = [ Render: (props: RenderProps) => { const { currentTour, currentStep, next, stop, previous } = props const { t } = useTranslation() - const { ColorPallet, TextTheme } = useTheme() - const handleStop = useHandleStop() + const { textStyle } = useCommonStyles() + const closeModalTour = useCloseModalTour() return ( handleStop(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} + onRight={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} currentTour={currentTour} currentStep={currentStep} next={next} - stop={() => handleStop(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} + stop={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_HOME_TOUR)} previous={previous} > - + {t('Tour.YourCredentialsDescription')} diff --git a/packages/legacy/core/App/components/tour/ProofRequestTourSteps.tsx b/packages/legacy/core/App/components/tour/ProofRequestTourSteps.tsx index 5a7991289..7bbb765d4 100644 --- a/packages/legacy/core/App/components/tour/ProofRequestTourSteps.tsx +++ b/packages/legacy/core/App/components/tour/ProofRequestTourSteps.tsx @@ -6,7 +6,7 @@ import { useTheme } from '../../contexts/theme' import { RenderProps, TourStep } from '../../contexts/tour/tour-context' import { TourBox } from './TourBox' -import useHandleStop from '../../hooks/close-modal-tour' +import useCloseModalTour from '../../hooks/close-modal-tour' import { DispatchAction } from '../../contexts/reducers/store' export const proofRequestTourSteps: TourStep[] = [ @@ -15,18 +15,18 @@ export const proofRequestTourSteps: TourStep[] = [ const { currentTour, currentStep, next, stop, previous } = props const { t } = useTranslation() const { ColorPallet, TextTheme } = useTheme() - const handleStop = useHandleStop() + const closeModalTour = useCloseModalTour() return ( handleStop(stop, DispatchAction.UPDATE_SEEN_PROOF_REQUEST_TOUR)} + onRight={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_PROOF_REQUEST_TOUR)} currentTour={currentTour} currentStep={currentStep} previous={previous} - stop={() => handleStop(stop, DispatchAction.UPDATE_SEEN_PROOF_REQUEST_TOUR)} + stop={() => closeModalTour(stop, DispatchAction.UPDATE_SEEN_PROOF_REQUEST_TOUR)} next={next} > { +const useCloseModalTour = () => { const [, dispatch] = useStore() const handleStop = useCallback( @@ -18,4 +18,4 @@ const useHandleStop = () => { return handleStop } -export default useHandleStop +export default useCloseModalTour diff --git a/packages/legacy/core/App/index.ts b/packages/legacy/core/App/index.ts index 40c3af6dd..992c6da8e 100644 --- a/packages/legacy/core/App/index.ts +++ b/packages/legacy/core/App/index.ts @@ -55,6 +55,7 @@ import { CredentialListFooterProps } from './types/credential-list-footer' import { OpenIDCredentialRecordProvider } from './modules/openid/context/OpenIDCredentialRecordProvider' import { defaultConfig, defaultHistoryEventsLogger } from './container-impl' import useInitializeAgent from './hooks/initialize-agent' +import useCloseModalTour from './hooks/close-modal-tour' import { DefaultScreenLayoutOptions } from './navigators/defaultLayoutOptions' export * from './navigators' @@ -83,7 +84,13 @@ export { BifoldError } from './types/error' export { EventTypes } from './constants' export { migrateToAskar } from './utils/migration' export { createLinkSecretIfRequired, getAgentModules } from './utils/agent' -export { removeExistingInvitationIfRequired, connectFromScanOrDeepLink, formatTime, useCredentialConnectionLabel, getConnectionName } from './utils/helpers' +export { + removeExistingInvitationIfRequired, + connectFromScanOrDeepLink, + formatTime, + useCredentialConnectionLabel, + getConnectionName, +} from './utils/helpers' export { isValidAnonCredsCredential, getCredentialIdentifiers } from './utils/credential' export { buildFieldsFromAnonCredsCredential } from './utils/oca' @@ -173,6 +180,7 @@ export { NotificationListItem, useDefaultStackOptions, useInitializeAgent, + useCloseModalTour, Splash, Developer, Terms,