From 9af50c4dcde41b0146b83d0faad42c028c2a623f Mon Sep 17 00:00:00 2001 From: Raju kadel Date: Wed, 25 Sep 2024 10:37:16 +0545 Subject: [PATCH 1/3] fix: make safe actions as client component --- src/components/safe/safe-actions.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/safe/safe-actions.tsx b/src/components/safe/safe-actions.tsx index 651c23196..3eb23069d 100644 --- a/src/components/safe/safe-actions.tsx +++ b/src/components/safe/safe-actions.tsx @@ -1,3 +1,5 @@ +"use client"; + import { Button } from "@/components/ui/button"; import { DropdownMenu, From ee7905c4165278e31830b308824a2e43bcfa3eee Mon Sep 17 00:00:00 2001 From: Raju kadel Date: Wed, 25 Sep 2024 13:04:32 +0545 Subject: [PATCH 2/3] fix: default selection of incorporation type inside company settings --- src/components/onboarding/company-form.tsx | 33 +++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/components/onboarding/company-form.tsx b/src/components/onboarding/company-form.tsx index aa4f14796..db29d4ee6 100644 --- a/src/components/onboarding/company-form.tsx +++ b/src/components/onboarding/company-form.tsx @@ -194,11 +194,30 @@ export const CompanyForm = ({ type, data }: CompanyFormProps) => { const isDirty = form.formState.isDirty; + type IncorpType = "llc" | "c-corp" | "s-corp" | "other"; + + const existingIncorpType = data?.company.incorporationType as IncorpType; + + const humanizeIncorpType = (key: IncorpType) => { + switch (key) { + case "llc": + return "LLC - Limited Liability Company"; + case "c-corp": + return "C-Corp - C Corporation"; + case "s-corp": + return "S-Corp - S Corporation"; + case "other": + return "Others or International"; + default: + return "Unknown Incorporation Type"; + } + }; + const incorpTypeOpts = [ - { value: "llc", label: "LLC - Limited Liability Company" }, - { value: "c-corp", label: "C-Corp - C Corporation" }, - { value: "s-corp", label: "S-Corp - S Corporation" }, - { value: "other", label: "Others or International" }, + { value: "llc", label: humanizeIncorpType("llc") }, + { value: "c-corp", label: humanizeIncorpType("c-corp") }, + { value: "s-corp", label: humanizeIncorpType("s-corp") }, + { value: "other", label: humanizeIncorpType("other") }, ]; return ( @@ -425,6 +444,12 @@ export const CompanyForm = ({ type, data }: CompanyFormProps) => { {/* Used Linear-combobox instead of Select Component */}
{ field.onChange(option.value); From 5069b90c5ac5d1ba20ebbc62f4e8a3751ceb137e Mon Sep 17 00:00:00 2001 From: Raju kadel Date: Wed, 25 Sep 2024 13:08:54 +0545 Subject: [PATCH 3/3] chore: remove unwanted code --- src/components/safe/safe-actions.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/safe/safe-actions.tsx b/src/components/safe/safe-actions.tsx index 3eb23069d..651c23196 100644 --- a/src/components/safe/safe-actions.tsx +++ b/src/components/safe/safe-actions.tsx @@ -1,5 +1,3 @@ -"use client"; - import { Button } from "@/components/ui/button"; import { DropdownMenu,