@xqmsg/ui-core 0.18.7 → 0.18.8
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/dist/components/navigation/components/items/index.d.ts +1 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/ui-core.cjs.development.js +14 -4
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +14 -4
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +3 -1
- package/src/components/navigation/components/items/index.tsx +15 -1
- package/src/components/navigation/index.tsx +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.18.
|
|
2
|
+
"version": "0.18.8",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -99,11 +99,13 @@
|
|
|
99
99
|
"@emotion/react": "~11.9.0",
|
|
100
100
|
"@emotion/styled": "~11.6.0",
|
|
101
101
|
"@hookform/resolvers": "^2.9.7",
|
|
102
|
+
"@types/react-router-dom": "^5.3.3",
|
|
102
103
|
"axios": "^0.27.2",
|
|
103
104
|
"framer-motion": "6.3.0",
|
|
104
105
|
"react-hook-form": "^7.34.0",
|
|
105
106
|
"react-icons": "^4.4.0",
|
|
106
107
|
"react-is": "^18.2.0",
|
|
108
|
+
"react-router-dom": "^5.3.3",
|
|
107
109
|
"react-select": "^5.4.0",
|
|
108
110
|
"yup": "^0.32.11"
|
|
109
111
|
},
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Box, Flex, Link } from '@chakra-ui/react';
|
|
3
|
+
import { Link as RouterLink } from 'react-router-dom';
|
|
3
4
|
import colors from '../../../../theme/foundations/colors';
|
|
4
5
|
|
|
5
6
|
export interface NavigationMenuItemProps {
|
|
6
7
|
leftIcon: JSX.Element;
|
|
7
8
|
label: string;
|
|
9
|
+
to?: string;
|
|
8
10
|
href?: string;
|
|
9
11
|
isSelected: boolean;
|
|
10
12
|
onClick: () => void;
|
|
@@ -19,6 +21,7 @@ export const NavigationMenuItem: React.FC<NavigationMenuItemProps> = ({
|
|
|
19
21
|
label,
|
|
20
22
|
leftIcon,
|
|
21
23
|
href,
|
|
24
|
+
to,
|
|
22
25
|
rightIcon,
|
|
23
26
|
isExternal,
|
|
24
27
|
isSelected,
|
|
@@ -26,17 +29,28 @@ export const NavigationMenuItem: React.FC<NavigationMenuItemProps> = ({
|
|
|
26
29
|
}) => {
|
|
27
30
|
let additionalProps = {};
|
|
28
31
|
|
|
32
|
+
let reactRouterLinkProps = {};
|
|
33
|
+
|
|
34
|
+
if (to) {
|
|
35
|
+
reactRouterLinkProps = {
|
|
36
|
+
to,
|
|
37
|
+
as: RouterLink,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
29
41
|
if (isExternal) {
|
|
30
42
|
additionalProps = {
|
|
31
43
|
...additionalProps,
|
|
32
44
|
referrerPolicy: 'no-referrer',
|
|
33
45
|
target: '_blank',
|
|
46
|
+
href,
|
|
47
|
+
isExternal: true,
|
|
34
48
|
};
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
return (
|
|
38
52
|
<Link
|
|
39
|
-
|
|
53
|
+
{...reactRouterLinkProps}
|
|
40
54
|
{...additionalProps}
|
|
41
55
|
onClick={onClick}
|
|
42
56
|
display="flex"
|