plane/apps/app/components/onboarding/workspace.tsx
Aaryan Khandelwal a1b09fcbc6
style: onboarding screens (#1412)
* style: new onboarding screens

* chore: onboarding tour screens

* fix: build error

* fix: build errors

* style: default layout background

* chor: update user auth hook logic, style: new onboarding screens

* fix: component structure

* chore: tab responsiveness added

* fix: redirection logic

* style: welcome screens responsiveness

* chore: update workspace url input field

* style: mobile responsiveness added

* chore: complete onboarding workflow

* style: create workspace page design update

* style: workspace invitations page design update

* chore: update steps logic

* fix: step change logic

* style: tour steps
2023-07-12 19:55:08 +05:30

51 lines
1.3 KiB
TypeScript

import { useState } from "react";
// ui
import { SecondaryButton } from "components/ui";
// types
import { ICurrentUserResponse, OnboardingSteps } from "types";
// constants
import { CreateWorkspaceForm } from "components/workspace";
type Props = {
user: ICurrentUserResponse | undefined;
updateLastWorkspace: () => Promise<void>;
stepChange: (steps: Partial<OnboardingSteps>) => Promise<void>;
};
export const Workspace: React.FC<Props> = ({ user, updateLastWorkspace, stepChange }) => {
const [defaultValues, setDefaultValues] = useState({
name: "",
slug: "",
organization_size: "",
});
const completeStep = async () => {
if (!user) return;
await stepChange({
workspace_create: true,
});
await updateLastWorkspace();
};
return (
<div className="w-full space-y-7 sm:space-y-10">
<h4 className="text-xl sm:text-2xl font-semibold">Create your workspace</h4>
<div className="sm:w-3/4 md:w-2/5">
<CreateWorkspaceForm
onSubmit={completeStep}
defaultValues={defaultValues}
setDefaultValues={setDefaultValues}
user={user}
secondaryButton={
<SecondaryButton onClick={() => stepChange({ profile_complete: false })}>
Back
</SecondaryButton>
}
/>
</div>
</div>
);
};