@oxyhq/services
Version:
Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀
159 lines (158 loc) • 5.38 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _vectorIcons = require("@expo/vector-icons");
var _GroupedPillButtons = _interopRequireDefault(require("../../components/internal/GroupedPillButtons"));
var _useI18n = require("../../hooks/useI18n");
var _spacing = require("../../styles/spacing");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const RecoverSuccessStep = ({
colors,
styles,
navigate,
allStepData,
successMessage
}) => {
const {
t
} = (0, _useI18n.useI18n)();
const baseStyles = _spacing.stepStyles;
// Extract identifier from previous steps
const requestData = allStepData[0] || {};
const {
identifier
} = requestData;
const handleContinueToReset = () => {
// Navigate back to SignIn and let host app open its reset flow
navigate('SignIn', {
showReset: true,
identifier
});
};
const handleBackToSignIn = () => {
navigate('SignIn');
};
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
style: [baseStyles.container, baseStyles.sectionSpacing, stylesheet.iconContainer],
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
style: [stylesheet.successIcon, {
backgroundColor: colors.success + '20'
}],
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
name: "checkmark-circle",
size: 40,
color: colors.success
})
})
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
style: [baseStyles.container, baseStyles.sectionSpacing, baseStyles.header],
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [styles.modernTitle, baseStyles.title, {
color: colors.text,
marginBottom: 0,
marginTop: 0
}],
children: t('recover.title')
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [styles.modernSubtitle, baseStyles.subtitle, {
color: colors.secondaryText,
marginBottom: 0,
marginTop: 0
}],
children: successMessage || t('recover.resetSuccess')
})]
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
style: [baseStyles.container, baseStyles.sectionSpacing],
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
style: [stylesheet.infoCard, {
backgroundColor: colors.inputBackground,
borderColor: colors.border
}],
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [styles.footerText, stylesheet.infoTitle, {
color: colors.text
}],
children: t('recover.whatsNextTitle') || "What's next?"
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [styles.footerText, stylesheet.infoBody, {
color: colors.secondaryText
}],
children: t('recover.whatsNextBody') || 'You can now reset your password or return to sign in with your existing credentials.'
})]
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
style: [stylesheet.successBanner, {
backgroundColor: colors.success + '10',
borderColor: colors.success + '30'
}],
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
name: "shield-checkmark",
size: 20,
color: colors.success
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
style: [styles.footerText, stylesheet.bannerText, {
color: colors.success
}],
children: successMessage || t('recover.completeSecure') || 'Your account recovery is complete and secure.'
})]
})]
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
style: [baseStyles.container, baseStyles.sectionSpacing, baseStyles.buttonContainer],
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
buttons: [{
text: t('common.actions.signIn'),
onPress: handleBackToSignIn,
icon: 'arrow-back',
variant: 'transparent'
}],
colors: colors
})
})]
});
};
var _default = exports.default = RecoverSuccessStep;
const stylesheet = _reactNative.StyleSheet.create({
iconContainer: {
alignItems: 'center',
justifyContent: 'center'
},
successIcon: {
width: 80,
height: 80,
borderRadius: 40,
alignItems: 'center',
justifyContent: 'center'
},
infoCard: {
padding: _spacing.STEP_INNER_GAP * 2,
borderRadius: 16,
borderWidth: 1,
marginBottom: _spacing.STEP_INNER_GAP,
gap: _spacing.STEP_INNER_GAP
},
infoTitle: {
fontSize: 16,
marginBottom: 0
},
infoBody: {
fontSize: 14,
lineHeight: 20
},
successBanner: {
flexDirection: 'row',
alignItems: 'center',
padding: _spacing.STEP_INNER_GAP,
borderRadius: 8,
borderWidth: 1,
gap: _spacing.STEP_INNER_GAP
},
bannerText: {
flex: 1,
fontSize: 14
}
});
//# sourceMappingURL=RecoverSuccessStep.js.map