Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
Signed-off-by: Nik Nasr <[email protected]>
  • Loading branch information
nikrooz committed Oct 24, 2024
1 parent 69c5a8b commit 58371fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Button, SubmitButton } from '@restate/ui/button';
import {
Dialog,
DialogClose,
DialogContent,
DialogFooter,
DialogTrigger,
DialogWithQuery,
QueryDialog,
} from '@restate/ui/dialog';
import { Icon, IconName } from '@restate/ui/icons';
import { PropsWithChildren } from 'react';
Expand Down Expand Up @@ -70,7 +69,7 @@ export function TriggerRegisterDeploymentDialog({
children = 'Register deployment',
}: PropsWithChildren<NonNullable<unknown>>) {
return (
<DialogWithQuery query={REGISTER_DEPLOYMENT_QUERY}>
<QueryDialog query={REGISTER_DEPLOYMENT_QUERY}>
<DialogTrigger>
<Link
variant="secondary-button"
Expand All @@ -84,6 +83,6 @@ export function TriggerRegisterDeploymentDialog({
<DialogContent className="max-w-lg">
<RegistrationForm>{RegisterDeploymentFooter}</RegistrationForm>
</DialogContent>
</DialogWithQuery>
</QueryDialog>
);
}
6 changes: 2 additions & 4 deletions libs/ui/dialog/src/lib/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ export function Dialog({
);
}

export function DialogWithQuery({
export function QueryDialog({
children,
query,
onOpenChange,
}: PropsWithChildren<Pick<DialogProps, 'onOpenChange'> & { query: string }>) {
}: PropsWithChildren<{ query: string }>) {
const [searchParams, setSearchParams] = useSearchParams();
const isOpen = Boolean(searchParams.has(query));

Expand All @@ -41,7 +40,6 @@ export function DialogWithQuery({
<DialogTrigger
isOpen={isOpen}
onOpenChange={(isOpen) => {
onOpenChange?.(isOpen);
if (!isOpen) {
close();
}
Expand Down

0 comments on commit 58371fe

Please sign in to comment.