import React, { useEffect } from "react"; import styled from "styled-components"; import { Field } from "redux-form"; import { FormBodyWrapper } from "./common"; import { createMessage, WELCOME_FORM_EMAIL_ID, WELCOME_FORM_FIRST_NAME, WELCOME_FORM_LAST_NAME, WELCOME_FORM_CREATE_PASSWORD, WELCOME_FORM_VERIFY_PASSWORD, CONTINUE, ONBOARDING_STATUS_GET_STARTED, PRODUCT_UPDATES_CONFIRMATION_LABEL, WELCOME_FORM_NON_SUPER_USER_USE_CASE, WELCOME_FORM_NON_SUPER_USER_PROFICIENCY_LEVEL, } from "@appsmith/constants/messages"; import FormTextField from "components/utils/ReduxFormTextField"; import type { FormErrors, InjectedFormProps } from "redux-form"; import { FormGroup } from "design-system-old"; import { Button, Checkbox } from "design-system"; import { proficiencyOptions, useCaseOptions } from "./constants"; import { isAirgapped } from "@appsmith/utils/airgapHelpers"; import { setFirstTimeUserOnboardingTelemetryCalloutVisibility } from "utils/storage"; import RadioButtonGroup from "components/editorComponents/RadioButtonGroup"; import { Space } from "./NonSuperUserProfilingQuestions"; export interface DetailsFormValues { firstName?: string; lastName?: string; email?: string; password?: string; verifyPassword?: string; proficiency?: string; useCase?: string; } export type SetupFormProps = DetailsFormValues & { formSyncErrors?: FormErrors; } & InjectedFormProps< DetailsFormValues, { formSyncErrors?: FormErrors; } >; const DetailsFormWrapper = styled.div` width: 100%; position: relative; `; const StyledFormBodyWrapper = styled(FormBodyWrapper)``; const StyledTabIndicatorWrapper = styled.div` display: flex; `; const StyledTabIndicator = styled.div<{ isFirstPage?: boolean }>` width: 48px; height: 3px; margin: 0 6px 0 0; background-color: ${(props) => props.isFirstPage ? `var(--ads-v2-color-bg-emphasis);` : `var(--ads-v2-color-bg-brand);`}; `; const StyledFormGroup = styled(FormGroup)` && > .bp3-label { color: var(--ads-v2-color-fg); } `; const ButtonWrapper = styled.div` display: flex; margin-top: ${(props) => props.theme.spaces[11]}px; gap: ${(props) => props.theme.spaces[4]}px; `; export default function DetailsForm( props: SetupFormProps & { isFirstPage: boolean } & { toggleFormPage: () => void; }, ) { const ref = React.createRef(); useEffect(() => { const setTelemetryVisibleFalse = async () => { await setFirstTimeUserOnboardingTelemetryCalloutVisibility(false); }; setTelemetryVisibleFalse(); }, []); return (
{!props.isFirstPage && (
{!isAirgapped() && ( {createMessage(PRODUCT_UPDATES_CONFIRMATION_LABEL)} )}
)} {props.isFirstPage && ( )} {!props.isFirstPage && ( )}
); }