diff --git a/apps/editor/app/viewer/[id]/thumbnail-generator.tsx b/apps/editor/app/viewer/[id]/thumbnail-generator.tsx index df885751..4dec9b9f 100644 --- a/apps/editor/app/viewer/[id]/thumbnail-generator.tsx +++ b/apps/editor/app/viewer/[id]/thumbnail-generator.tsx @@ -5,6 +5,7 @@ import { useThree } from '@react-three/fiber' import { useEffect, useRef } from 'react' import * as THREE from 'three' import { uploadProjectThumbnail } from '@/features/community/lib/projects/actions' +import { useProjectStore } from '@/features/community/lib/projects/store' const THUMBNAIL_WIDTH = 1920 const THUMBNAIL_HEIGHT = 1080 @@ -70,8 +71,7 @@ export const ThumbnailGenerator = ({ projectId: propProjectId }: ThumbnailGenera const result = await uploadProjectThumbnail(projectId, blob) if (result.success) { - console.log('✅ Thumbnail uploaded successfully!') - console.log('🔗 URL:', result.data.thumbnail_url) + useProjectStore.getState().updateActiveThumbnail(result.data.thumbnail_url) } else { console.error('❌ Failed to upload thumbnail:', result.error) } diff --git a/apps/editor/components/editor/custom-camera-controls.tsx b/apps/editor/components/editor/custom-camera-controls.tsx index 07e717d9..a08fc54b 100644 --- a/apps/editor/components/editor/custom-camera-controls.tsx +++ b/apps/editor/components/editor/custom-camera-controls.tsx @@ -237,6 +237,7 @@ export const CustomCameraControls = () => { mouseButtons={mouseButtons} onTransitionStart={onTransitionStart} onRest={onRest} + onSleep={onRest} restThreshold={0.01} /> ) diff --git a/apps/editor/components/editor/index.tsx b/apps/editor/components/editor/index.tsx index 2416d0e1..61759c9e 100644 --- a/apps/editor/components/editor/index.tsx +++ b/apps/editor/components/editor/index.tsx @@ -10,6 +10,7 @@ import { useAuth } from '@/features/community/lib/auth/hooks' import { ZoneSystem } from '../systems/zone/zone-system' import { ToolManager } from '../tools/tool-manager' import { ActionMenu } from '../ui/action-menu' +import { FeedbackDialog } from '../feedback-dialog' import { PascalRadio } from '../pascal-radio' import { PanelManager } from '../ui/panels/panel-manager' import { HelperManager } from '../ui/helpers/helper-manager' @@ -56,10 +57,13 @@ export default function Editor({ projectId }: EditorProps) { {/* Top-right controls */} -
+
+
+ +
diff --git a/apps/editor/components/feedback-dialog.tsx b/apps/editor/components/feedback-dialog.tsx new file mode 100644 index 00000000..4b659bb4 --- /dev/null +++ b/apps/editor/components/feedback-dialog.tsx @@ -0,0 +1,105 @@ +'use client' + +import { MessageSquare } from 'lucide-react' +import { useState } from 'react' +import { submitFeedback } from '@/features/community/lib/feedback/actions' +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, +} from '@/components/ui/primitives/dialog' +import { Button } from '@/components/ui/primitives/button' + +export function FeedbackDialog() { + const [open, setOpen] = useState(false) + const [message, setMessage] = useState('') + const [isSubmitting, setIsSubmitting] = useState(false) + const [error, setError] = useState(null) + const [sent, setSent] = useState(false) + + const handleOpen = () => { + setOpen(true) + setSent(false) + setError(null) + setMessage('') + } + + const handleClose = () => { + if (isSubmitting) return + setOpen(false) + } + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + setError(null) + setIsSubmitting(true) + const result = await submitFeedback(message) + setIsSubmitting(false) + if (result.success) { + setSent(true) + setTimeout(() => setOpen(false), 1500) + } else { + setError(result.error) + } + } + + return ( + <> + + + + + + Send Feedback + We'd love to hear your thoughts + + + {sent ? ( +

+ Thanks for your feedback! +

+ ) : ( +
+
+ +