Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blueprint] - When we select a node in blue print graph then node color should be reflected to color picker button at edit type sidebar #2421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { useSchemaStore } from '~/stores/useSchemaStore'
import { truncateText } from '~/utils/truncateText'
import { NODE_RADIUS } from '../../constants'
import { useAppStore } from '~/stores/useAppStore'

export const NODE_TYPE_COLORS = ['#ff13c9', '#5af0ff', '#3233ff', '#c2f0c2', '#ff6666', '#99ccff', '#ffb3b3']

Expand Down Expand Up @@ -42,9 +43,10 @@
export const Node = memo(({ node, setSelectedNode, onSimulationUpdate, isSelected }: Props) => {
const meshRef = useRef<Mesh | null>(null)
const [normalizedSchemasByType] = useSchemaStore((s) => [s.normalizedSchemasByType])
const { setSelectedColor } = useAppStore((s) => s)
const [showTooltip, setShowTooltip] = useState(false)

console.log(isSelected)

Check warning on line 49 in src/components/ModalsContainer/BlueprintModal/Body/Graph/Nodes/Node/index.tsx

View workflow job for this annotation

GitHub Actions / eslint-run

Unexpected console statement

const { size, camera } = useThree()

Expand Down Expand Up @@ -124,7 +126,7 @@
onPointerOver={handleMouseOver}
position={new Vector3(node.x, node.y, 0)}
>
<Circle args={[NODE_RADIUS, 30, 20]}>
<Circle args={[NODE_RADIUS, 30, 20]} onClick={() => setSelectedColor(color)}>
<meshStandardMaterial attach="material" color={color} />
</Circle>

Expand Down
Loading