UNPKG

@rocket.chat/onboarding-ui

Version:

Set of components and functions for the onboarding experience on Rocket.Chat

30 lines 3.84 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const fuselage_1 = require("@rocket.chat/fuselage"); const fuselage_hooks_1 = require("@rocket.chat/fuselage-hooks"); const layout_1 = require("@rocket.chat/layout"); const react_1 = require("react"); const react_hook_form_1 = require("react-hook-form"); const react_i18next_1 = require("react-i18next"); const AgreeTermsField_1 = __importDefault(require("../../../common/AgreeTermsField")); const RegisterOfflineForm_1 = require("../RegisterOfflineForm"); const CopyStep = ({ termsHref = 'https://rocket.chat/terms', policyHref = 'https://rocket.chat/privacy', clientKey, setStep, onCopySecurityCode, onBackButtonClick, }) => { const { t } = (0, react_i18next_1.useTranslation)(); const agreementField = (0, react_1.useId)(); const breakpoints = (0, fuselage_hooks_1.useBreakpoints)(); const isMobile = !breakpoints.includes('md'); const { control, formState: { isValid, errors }, } = (0, react_hook_form_1.useFormContext)(); const clipboard = (0, fuselage_hooks_1.useClipboard)(clientKey); return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(layout_1.Form.Container, { children: [(0, jsx_runtime_1.jsx)(fuselage_1.Box, { mbe: '24px', fontScale: 'p2', children: (0, jsx_runtime_1.jsxs)(react_i18next_1.Trans, { children: ["If for any reason your workspace can\u2019t be connected to the internet, follow these steps:", (0, jsx_runtime_1.jsx)(fuselage_1.Box, { mbe: '24px' }), "1. Go to: ", (0, jsx_runtime_1.jsx)("strong", { children: 'cloud.rocket.chat > Workspaces' }), " and click \u201C", (0, jsx_runtime_1.jsx)("strong", { children: "Register self-managed" }), "\u201D", (0, jsx_runtime_1.jsx)("br", {}), "2. Click \u201C", (0, jsx_runtime_1.jsx)("strong", { children: "Continue offline" }), "\u201D", (0, jsx_runtime_1.jsx)("br", {}), "3. In the ", (0, jsx_runtime_1.jsx)("strong", { children: "Register offline workspace" }), " dialog in cloud.rocket.chat, paste the token in the box below"] }, 'form.registerOfflineForm.copyStep.description') }), (0, jsx_runtime_1.jsxs)(fuselage_1.Box, { display: 'flex', flexDirection: 'column', alignItems: 'stretch', padding: 16, flexGrow: 1, backgroundColor: 'dark', children: [(0, jsx_runtime_1.jsx)(fuselage_1.Scrollable, { vertical: true, children: (0, jsx_runtime_1.jsx)(fuselage_1.Box, { height: 'x108', fontFamily: 'mono', fontScale: 'p2', color: 'white', style: { wordBreak: 'break-all' }, children: clientKey }) }), (0, jsx_runtime_1.jsx)(fuselage_1.Button, { icon: 'copy', primary: true, onClick: () => { onCopySecurityCode(); clipboard.copy(); } })] }), (0, jsx_runtime_1.jsx)(AgreeTermsField_1.default, { agreementField: agreementField, termsHref: termsHref, policyHref: policyHref, control: control, errors: errors })] }), (0, jsx_runtime_1.jsx)(layout_1.Form.Footer, { children: (0, jsx_runtime_1.jsx)(fuselage_1.Box, { display: 'flex', flexDirection: 'column', children: (0, jsx_runtime_1.jsxs)(fuselage_1.ButtonGroup, { vertical: isMobile, children: [(0, jsx_runtime_1.jsx)(fuselage_1.Button, { type: 'button', primary: true, disabled: !isValid, onClick: () => { setStep(RegisterOfflineForm_1.Steps.PASTE); }, children: t('component.form.action.next') }), (0, jsx_runtime_1.jsx)(fuselage_1.Button, { type: 'button', onClick: onBackButtonClick, children: t('component.form.action.back') })] }) }) })] })); }; exports.default = CopyStep; //# sourceMappingURL=CopyStep.js.map