UNPKG

@rocket.chat/onboarding-ui

Version:

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

18 lines 2.62 kB
"use strict"; 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_hook_form_1 = require("react-hook-form"); const react_i18next_1 = require("react-i18next"); const RegisterOfflineForm_1 = require("../RegisterOfflineForm"); const PasteStep = ({ setStep }) => { const { t } = (0, react_i18next_1.useTranslation)(); const breakpoints = (0, fuselage_hooks_1.useBreakpoints)(); const isMobile = !breakpoints.includes('md'); const { register, formState: { isSubmitting, isValidating, isSubmitSuccessful }, } = (0, react_hook_form_1.useFormContext)(); 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: ["1. In ", (0, jsx_runtime_1.jsx)("strong", { children: "cloud.rocket.chat" }), " get the generated text and paste below to complete your registration process"] }, 'form.registerOfflineForm.pasteStep.description') }), (0, jsx_runtime_1.jsx)(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, { ...register('token', { required: true }), is: 'textarea', backgroundColor: 'dark', height: 'x108', fontFamily: 'mono', fontScale: 'p2', color: 'white', style: { wordBreak: 'break-all', resize: 'none' }, placeholder: t('component.form.action.pasteHere'), autoComplete: 'off', autoCorrect: 'off', autoCapitalize: 'off', spellCheck: 'false' }) }) })] }), (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: 'submit', primary: true, loading: isSubmitting || isValidating, disabled: isSubmitSuccessful, children: t('component.form.action.completeRegistration') }), (0, jsx_runtime_1.jsx)(fuselage_1.Button, { type: 'button', onClick: () => setStep(RegisterOfflineForm_1.Steps.COPY), children: t('component.form.action.back') })] }) }) })] })); }; exports.default = PasteStep; //# sourceMappingURL=PasteStep.js.map