From fca99d6126c31fbb18ed9f1034cee6f940b040e8 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Tue, 10 Feb 2026 16:28:21 +0100 Subject: [PATCH] refactor --- apps/web/src/app/editor/[project_id]/page.tsx | 6 +- apps/web/src/app/globals.css | 432 +++++---- apps/web/src/app/projects/page.tsx | 87 +- apps/web/src/components/editable-timecode.tsx | 4 +- .../src/components/editor/editor-header.tsx | 127 ++- .../src/components/editor/export-button.tsx | 51 +- .../editor/panels/assets/draggable-item.tsx | 4 +- .../components/editor/panels/assets/index.tsx | 2 +- .../editor/panels/assets/tabbar.tsx | 29 +- .../editor/panels/assets/views/captions.tsx | 9 +- .../editor/panels/assets/views/media.tsx | 6 +- .../editor/panels/assets/views/settings.tsx | 103 +- .../editor/panels/assets/views/sounds.tsx | 4 +- .../editor/panels/assets/views/stickers.tsx | 2 +- .../editor/panels/assets/views/text.tsx | 2 +- .../editor/panels/panel-base-view.tsx | 4 +- .../editor/panels/preview/index.tsx | 141 ++- .../editor/panels/properties/empty-view.tsx | 20 + .../editor/panels/properties/index.tsx | 25 +- .../panels/properties/property-item.tsx | 79 +- .../panels/properties/text-properties.tsx | 911 ++++++++++-------- .../{ => panels}/timeline/audio-waveform.tsx | 0 .../{ => panels}/timeline/bookmarks.tsx | 0 .../{ => panels}/timeline/drag-line.tsx | 0 .../editor/{ => panels}/timeline/index.tsx | 16 +- .../{ => panels}/timeline/snap-indicator.tsx | 0 .../timeline/timeline-element.tsx | 22 +- .../timeline/timeline-playhead.tsx | 0 .../{ => panels}/timeline/timeline-ruler.tsx | 24 +- .../{ => panels}/timeline/timeline-tick.tsx | 0 .../timeline/timeline-toolbar.tsx | 99 +- .../{ => panels}/timeline/timeline-track.tsx | 7 +- apps/web/src/components/theme-toggle.tsx | 4 +- apps/web/src/components/ui/button.tsx | 7 +- apps/web/src/components/ui/color-picker.tsx | 19 +- apps/web/src/components/ui/command.tsx | 2 +- apps/web/src/components/ui/dropdown-menu.tsx | 2 +- apps/web/src/components/ui/font-picker.tsx | 6 +- .../web/src/components/ui/input-with-back.tsx | 4 +- apps/web/src/components/ui/label.tsx | 2 +- apps/web/src/components/ui/popover.tsx | 1 - apps/web/src/components/ui/select.tsx | 6 +- apps/web/src/components/ui/slider.tsx | 2 +- apps/web/src/components/ui/split-button.tsx | 4 +- apps/web/src/components/ui/tabs.tsx | 2 +- .../hooks/timeline/use-edge-auto-scroll.ts | 5 +- .../src/hooks/timeline/use-timeline-zoom.ts | 22 +- apps/web/src/hooks/use-container-size.ts | 29 + apps/web/src/hooks/use-fullscreen.ts | 30 + apps/web/src/hooks/use-preview-interaction.ts | 10 + apps/web/src/stores/text-properties-store.ts | 33 - 51 files changed, 1358 insertions(+), 1048 deletions(-) create mode 100644 apps/web/src/components/editor/panels/properties/empty-view.tsx rename apps/web/src/components/editor/{ => panels}/timeline/audio-waveform.tsx (100%) rename apps/web/src/components/editor/{ => panels}/timeline/bookmarks.tsx (100%) rename apps/web/src/components/editor/{ => panels}/timeline/drag-line.tsx (100%) rename apps/web/src/components/editor/{ => panels}/timeline/index.tsx (96%) rename apps/web/src/components/editor/{ => panels}/timeline/snap-indicator.tsx (100%) rename apps/web/src/components/editor/{ => panels}/timeline/timeline-element.tsx (96%) rename apps/web/src/components/editor/{ => panels}/timeline/timeline-playhead.tsx (100%) rename apps/web/src/components/editor/{ => panels}/timeline/timeline-ruler.tsx (82%) rename apps/web/src/components/editor/{ => panels}/timeline/timeline-tick.tsx (100%) rename apps/web/src/components/editor/{ => panels}/timeline/timeline-toolbar.tsx (74%) rename apps/web/src/components/editor/{ => panels}/timeline/timeline-track.tsx (93%) create mode 100644 apps/web/src/hooks/use-container-size.ts create mode 100644 apps/web/src/hooks/use-fullscreen.ts delete mode 100644 apps/web/src/stores/text-properties-store.ts diff --git a/apps/web/src/app/editor/[project_id]/page.tsx b/apps/web/src/app/editor/[project_id]/page.tsx index e652e928..97093912 100644 --- a/apps/web/src/app/editor/[project_id]/page.tsx +++ b/apps/web/src/app/editor/[project_id]/page.tsx @@ -8,7 +8,7 @@ import { } from "@/components/ui/resizable"; import { AssetsPanel } from "@/components/editor/panels/assets"; import { PropertiesPanel } from "@/components/editor/panels/properties"; -import { Timeline } from "@/components/editor/timeline"; +import { Timeline } from "@/components/editor/panels/timeline"; import { PreviewPanel } from "@/components/editor/panels/preview"; import { EditorHeader } from "@/components/editor/editor-header"; import { EditorProvider } from "@/components/providers/editor-provider"; @@ -65,7 +65,7 @@ function EditorLayout() { defaultSize={panels.tools} minSize={15} maxSize={40} - className="min-w-0 rounded-sm" + className="min-w-0" > @@ -86,7 +86,7 @@ function EditorLayout() { defaultSize={panels.properties} minSize={15} maxSize={40} - className="min-w-0 rounded-sm" + className="min-w-0" > diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css index d0da1f51..37b5fe16 100644 --- a/apps/web/src/app/globals.css +++ b/apps/web/src/app/globals.css @@ -8,88 +8,115 @@ @plugin "tailwindcss-animate"; :root { - --background: hsl(0, 0%, 100%); - --foreground: hsl(0 0% 11%); - --card: hsl(0, 0%, 100%); - --card-foreground: hsl(0 0% 11%); - --popover: hsl(0, 0%, 100%); - --popover-foreground: hsl(0 0% 2%); - --primary: hsl(203, 100%, 50%); - --primary-hover: hsl(203, 100%, 45%); - --primary-foreground: hsl(0, 0%, 100%); - --secondary: hsl(216 13% 94%); - --secondary-foreground: hsl(0 0% 2%); - --muted: hsl(0 0% 85.1%); - --muted-foreground: hsl(0 0% 50%); - --accent: hsl(216, 13%, 88%); - --accent-foreground: hsl(0 0% 2%); - --destructive: hsl(0, 83%, 50%); - --destructive-foreground: hsl(0, 0%, 100%); - --constructive: hsl(141, 71%, 48%); - --constructive-foreground: hsl(0, 0%, 100%); - --border: hsl(0 0% 88%); - --input: hsl(0 0% 85.1%); - --ring: hsl(0, 0%, 55%); - --chart-1: hsl(220 70% 50%); - --chart-2: hsl(160 60% 45%); - --chart-3: hsl(30 80% 55%); - --chart-4: hsl(280 65% 60%); - --chart-5: hsl(340 75% 55%); - --sidebar-background: hsl(0 0% 96.1%); - --sidebar-foreground: hsl(0 0% 2%); - --sidebar-primary: hsl(0 0% 2%); - --sidebar-primary-foreground: hsl(0 0% 91%); - --sidebar-accent: hsl(0 0% 85.1%); - --sidebar-accent-foreground: hsl(0 0% 2%); - --sidebar-border: hsl(0 0% 85.1%); - --sidebar-ring: hsl(0 0% 16.9%); - --panel-background: hsl(216 13% 94%); - --panel-accent: hsl(216, 8%, 88%); - --sidebar: hsl(0 0% 98%); + --background: hsl(0, 0%, 100%); + --foreground: hsl(0 0% 11%); + --card: hsl(0, 0%, 100%); + --card-foreground: hsl(0 0% 11%); + --popover: hsl(0, 0%, 100%); + --popover-hover: hsl(0, 0%, 96%); + --popover-foreground: hsl(0 0% 2%); + --primary: #009dff; + --primary-foreground: hsl(0, 0%, 100%); + --secondary: hsl(204, 100%, 97%); + --secondary-border: hsl(204, 100%, 94%); + --secondary-foreground: hsl(200, 98%, 39%); + --muted: hsl(0 0% 85.1%); + --muted-foreground: hsl(0 0% 50%); + --accent: hsl(0, 0%, 96%); + --accent-foreground: hsl(0 0% 2%); + --destructive: hsl(0, 83%, 50%); + --destructive-foreground: hsl(0, 0%, 100%); + --constructive: hsl(141, 71%, 48%); + --constructive-foreground: hsl(0, 0%, 100%); + --border: hsl(0 0% 91%); + --input: hsl(0 0% 85.1%); + --ring: hsl(0, 0%, 55%); + --chart-1: hsl(220 70% 50%); + --chart-2: hsl(160 60% 45%); + --chart-3: hsl(30 80% 55%); + --chart-4: hsl(280 65% 60%); + --chart-5: hsl(340 75% 55%); + --sidebar-background: hsl(0 0% 96.1%); + --sidebar-foreground: hsl(0 0% 2%); + --sidebar-primary: hsl(0 0% 2%); + --sidebar-primary-foreground: hsl(0 0% 91%); + --sidebar-accent: hsl(0 0% 85.1%); + --sidebar-accent-foreground: hsl(0 0% 2%); + --sidebar-border: hsl(0 0% 85.1%); + --sidebar-ring: hsl(0 0% 16.9%); + --sidebar: hsl(0 0% 98%); } + +.panel { + --background: hsl(216 13% 98%); + --foreground: hsl(0 0% 13%); + --card: hsl(0, 0%, 98%); + --card-foreground: hsl(0 0% 13%); + --primary-foreground: hsl(0, 0%, 98%); + --secondary: hsl(204, 100%, 95%); + --secondary-border: hsl(204, 100%, 92%); + --secondary-foreground: hsl(200, 98%, 37%); + --muted: hsl(0 0% 83.1%); + --muted-foreground: hsl(0 0% 48%); + --accent: hsl(0, 0%, 93%); + --accent-foreground: hsl(0 0% 5%); + --destructive: hsl(0, 83%, 50%); + --destructive-foreground: hsl(0, 0%, 98%); + --constructive: hsl(141, 71%, 48%); + --constructive-foreground: hsl(0, 0%, 98%); + --border: hsl(0 0% 89%); + --input: hsl(0 0% 83.1%); + --ring: hsl(0, 0%, 53%); +} + .dark { - --background: hsl(0 0% 4%); - --foreground: hsl(0 0% 89%); - --card: hsl(0 0% 4%); - --card-foreground: hsl(0 0% 89%); - --popover: hsl(0 0% 14.9%); - --popover-foreground: hsl(0 0% 98%); - --primary: hsl(203, 100%, 50%); - --primary-hover: hsl(203, 100%, 45%); - --primary-foreground: hsl(0 0% 9%); - --secondary: hsl(0 0% 14.9%); - --secondary-foreground: hsl(0 0% 98%); - --muted: hsl(0 0% 14.9%); - --muted-foreground: hsl(0 0% 63.9%); - --accent: hsl(0, 0%, 28%); - --accent-foreground: hsl(0 0% 98%); - --destructive: hsl(0 83%, 55%); - --destructive-foreground: hsl(0 0% 98%); - --constructive: hsl(141, 71%, 48%); - --constructive-foreground: hsl(0 0% 100%); - --border: hsl(0 0% 17%); - --input: hsl(0 0% 14.9%); - --ring: hsl(0 0% 83.1%); - --chart-1: hsl(220 70% 50%); - --chart-2: hsl(160 60% 45%); - --chart-3: hsl(30 80% 55%); - --chart-4: hsl(280 65% 60%); - --chart-5: hsl(340 75% 55%); - --sidebar-background: hsl(0 0% 3.9%); - --sidebar-foreground: hsl(0 0% 98%); - --sidebar-primary: hsl(0 0% 98%); - --sidebar-primary-foreground: hsl(0 0% 9%); - --sidebar-accent: hsl(0 0% 14.9%); - --sidebar-accent-foreground: hsl(0 0% 98%); - --sidebar-border: hsl(0 0% 14.9%); - --sidebar-ring: hsl(0 0% 83.1%); - --panel-background: hsl(0 0% 11%); - --panel-accent: hsl(0 0% 15%); - --sidebar: hsl(240 5.9% 10%); + --background: hsl(0, 0%, 7%); + --foreground: hsl(0 0% 87%); + --card: hsl(0, 0%, 7%); + --card-foreground: hsl(0 0% 87%); + --popover: hsl(0, 0%, 16%); + --popover-hover: hsl(0, 0%, 22%); + --popover-foreground: hsl(0 0% 95%); + --secondary: hsl(204, 100%, 12%); + --secondary-border: hsl(204, 100%, 15%); + --secondary-foreground: hsl(200, 98%, 61%); + --muted: hsl(0 0% 20%); + --accent: hsl(0, 0%, 14%); + --accent-foreground: hsl(0 0% 95%); + --constructive: hsl(141, 71%, 52%); + --border: hsl(0 0% 16%); + --input: hsl(0 0% 20%); + --ring: hsl(0, 0%, 50%); + --sidebar-background: hsl(0 0% 8%); + --sidebar-foreground: hsl(0 0% 95%); + --sidebar-primary: hsl(0 0% 95%); + --sidebar-primary-foreground: hsl(0 0% 15%); + --sidebar-accent: hsl(0 0% 20%); + --sidebar-accent-foreground: hsl(0 0% 95%); + --sidebar-border: hsl(0 0% 20%); + --sidebar-ring: hsl(0 0% 83.1%); + --sidebar: hsl(0 0% 6%); +} + +.dark .panel { + --background: hsl(0 0% 10%); + --foreground: hsl(0 0% 85%); + --card: hsl(0, 0%, 10%); + --card-foreground: hsl(0 0% 85%); + --secondary: hsl(204, 100%, 12%); + --secondary-border: hsl(204, 100%, 17%); + --secondary-foreground: hsl(200, 98%, 63%); + --muted: hsl(0 0% 22%); + --accent: hsl(0, 0%, 15%); + --accent-foreground: hsl(0 0% 93%); + --constructive: hsl(141, 71%, 52%); + --border: hsl(0 0% 18%); + --input: hsl(0 0% 22%); + --ring: hsl(0, 0%, 52%); } @layer base { - /* + /* The default border color has changed to `currentcolor` in Tailwind CSS v4, so we've added these compatibility styles to make sure everything still looks the same as it did with Tailwind CSS v3. @@ -97,165 +124,166 @@ If we ever want to remove these styles, we need to add an explicit border color utility to any element that depends on these defaults. */ - *, - ::after, - ::before, - ::backdrop, - ::file-selector-button { - border-color: var(--color-gray-200, currentcolor); - } - /* Other default base styles */ - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - /* Prevent back/forward swipe */ - overscroll-behavior-x: contain; - } + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: var(--color-gray-200, currentcolor); + } + /* Other default base styles */ + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + /* Prevent back/forward swipe */ + overscroll-behavior-x: contain; + } + ::selection { + @apply bg-primary/35 selection:text-primary-foreground; + } } @theme inline { - /* Responsive breakpoints */ - --breakpoint-xs: 30rem; + /* Responsive breakpoints */ + --breakpoint-xs: 30rem; - /* Typography */ - --font-sans: var(--font-inter), sans-serif; + /* Typography */ + --font-sans: var(--font-inter), sans-serif; - /* Font sizes */ - --text-xl: 1.20rem; + /* Font sizes */ + --text-xl: 1.2rem; --text-base: 0.92rem; - --text-base--line-height: calc(1.5 / 0.95); - --text-xs: 0.75rem; - --text-xs--line-height: calc(1 / 0.8); + --text-base--line-height: calc(1.5 / 0.95); + --text-xs: 0.75rem; + --text-sm: 0.85rem; + --text-xs--line-height: calc(1 / 0.8); - /* Border radius */ - --radius-lg: 0.82rem; - --radius-md: 0.65rem; - --radius-sm: 0.35rem; + /* Border radius */ + --radius-lg: 0.82rem; + --radius-md: 0.65rem; + --radius-sm: 0.35rem; - /* Palette mapped to root design tokens */ - --color-background: var(--background); - --color-foreground: var(--foreground); + /* Palette mapped to root design tokens */ + --color-background: var(--background); + --color-foreground: var(--foreground); - --color-card: var(--card); - --color-card-foreground: var(--card-foreground); + --color-card: var(--card); + --color-card-foreground: var(--card-foreground); - --color-popover: var(--popover); - --color-popover-foreground: var(--popover-foreground); + --color-popover: var(--popover); + --color-popover-hover: var(--popover-hover); + --color-popover-foreground: var(--popover-foreground); - --color-primary: var(--primary); - --color-primary-foreground: var(--primary-foreground); - --color-primary-hover: var(--primary-hover); - --color-secondary: var(--secondary); - --color-secondary-foreground: var(--secondary-foreground); + --color-primary: var(--primary); + --color-primary-foreground: var(--primary-foreground); + --color-secondary: var(--secondary); + --color-secondary-border: var(--secondary-border); + --color-secondary-foreground: var(--secondary-foreground); - --color-muted: var(--muted); - --color-muted-foreground: var(--muted-foreground); + --color-muted: var(--muted); + --color-muted-foreground: var(--muted-foreground); - --color-accent: var(--accent); - --color-accent-foreground: var(--accent-foreground); + --color-accent: var(--accent); + --color-accent-foreground: var(--accent-foreground); - --color-destructive: var(--destructive); - --color-destructive-foreground: var(--destructive-foreground); + --color-destructive: var(--destructive); + --color-destructive-foreground: var(--destructive-foreground); - --color-constructive: var(--constructive); - --color-constructive-foreground: var(--constructive-foreground); + --color-constructive: var(--constructive); + --color-constructive-foreground: var(--constructive-foreground); - --color-border: var(--border); - --color-input: var(--input); - --color-ring: var(--ring); + --color-border: var(--border); + --color-input: var(--input); + --color-ring: var(--ring); - /* Chart colors */ - --color-chart-1: var(--chart-1); - --color-chart-2: var(--chart-2); - --color-chart-3: var(--chart-3); - --color-chart-4: var(--chart-4); - --color-chart-5: var(--chart-5); + /* Chart colors */ + --color-chart-1: var(--chart-1); + --color-chart-2: var(--chart-2); + --color-chart-3: var(--chart-3); + --color-chart-4: var(--chart-4); + --color-chart-5: var(--chart-5); - /* Sidebar */ - --color-sidebar: var(--sidebar-background); - --color-sidebar-foreground: var(--sidebar-foreground); - --color-sidebar-primary: var(--sidebar-primary); - --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); - --color-sidebar-accent: var(--sidebar-accent); - --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); - --color-sidebar-border: var(--sidebar-border); - --color-sidebar-ring: var(--sidebar-ring); + /* Sidebar */ + --color-sidebar: var(--sidebar-background); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); + --color-sidebar-border: var(--sidebar-border); + --color-sidebar-ring: var(--sidebar-ring); - /* Panel */ - --color-panel: var(--panel-background); - --color-panel-accent: var(--panel-accent); + /* Animations */ + --animate-accordion-down: accordion-down 0.2s ease-out; + --animate-accordion-up: accordion-up 0.2s ease-out; - /* Animations */ - --animate-accordion-down: accordion-down 0.2s ease-out; - --animate-accordion-up: accordion-up 0.2s ease-out; + @keyframes accordion-down { + from { + height: 0; + } + to { + height: var(--radix-accordion-content-height); + } + } - @keyframes accordion-down { - from { - height: 0; - } - to { - height: var(--radix-accordion-content-height); - } - } - - @keyframes accordion-up { - from { - height: var(--radix-accordion-content-height); - } - to { - height: 0; - } - } + @keyframes accordion-up { + from { + height: var(--radix-accordion-content-height); + } + to { + height: 0; + } + } } @utility scrollbar-hidden { - -ms-overflow-style: none; - scrollbar-width: none; - &::-webkit-scrollbar { - display: none; - } + -ms-overflow-style: none; + scrollbar-width: none; + &::-webkit-scrollbar { + display: none; + } } @utility scrollbar-x-hidden { - -ms-overflow-style: none; - scrollbar-width: none; - &::-webkit-scrollbar:horizontal { - display: none; - } + -ms-overflow-style: none; + scrollbar-width: none; + &::-webkit-scrollbar:horizontal { + display: none; + } } @utility scrollbar-y-hidden { - -ms-overflow-style: none; - scrollbar-width: none; - &::-webkit-scrollbar:vertical { - display: none; - } + -ms-overflow-style: none; + scrollbar-width: none; + &::-webkit-scrollbar:vertical { + display: none; + } } @utility scrollbar-thin { - &::-webkit-scrollbar { - width: 6px; - height: 8px; - } - &::-webkit-scrollbar-track { - background: transparent; - } - &::-webkit-scrollbar-thumb { - background: var(--border); - border-radius: 4px; - } - &::-webkit-scrollbar-thumb:hover { - background: var(--muted-foreground); - } + &::-webkit-scrollbar { + width: 6px; + height: 8px; + } + &::-webkit-scrollbar-track { + background: transparent; + } + &::-webkit-scrollbar-thumb { + background: var(--border); + border-radius: 4px; + } + &::-webkit-scrollbar-thumb:hover { + background: var(--muted-foreground); + } } @layer base { - * { - @apply border-border outline-ring/50; - } - body { - @apply bg-background text-foreground; - } + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; + } } diff --git a/apps/web/src/app/projects/page.tsx b/apps/web/src/app/projects/page.tsx index 5d17a46c..492e0cbe 100644 --- a/apps/web/src/app/projects/page.tsx +++ b/apps/web/src/app/projects/page.tsx @@ -71,6 +71,11 @@ const formatProjectDuration = ({ return formatTimeCode({ timeInSeconds: duration, format }); }; +const VIEW_MODE_OPTIONS = [ + { mode: "grid" as const, icon: GridViewIcon, label: "Grid view" }, + { mode: "list" as const, icon: LeftToRightListDashIcon, label: "List view" }, +]; + export default function ProjectsPage() { const { searchQuery, sortKey, sortOrder, viewMode } = useProjectsStore(); const editor = useEditor(); @@ -147,34 +152,23 @@ function ProjectsHeader() { -
- - +
+ {VIEW_MODE_OPTIONS.map(({ mode, icon, label }) => ( + + ))}
@@ -277,28 +271,21 @@ function ProjectsToolbar({ projectIds }: { projectIds: string[] }) {
- - + {VIEW_MODE_OPTIONS.map(({ mode, icon, label }) => ( + + ))}
{selectedProjectCount > 0 ? : null} diff --git a/apps/web/src/components/editable-timecode.tsx b/apps/web/src/components/editable-timecode.tsx index d32f067a..61f23372 100644 --- a/apps/web/src/components/editable-timecode.tsx +++ b/apps/web/src/components/editable-timecode.tsx @@ -122,8 +122,8 @@ export function EditableTimecode({ onKeyDown={handleKeyDown} onBlur={handleBlur} className={cn( - "border-none bg-transparent font-mono text-xs outline-none", - "focus:bg-background focus:border-primary focus:rounded focus:border focus:px-1", + "-mx-1 border border-transparent bg-transparent px-1 font-mono text-xs outline-none", + "focus:bg-background focus:border-primary focus:rounded", "text-primary tabular-nums", hasError && "text-destructive focus:border-destructive", className, diff --git a/apps/web/src/components/editor/editor-header.tsx b/apps/web/src/components/editor/editor-header.tsx index d74d78d7..e70bda37 100644 --- a/apps/web/src/components/editor/editor-header.tsx +++ b/apps/web/src/components/editor/editor-header.tsx @@ -1,8 +1,7 @@ "use client"; import { Button } from "../ui/button"; -import { ChevronDown } from "lucide-react"; -import { useState } from "react"; +import { useRef, useState } from "react"; import { DropdownMenu, DropdownMenuContent, @@ -17,23 +16,21 @@ import { useRouter } from "next/navigation"; import { FaDiscord } from "react-icons/fa6"; import { ExportButton } from "./export-button"; import { ThemeToggle } from "../theme-toggle"; -import { SOCIAL_LINKS } from "@/constants/site-constants"; +import { DEFAULT_LOGO_URL, SOCIAL_LINKS } from "@/constants/site-constants"; import { toast } from "sonner"; import { useEditor } from "@/hooks/use-editor"; -import { - ArrowLeft02Icon, - Edit03Icon, - Delete02Icon, - CommandIcon, -} from "@hugeicons/core-free-icons"; +import { ArrowLeft02Icon, CommandIcon } from "@hugeicons/core-free-icons"; import { HugeiconsIcon } from "@hugeicons/react"; import { ShortcutsDialog } from "./dialogs/shortcuts-dialog"; +import Image from "next/image"; +import { cn } from "@/utils/ui"; export function EditorHeader() { return ( -
-
+
+
+