fix: add asChild prop for DialogTrigger with Button

This commit is contained in:
2024-12-02 11:52:02 +00:00
parent 3acb85abaf
commit 8a8582e06e
3 changed files with 3 additions and 2 deletions

View File

@@ -167,6 +167,7 @@ function useBaseTemplates() {
"/base-templates", "/base-templates",
(): Promise<BaseTemplate[]> => (): Promise<BaseTemplate[]> =>
fetchApi("/base-templates").then((res) => res.json()), fetchApi("/base-templates").then((res) => res.json()),
{ refreshInterval: Number.POSITIVE_INFINITY },
); );
} }

View File

@@ -225,7 +225,7 @@ function EditorTopBar() {
<Dialog> <Dialog>
<header className="sticky top-0 flex shrink-0 items-center justify-between gap-2 border-b bg-background p-4"> <header className="sticky top-0 flex shrink-0 items-center justify-between gap-2 border-b bg-background p-4">
<p className="font-bold">{currentFilePath}</p> <p className="font-bold">{currentFilePath}</p>
<DialogTrigger> <DialogTrigger asChild>
<Button> <Button>
{isBuildInProgress ? ( {isBuildInProgress ? (
<Loader2 className="animate-spin" /> <Loader2 className="animate-spin" />

View File

@@ -268,7 +268,7 @@ function DeleteWorkspaceButton({ workspace }: { workspace: Workspace }) {
function WorkspaceInfoButton() { function WorkspaceInfoButton() {
return ( return (
<Dialog> <Dialog>
<DialogTrigger> <DialogTrigger asChild>
<Button variant="outline" size="icon"> <Button variant="outline" size="icon">
<Info /> <Info />
</Button> </Button>