@thecb/components 8.3.1-beta.3 → 8.3.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
-
import { Link } from "react-router-dom";
|
|
4
|
-
import { ROYAL_BLUE } from "../../../constants/colors";
|
|
3
|
+
import { Link, useMatch } from "react-router-dom";
|
|
4
|
+
import { ROYAL_BLUE, INFO_BLUE} from "../../../constants/colors";
|
|
5
5
|
/*
|
|
6
6
|
The extracting of props and the disabling of the eslint rule is to stop React from complaining about
|
|
7
7
|
unrecognized DOM attributes.
|
|
@@ -13,7 +13,11 @@ export const StyledInternalLink = styled(
|
|
|
13
13
|
(
|
|
14
14
|
{ hoverColor, activeColor, active, color, extrastyles, ...props },
|
|
15
15
|
ref
|
|
16
|
-
) =>
|
|
16
|
+
) => {
|
|
17
|
+
let match = useMatch();
|
|
18
|
+
console.log("🚀 ~ file: InternalLink.styled.js:18 ~ match:", match);
|
|
19
|
+
return <Link {...props} match={match} ref={ref} />
|
|
20
|
+
}
|
|
17
21
|
)
|
|
18
22
|
)`
|
|
19
23
|
display: flex;
|
|
@@ -24,6 +28,7 @@ export const StyledInternalLink = styled(
|
|
|
24
28
|
font-size: ${({ fontSize }) => fontSize};
|
|
25
29
|
font-family: ${({ fontFamily }) => fontFamily};
|
|
26
30
|
margin: ${({ margin }) => margin};
|
|
31
|
+
background-color: ${({ match }) => match ? INFO_BLUE : 'transparent'};
|
|
27
32
|
|
|
28
33
|
&:hover {
|
|
29
34
|
color: ${({ hoverColor }) => hoverColor};
|