Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const viewport: Viewport = {

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<head>
<ThemeScript />
<DynamicFontLoader />
Expand Down
12 changes: 9 additions & 3 deletions components/editor/action-bar/components/undo-redo-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@ import { TooltipWrapper } from "@/components/tooltip-wrapper";
import { Button } from "@/components/ui/button";
import { useEditorStore } from "@/store/editor-store";
import { Redo, Undo } from "lucide-react";
import * as React from "react";

interface UndoRedoButtonsProps extends React.ComponentProps<typeof Button> {}
interface UndoRedoButtonsProps extends React.ComponentProps<typeof Button> { }

export function UndoRedoButtons({ disabled, ...props }: UndoRedoButtonsProps) {
const { undo, redo, canUndo, canRedo } = useEditorStore();
const [mounted, setMounted] = React.useState(false);

React.useEffect(() => {
setMounted(true);
}, []);

return (
<div className="flex items-center gap-1">
<TooltipWrapper label="Undo" asChild>
<Button
variant="ghost"
size="icon"
disabled={disabled || !canUndo()}
disabled={!mounted || disabled || !canUndo()}
{...props}
onClick={undo}
>
Expand All @@ -26,7 +32,7 @@ export function UndoRedoButtons({ disabled, ...props }: UndoRedoButtonsProps) {
<Button
variant="ghost"
size="icon"
disabled={disabled || !canRedo()}
disabled={!mounted || disabled || !canRedo()}
{...props}
onClick={redo}
>
Expand Down