Skip to content

Commit ba53936

Browse files
authored
Merge pull request #10 from oslabs-beta/revert-7-links
Revert "Links"
2 parents c9528c0 + 1b9cf23 commit ba53936

File tree

4 files changed

+23
-71
lines changed

4 files changed

+23
-71
lines changed

reactime-website

Submodule reactime-website deleted from cb1d59c

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

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,15 @@ import ToolTipDataDisplay from './ToolTipDataDisplay';
2121
import { toggleExpanded, setCurrentTabInApp } from '../../../slices/mainSlice';
2222
import { useDispatch } from 'react-redux';
2323
import { LinkTypesProps, DefaultMargin, ToolTipStyles } from '../../../FrontendTypes';
24-
import { store } from '../../../store';
2524

2625
const linkStroke = '#F00008'; //#F00008 original
2726
const rootStroke = '#F00008'; //#F00008 original
2827
const nodeParentFill = '#161521'; //#161521 original
2928
const nodeChildFill = '#62d6fb'; //#62d6fb original
3029
const nodeParentStroke = '#F00008'; //#F00008 original
3130
const nodeChildStroke = '#4D4D4D'; //#4D4D4D original
32-
const hoverClass = '#ab269b'; //pinkish
33-
3431
let stroke = '';
3532

36-
3733
/* Heat Map Colors (for links) */
3834
const lightOrange = '#F1B476';
3935
const darkOrange = '#E4765B';
@@ -239,11 +235,9 @@ export default function ComponentMap({
239235
{(tree) => (
240236
<Group top={origin.y + 35} left={origin.x + 50 / aspect}>
241237
{tree.links().map((link, i) => {
242-
243238
const linkName = link.source.data.name;
244239
const propsObj = link.source.data.componentData.props;
245240
const childPropsObj = link.target.data.componentData.props;
246-
//consolelog const above
247241
let propsLength;
248242
let childPropsLength;
249243

@@ -256,7 +250,7 @@ export default function ComponentMap({
256250
}
257251
// go to https://en.wikipedia.org/wiki/Logistic_function
258252
// for an explanation of Logistic functions and parameters used
259-
const y0 = -3;
253+
const yshift = -3;
260254
const x0 = 5;
261255
const L = 25;
262256
const k = .4;
@@ -274,46 +268,19 @@ export default function ComponentMap({
274268
} else {
275269
stroke = plum;
276270
}
271+
// stroke = '#df6f37'
277272
}
278-
279-
280-
const [isHovered, setIsHovered] = useState(false);
281-
const handleMouseEnter = () => {
282-
setIsHovered(true);
283-
};
284-
const handleMouseLeave = () => {
285-
setIsHovered(false)
286-
}
287-
288-
let strokeColor; //isHovered ? hoverClass : stroke;
289-
let chooseCursor;
290-
291-
if (isHovered){
292-
strokeColor = hoverClass;
293-
}
294-
else {
295-
strokeColor = stroke
296-
}
297-
298273

299274
return (
300-
<>
301-
<LinkComponent
302-
className='compMapLink'
303-
key={i}
304-
data={link}
305-
percent={stepPercent}
306-
stroke={strokeColor} // changing this color on hover
307-
strokeWidth= {strokeWidthIndex} /* strokeWidth */ // width of the link
308-
fill='none'
309-
//testing hover functionality
310-
onMouseEnter={handleMouseEnter}
311-
onMouseLeave={handleMouseLeave}
312-
/>
313-
<div className="linkHoverInfo">
314-
<h1>Props</h1>
315-
</div>
316-
</>
275+
<LinkComponent
276+
className='compMapLink'
277+
key={i}
278+
data={link}
279+
percent={stepPercent}
280+
stroke={stroke} // color of the link --not used--
281+
strokeWidth= {strokeWidthIndex} /* strokeWidth */ // width of the link
282+
fill='none'
283+
/>
317284
)
318285
})
319286
}
@@ -527,7 +494,7 @@ export default function ComponentMap({
527494
</Tree>
528495
</Group>
529496
</svg>
530-
{tooltipOpen && tooltipData && ( // if the tooltip is open and there is data to display...
497+
{tooltipOpen && tooltipData && (
531498
<TooltipInPortal
532499
// set this to random so it correctly updates with parent bounds
533500
key={Math.random()}
@@ -570,11 +537,6 @@ export default function ComponentMap({
570537
</div>
571538
</TooltipInPortal>
572539
)}
573-
<div className="linkHover-Info">
574-
<p><strong>Props </strong>():</p>
575-
<div></div>
576-
</div>
577-
578540
</div>
579541
);
580542
}

src/app/styles/components/_componentMap.scss

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
2-
1+
// .compMapLink {
2+
// // stroke: $map-link;
3+
// stroke: $secondary-color;
4+
// }
5+
.compMapLink:hover {
6+
box-shadow: 10px 10px rgb(163, 205, 24);
7+
};
38

49
.comp-map-options {
510
color: $map-options-label;
@@ -17,8 +22,6 @@
1722
// //stroke: $map-parent-stroke;
1823
// }
1924

20-
21-
2225
.compMapParentText {
2326
fill: $map-parent-text
2427
}
@@ -41,19 +44,3 @@
4144
fill: $map-root-text;
4245
}
4346

44-
<<<<<<< HEAD
45-
46-
.linkHover-Info {
47-
height: 100px;
48-
width: 100px;
49-
// border: 1px solid red;
50-
z-index: 100;
51-
overflow: visible;
52-
// position: absolute;
53-
offset-position: 100px;
54-
border-radius: 5px;
55-
background-color: rgba(255, 0, 0, 0.067);
56-
// margin-bottom: 10px;
57-
}
58-
=======
59-
>>>>>>> dev

src/app/styles/layout/_stateContainer.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@
242242
z-index: 2;
243243
}
244244

245+
// .state-container .router-link {
246+
// border: 0.5px solid rgba(0, 0, 0, 0.5);
247+
// border-bottom: none;
248+
// }
245249

246250
.tooltipData {
247251
background-color: #373737;

0 commit comments

Comments
 (0)