Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🚚 Rename new space dialog

Luke Vella4fcf216e6c1f
diff --git a/apps/web/src/features/spaces/components/new-space-dialog.tsx b/apps/web/src/features/spaces/components/create-space-dialog.tsx
similarity index 91%
rename from apps/web/src/features/spaces/components/new-space-dialog.tsx
rename to apps/web/src/features/spaces/components/create-space-dialog.tsx
index a6b689fed..d090c780f 100644
--- a/apps/web/src/features/spaces/components/new-space-dialog.tsx
+++ b/apps/web/src/features/spaces/components/create-space-dialog.tsx
@@ -27,17 +27,17 @@ import { createSpaceAction } from "@/features/spaces/actions";
import { useTranslation } from "@/i18n/client";
import { useSafeAction } from "@/lib/safe-action/client";
-const newSpaceFormSchema = z.object({
+const createSpaceFormSchema = z.object({
name: z.string().min(1).max(100),
});
-type NewSpaceFormValues = z.infer<typeof newSpaceFormSchema>;
+type CreateSpaceFormValues = z.infer<typeof createSpaceFormSchema>;
-export function NewSpaceDialog({ children, ...props }: DialogProps) {
+export function CreateSpaceDialog(props: DialogProps) {
const { t } = useTranslation();
- const form = useForm<NewSpaceFormValues>({
- resolver: zodResolver(newSpaceFormSchema),
+ const form = useForm<CreateSpaceFormValues>({
+ resolver: zodResolver(createSpaceFormSchema),
defaultValues: {
name: "",
},
@@ -51,9 +51,8 @@ export function NewSpaceDialog({ children, ...props }: DialogProps) {
return (
<Dialog {...props}>
- {children}
<Form {...form}>
- <DialogContent size="xs">
+ <DialogContent size="sm">
<DialogHeader>
<DialogTitle>
<Trans i18nKey="createSpace" defaults="Create Space" />
diff --git a/apps/web/src/features/spaces/components/space-dropdown.tsx b/apps/web/src/features/spaces/components/space-dropdown.tsx
index b32a2a947..eb92c3c77 100644
--- a/apps/web/src/features/spaces/components/space-dropdown.tsx
+++ b/apps/web/src/features/spaces/components/space-dropdown.tsx
@@ -18,7 +18,7 @@ import { ProBadge } from "@/components/pro-badge";
import { Trans } from "@/components/trans";
import { setActiveSpaceAction } from "@/features/spaces/actions";
import { useSafeAction } from "@/lib/safe-action/client";
-import { NewSpaceDialog } from "./new-space-dialog";
+import { CreateSpaceDialog } from "./create-space-dialog";
import { SpaceIcon } from "./space-icon";
export function SpaceDropdown({
@@ -74,7 +74,6 @@ export function SpaceDropdown({
</DropdownMenuRadioItem>
))}
</DropdownMenuRadioGroup>
- <DropdownMenuSeparator />
<DropdownMenuItem onClick={newSpaceDialog.trigger}>
<Icon>
<CirclePlusIcon />
@@ -92,7 +91,7 @@ export function SpaceDropdown({
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
- <NewSpaceDialog {...newSpaceDialog.dialogProps} />
+ <CreateSpaceDialog {...newSpaceDialog.dialogProps} />
</>
);
}