UNPKG

@oxyhq/services

Version:

OxyHQ Expo/React Native SDK — UI components, screens, and native features

135 lines (134 loc) 5.92 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 _index = require("../components/index.js"); var _useI18n = require("../hooks/useI18n.js"); var _useThemeStyles = require("../hooks/useThemeStyles.js"); var _useColorScheme = require("../hooks/useColorScheme.js"); 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, navigate }) => { const { t } = (0, _useI18n.useI18n)(); const colorScheme = (0, _useColorScheme.useColorScheme)(); const themeStyles = (0, _useThemeStyles.useThemeStyles)(theme || 'light', colorScheme); const handleContactSupport = (0, _react.useMemo)(() => () => { _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)(() => () => { if (navigate) { navigate('FAQ'); } else { _sonner.toast.info(t('help.faqComing') || 'FAQ coming soon'); } }, [navigate, t]); const handleReportBug = (0, _react.useMemo)(() => () => { // TODO: Consider implementing a dedicated bug report form instead of just email _reactNative.Linking.openURL('mailto:bugs@oxy.so?subject=Bug Report').catch(() => { _sonner.toast.error(t('help.reportError') || 'Failed to open email client'); }); }, [t]); return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: [styles.container, { backgroundColor: themeStyles.backgroundColor }], children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Header, { title: t('help.title') || 'Help & Support', onBack: goBack || onClose, variant: "minimal", elevation: "subtle" }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, { style: styles.content, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Section, { title: t('help.options') || 'Get Help', isFirst: true, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.GroupedSection, { items: [{ id: 'faq', icon: 'help-circle', iconColor: themeStyles.colors.iconSecurity, 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: themeStyles.colors.iconPersonalInfo, 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: themeStyles.colors.iconStorage, title: t('help.reportBug.title') || 'Report a Bug', subtitle: t('help.reportBug.subtitle') || 'Help us improve by reporting issues', onPress: handleReportBug }] }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Section, { title: t('help.resources') || 'Resources', children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.GroupedSection, { items: [{ id: 'documentation', icon: 'file-document', iconColor: '#8E8E93', title: t('help.documentation.title') || 'Documentation', subtitle: t('help.documentation.subtitle') || 'User guides and tutorials', onPress: () => { _reactNative.Linking.openURL('https://developer.oxy.so/docs').catch(() => { _sonner.toast.error(t('help.linkError') || 'Failed to open link'); }); } }, { id: 'community', icon: 'account-group', iconColor: themeStyles.colors.iconData, 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'); }); } }, { id: 'developers-portal', icon: 'code-tags', iconColor: themeStyles.colors.iconSharing, title: t('help.developersPortal.title') || 'Developers Portal', subtitle: t('help.developersPortal.subtitle') || 'API documentation and developer resources', onPress: () => { _reactNative.Linking.openURL('https://developer.oxy.so').catch(() => { _sonner.toast.error(t('help.linkError') || 'Failed to open link'); }); } }] }) })] })] }); }; 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