UNPKG

@brightlayer-ui/react-native-auth-workflow

Version:

Re-usable workflow components for Authentication and Registration within Eaton applications.

39 lines (38 loc) 2.91 kB
import React from 'react'; import { WorkflowCard, WorkflowCardActions, WorkflowCardBody, WorkflowCardHeader } from '../../components/WorkflowCard'; import { Text } from 'react-native-paper'; import { View } from 'react-native'; import { Icon } from '@brightlayer-ui/react-native-components'; import { useExtendedTheme } from '@brightlayer-ui/react-native-themes'; /** * Component renders a screen with contact information for support with the application. * Contact information is pulled from the context passed into the workflow. * * @param {ContactSupportScreenProps} props - Props of Create Account Screen * * @category Component */ export const ContactSupportScreenBase = (props) => { var _a, _b, _c, _d; const { icon, iconSize, emailSupportTitle, emailSupportContent, phoneSupportTitle, phoneSupportContent, contactEmail, contactPhone, dismissButtonLabel, onDismiss, } = props; const theme = useExtendedTheme(); const cardBaseProps = (_a = props.WorkflowCardBaseProps) !== null && _a !== void 0 ? _a : {}; const headerProps = (_b = props.WorkflowCardHeaderProps) !== null && _b !== void 0 ? _b : {}; const cardBodyProps = (_c = props.WorkflowCardBodyProps) !== null && _c !== void 0 ? _c : {}; const actionsProps = (_d = props.WorkflowCardActionsProps) !== null && _d !== void 0 ? _d : {}; return (React.createElement(WorkflowCard, Object.assign({}, cardBaseProps), React.createElement(WorkflowCardHeader, Object.assign({}, headerProps)), icon && (React.createElement(View, { style: { alignItems: 'center', marginTop: 48, marginBottom: 16 } }, React.createElement(Icon, { source: icon, size: iconSize !== null && iconSize !== void 0 ? iconSize : 24, color: theme.colors.disabled }))), React.createElement(WorkflowCardBody, Object.assign({}, cardBodyProps), React.createElement(Text, { variant: 'bodyLarge', style: { marginBottom: 8 } }, emailSupportTitle), React.createElement(React.Fragment, null, emailSupportContent === null || emailSupportContent === void 0 ? void 0 : emailSupportContent(contactEmail !== null && contactEmail !== void 0 ? contactEmail : '')), React.createElement(Text, { variant: 'bodyLarge', style: { marginBottom: 8, marginTop: 32 } }, phoneSupportTitle), React.createElement(React.Fragment, null, phoneSupportContent === null || phoneSupportContent === void 0 ? void 0 : phoneSupportContent(contactPhone !== null && contactPhone !== void 0 ? contactPhone : ''))), React.createElement(WorkflowCardActions, Object.assign({}, actionsProps, { nextLabel: dismissButtonLabel !== null && dismissButtonLabel !== void 0 ? dismissButtonLabel : actionsProps.nextLabel, onNext: () => { if (onDismiss) onDismiss(); if (actionsProps.onNext) actionsProps.onNext(); } })))); };