-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d58d090
commit 4a604ca
Showing
9 changed files
with
69 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const NODE_DIMENSIONS = { | ||
ROW_HEIGHT: 24, // Regular row height | ||
PARENT_HEIGHT: 36, // Height for parent nodes | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
import React from "react"; | ||
import { useComputedColorScheme } from "@mantine/core"; | ||
import type { EdgeProps } from "reaflow"; | ||
import { Edge } from "reaflow"; | ||
|
||
const CustomEdgeWrapper = (props: EdgeProps) => { | ||
return <Edge containerClassName={`edge-${props.id}`} {...props} />; | ||
const colorScheme = useComputedColorScheme(); | ||
|
||
return ( | ||
<Edge | ||
containerClassName={`edge-${props.id}`} | ||
style={{ | ||
stroke: colorScheme === "dark" ? "#444444" : "#BCBEC0", | ||
strokeWidth: 1.5, | ||
}} | ||
{...props} | ||
/> | ||
); | ||
}; | ||
|
||
export const CustomEdge = React.memo(CustomEdgeWrapper); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters