Skip to content

Commit

Permalink
fix(node-color): node color should be reflected to color picker butto…
Browse files Browse the repository at this point in the history
…n at edit type sidebar
  • Loading branch information
MahtabBukhari committed Nov 1, 2024
1 parent a1a314c commit 7ba2045
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { fontProps } from '~/components/Universe/Graph/Cubes/Text/constants'
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,6 +43,7 @@ export const boxGeometry = new BoxGeometry(2, 2, 2)
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
Expand Down Expand Up @@ -124,7 +126,7 @@ export const Node = memo(({ node, setSelectedNode, onSimulationUpdate, isSelecte
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

0 comments on commit 7ba2045

Please sign in to comment.