Skip to content

Commit a1c7488

Browse files
committed
styled component map to white nodes and light gray background
1 parent 9b7a65e commit a1c7488

File tree

2 files changed

+39
-29
lines changed

2 files changed

+39
-29
lines changed

src/app/components/StateRoute/ComponentMap/ComponentMap.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,14 @@ export default function ComponentMap({
311311
const widthFunc: number = (name) => {
312312
//returns a number that is related to the length of the name. Used for determining the node width.
313313
const nodeLength = name.length;
314-
//return nodeLength * 7 + 20; //uncomment this line if we want each node to be directly proportional to the name.length (instead of nodes of similar sizes to snap to the same width)
314+
// return nodeLength * 7 + 20; //uncomment this line if we want each node to be directly proportional to the name.length (instead of nodes of similar sizes to snap to the same width)
315315
if (nodeLength <= 5) return nodeLength + 50;
316316
if (nodeLength <= 10) return nodeLength + 120;
317317
return nodeLength + 140;
318318
};
319319

320320
const width: number = widthFunc(node.data.name); // the width is determined by the length of the node.name
321-
const height: number = 25;
321+
const height: number = 35;
322322
let top: number;
323323
let left: number;
324324

@@ -492,7 +492,6 @@ export default function ComponentMap({
492492
fontFamily='Roboto'
493493
textAnchor='middle'
494494
style={{ pointerEvents: 'none' }}
495-
//fill={node.depth === 0 ? '#161521' : node.children ? 'white' : '#161521'}
496495
>
497496
{node.data.name}
498497
</text>

src/app/styles/components/_componentMap.scss

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,54 @@
11
/* Component Map Container */
22
.componentMapContainer {
3-
fill: white;
4-
border-radius: 8px;
3+
fill: #f9fafb;
54
transition: all 0.3s ease;
65
}
6+
.componentMapContainer svg {
7+
background-color: #f9fafb;
8+
}
79

8-
/* Base Node Styling - Shared properties */
10+
/* Node Styling */
911
.compMapParent,
10-
.compMapChild,
11-
.compMapRoot {
12-
fill: #3c6e71;
13-
stroke: #2c5152;
14-
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
12+
.compMapChild {
13+
fill: #ffffff;
14+
stroke: #e5e7eb;
15+
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
1516
transition: all 0.2s ease;
1617
}
1718

18-
/* Individual Node Variations */
19-
.compMapParent {
20-
opacity: 0.95;
21-
}
22-
23-
.compMapChild {
24-
opacity: 0.9;
19+
.compMapParent:hover,
20+
.compMapChild:hover {
21+
stroke: #14b8a6;
22+
stroke-width: 2px;
23+
cursor: pointer;
24+
filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
2525
}
2626

27+
/* Root Node Styling */
2728
.compMapRoot {
28-
opacity: 1;
29+
fill: #14b8a6;
30+
stroke: #0d9488;
31+
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
32+
transition: all 0.2s ease;
2933
}
3034

31-
/* Hover Effects - Shared across all nodes */
32-
.compMapParent:hover,
33-
.compMapChild:hover,
3435
.compMapRoot:hover {
35-
fill: #14b8a6;
36-
stroke: #0d9488;
37-
cursor: pointer;
3836
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
39-
transform: scale(1.02);
37+
cursor: pointer;
38+
transform: scale(1.05);
4039
}
4140

4241
/* Text Styling */
43-
.compMapRootText,
42+
.compMapRootText {
43+
fill: #ffffff;
44+
font-family: 'Outfit', sans-serif;
45+
font-weight: 500;
46+
user-select: none;
47+
}
48+
4449
.compMapParentText,
4550
.compMapChildText {
46-
fill: #ffffff;
51+
fill: #374151;
4752
font-family: 'Outfit', sans-serif;
4853
font-weight: 500;
4954
user-select: none;
@@ -55,12 +60,18 @@
5560
transition: all 0.3s ease;
5661
}
5762

63+
.compMapLink:hover {
64+
stroke-width: 2;
65+
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
66+
}
67+
5868
.link-controls {
5969
display: flex;
6070
align-items: center;
6171
gap: 16px;
62-
padding: 16px;
72+
padding: 12px 16px;
6373
background: white;
74+
border-bottom: 1px solid #e5e7eb;
6475
justify-content: space-between;
6576
max-width: 1200px;
6677
}

0 commit comments

Comments
 (0)