Skip to content

Commit

Permalink
Added example to ui
Browse files Browse the repository at this point in the history
  • Loading branch information
SicParv1sMagna committed Nov 11, 2024
1 parent 5c1e30b commit c0d8607
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apps/demo/app/custom-ui/[...puckPath]/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Drawer } from "@/core/components/Drawer";
import { ChevronUp, ChevronDown, Globe, Lock, Unlock } from "lucide-react";

const CustomHeader = ({ onPublish }: { onPublish: (data: Data) => void }) => {
const { appState, dispatch, isInteractive } = usePuck();
const { appState, dispatch, isInteractive, setIsInteractive } = usePuck();

return (
<header
Expand All @@ -29,7 +29,7 @@ const CustomHeader = ({ onPublish }: { onPublish: (data: Data) => void }) => {
<span style={{ fontWeight: 600 }}>Custom UI example </span>
<div style={{ marginLeft: "auto", display: "flex", gap: 8 }}>
<div style={{ gap: 8, display: 'flex' }}>
<Button>
<Button onClick={() => setIsInteractive(!isInteractive)}>
Switch to {isInteractive ? 'editing' : 'interactive'} mode
</Button>
<Button
Expand Down
7 changes: 2 additions & 5 deletions packages/core/components/DraggableComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ export const DraggableComponent = ({
item: selectedItem,
});

console.log(getClassName({ "contents": true, isInteractive: true }))

return (
<El
key={id}
Expand All @@ -135,7 +133,7 @@ export const DraggableComponent = ({
style={{
...style,
...provided.draggableProps.style,
cursor: isInteractive || isModifierHeld || isDragDisabled ? "pointer" : "grab",
cursor: isInteractive || isModifierHeld || isDragDisabled ? "default" : "grab",
}}
onMouseOver={onMouseOver}
onMouseOut={onMouseOut}
Expand Down Expand Up @@ -179,8 +177,7 @@ export const DraggableComponent = ({
</div>
</div>
)}
{/* style={{ ...(isInteractive && { cursor: 'default', background: 'transparent' }) }} */}
{/* style={{ ...(isInteractive && { pointerEvents: 'auto' }) }} */}

<div className={getClassName("overlay")} />
<div className={getClassName("contents")} > {children}</div>
</div>
Expand Down

0 comments on commit c0d8607

Please sign in to comment.