import React, { useEffect, useMemo, useState } from "react"; import styled from "styled-components"; import { Field } from "redux-form"; import { DropdownWrapper, FormBodyWrapper, withDropdown } from "./common"; import { createMessage, WELCOME_FORM_EMAIL_ID, WELCOME_FORM_FIRST_NAME, WELCOME_FORM_LAST_NAME, WELCOME_FORM_CREATE_PASSWORD, WELCOME_FORM_VERIFY_PASSWORD, WELCOME_FORM_ROLE_DROPDOWN, WELCOME_FORM_ROLE, WELCOME_FORM_USE_CASE, WELCOME_FORM_CUSTOM_USE_CASE, WELCOME_FORM_ROLE_DROPDOWN_PLACEHOLDER, WELCOME_FORM_USE_CASE_PLACEHOLDER, CONTINUE, ONBOARDING_STATUS_GET_STARTED, } from "@appsmith/constants/messages"; import FormTextField from "components/utils/ReduxFormTextField"; import type { SetupFormProps } from "./SetupForm"; import { ButtonWrapper } from "pages/Applications/ForkModalStyles"; import { FormGroup } from "design-system-old"; import { Button, Checkbox } from "design-system"; import { roleOptions, useCaseOptions } from "./constants"; import { isAirgapped } from "@appsmith/utils/airgapHelpers"; import { setFirstTimeUserOnboardingTelemetryCalloutVisibility } from "utils/storage"; 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); } `; export default function DetailsForm( props: SetupFormProps & { onNext?: () => void }, ) { const ref = React.createRef(); const [formState, setFormState] = useState(0); const isFirstPage = useMemo(() => formState === 0, [formState]); useEffect(() => { const setTelemetryVisibleFalse = async () => { await setFirstTimeUserOnboardingTelemetryCalloutVisibility(false); }; setTelemetryVisibleFalse(); }, []); return (
{!isFirstPage && (
{props.role == "other" && ( )} {props.useCase == "other" && ( )} {!isAirgapped() && ( I want security and product updates. )}
)} {isFirstPage && ( )} {!isFirstPage && ( )}
); }