From 7e2c87bfeec6ee03661a5bb891bfe439fe26c0f4 Mon Sep 17 00:00:00 2001 From: woothu <32914662+woothu@users.noreply.github.com> Date: Mon, 22 Jun 2020 15:39:34 +0200 Subject: [PATCH 1/2] fix: CBreadcrumbRouter: fix assigning paths to items #118 --- src/breadcrumb/CBreadcrumbRouter.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/breadcrumb/CBreadcrumbRouter.js b/src/breadcrumb/CBreadcrumbRouter.js index 500f1c06..6c618c60 100644 --- a/src/breadcrumb/CBreadcrumbRouter.js +++ b/src/breadcrumb/CBreadcrumbRouter.js @@ -16,12 +16,12 @@ const getPaths = pathname => { return paths } -const CBreadcrumbRouteItem = ({name, path}, currPath) => { - if (path === currPath) { - return {name} +const CBreadcrumbRouteItem = ({name, currPath}, fullCurrPath) => { + if (currPath === fullCurrPath) { + return {name} } else { - return - + return + {name} @@ -41,11 +41,12 @@ const CBreadcrumbRouter = props => { if (routes) { const currPath = useLocation().pathname const paths = getPaths(currPath) - const currRoutes = paths.map(path => { - return routes.find(route => matchPath(path, { + const currRoutes = paths.map(currPath => { + const route = routes.find(route => matchPath(currPath, { path: route.path, exact: route.exact })) + return { ...route, currPath } }).filter(route => route) items = currRoutes.map(route => { return CBreadcrumbRouteItem(route, currPath) From 5eac06b6f6ee1cffaf02a7e2e3696b517f324e56 Mon Sep 17 00:00:00 2001 From: woothu <32914662+woothu@users.noreply.github.com> Date: Mon, 22 Jun 2020 15:42:36 +0200 Subject: [PATCH 2/2] chore: 3.0.4 version release: update dependencies --- CHANGELOG.md | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7236101c..5bebe48c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,8 @@ All notable changes to this project will be documented in this file. Dates are d > 17 June 2020 - chore: add auto-changelog [`dd56a22`](https://github.com/coreui/coreui-react/commit/dd56a22df2479371b33abc3802fb4f0406525fe1) +- chore: 3.0.3 version release: update dependencies and changelog [`293c637`](https://github.com/coreui/coreui-react/commit/293c63726e1a477af657d6b13fa619cba3ecde2f) - fix: CModal: fix animations [`7740fce`](https://github.com/coreui/coreui-react/commit/7740fcee3583d0fd9324f23d1cd12f0c9914b19a) -- fix: CBreadcrumbRouter: add route parameters support #118 [`6d8b59b`](https://github.com/coreui/coreui-react/commit/6d8b59b9cfa145a30f4e54832941ce28ef514e29) #### [3.0.2](https://github.com/coreui/coreui-react/compare/3.0.1...3.0.2) diff --git a/package.json b/package.json index 6adb4131..df571157 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react", - "version": "3.0.3", + "version": "3.0.4", "description": "CoreUI React Bootstrap 4 components", "license": "MIT", "author": { @@ -60,7 +60,7 @@ "babel-eslint": "^10.1.0", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.2", - "eslint": "^7.2.0", + "eslint": "^7.3.0", "eslint-plugin-import": "^2.21.2", "eslint-plugin-react": "^7.20.0", "nwb": "^0.25.2",