UNPKG

@oxyhq/services

Version:

Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀

131 lines (130 loc) • 5.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireWildcard(require("react")); var _reactNative = require("react-native"); var _sonner = require("../../lib/sonner"); var _components = require("../components"); var _useI18n = require("../hooks/useI18n"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } const HelpSupportScreen = ({ onClose, theme, goBack }) => { const { t } = (0, _useI18n.useI18n)(); const handleContactSupport = (0, _react.useMemo)(() => () => { // In a real implementation, this would open a contact form or email _reactNative.Linking.openURL('mailto:support@oxy.so?subject=Support Request').catch(() => { _sonner.toast.error(t('help.contactError') || 'Failed to open email client'); }); }, [t]); const handleFAQ = (0, _react.useMemo)(() => () => { // In a real implementation, this would navigate to FAQ screen _sonner.toast.info(t('help.faqComing') || 'FAQ coming soon'); }, [t]); const handleReportBug = (0, _react.useMemo)(() => () => { // In a real implementation, this would open a bug report form _reactNative.Linking.openURL('mailto:bugs@oxy.so?subject=Bug Report').catch(() => { _sonner.toast.error(t('help.reportError') || 'Failed to open email client'); }); }, [t]); const themeStyles = (0, _react.useMemo)(() => { const isDarkTheme = theme === 'dark'; return { textColor: isDarkTheme ? '#FFFFFF' : '#000000', backgroundColor: isDarkTheme ? '#121212' : '#FFFFFF', secondaryBackgroundColor: isDarkTheme ? '#222222' : '#F5F5F5', borderColor: isDarkTheme ? '#444444' : '#E0E0E0' }; }, [theme]); return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: [styles.container, { backgroundColor: themeStyles.backgroundColor }], children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Header, { title: t('help.title') || 'Help & Support', theme: theme, onBack: goBack || onClose, variant: "minimal", elevation: "subtle" }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, { style: styles.content, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Section, { title: t('help.options') || 'Get Help', theme: theme, isFirst: true, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GroupedSection, { items: [{ id: 'faq', icon: 'help-circle', iconColor: '#007AFF', title: t('help.faq.title') || 'Frequently Asked Questions', subtitle: t('help.faq.subtitle') || 'Find answers to common questions', onPress: handleFAQ }, { id: 'contact', icon: 'mail', iconColor: '#32D74B', title: t('help.contact.title') || 'Contact Support', subtitle: t('help.contact.subtitle') || 'Get help from our support team', onPress: handleContactSupport }, { id: 'report-bug', icon: 'bug', iconColor: '#FF9500', title: t('help.reportBug.title') || 'Report a Bug', subtitle: t('help.reportBug.subtitle') || 'Help us improve by reporting issues', onPress: handleReportBug }], theme: theme }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Section, { title: t('help.resources') || 'Resources', theme: theme, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GroupedSection, { items: [{ id: 'documentation', icon: 'document-text', iconColor: '#8E8E93', title: t('help.documentation.title') || 'Documentation', subtitle: t('help.documentation.subtitle') || 'User guides and tutorials', onPress: () => { _reactNative.Linking.openURL('https://docs.oxy.so').catch(() => { _sonner.toast.error(t('help.linkError') || 'Failed to open link'); }); } }, { id: 'community', icon: 'people', iconColor: '#5856D6', title: t('help.community.title') || 'Community', subtitle: t('help.community.subtitle') || 'Join our community', onPress: () => { _reactNative.Linking.openURL('https://community.oxy.so').catch(() => { _sonner.toast.error(t('help.linkError') || 'Failed to open link'); }); } }], theme: theme }) })] })] }); }; const styles = _reactNative.StyleSheet.create({ container: { flex: 1 }, content: { flex: 1, padding: 16 } }); var _default = exports.default = /*#__PURE__*/_react.default.memo(HelpSupportScreen); //# sourceMappingURL=HelpSupportScreen.js.map