Skip to content

Commit 82317f8

Browse files
authored
fix paths (kyma-project#3953)
1 parent 7bb4c41 commit 82317f8

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/components/App/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default function App() {
138138
path="*"
139139
element={
140140
<IncorrectPath
141-
to="clusters"
141+
to="/clusters"
142142
message={t(
143143
'components.incorrect-path.message.clusters',
144144
)}

src/components/App/ClusterRoutes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import NamespaceRoutes from './NamespaceRoutes';
2323
import { createExtensibilityRoutes } from './ExtensibilityRoutes';
2424
import { IncorrectPath } from './IncorrectPath';
2525
import { removePreviousPath } from 'state/useAfterInitHook';
26+
import { useUrl } from 'hooks/useUrl';
2627

2728
export default function ClusterRoutes() {
2829
let { currentClusterName } = useParams() || {};
@@ -36,6 +37,7 @@ export default function ClusterRoutes() {
3637
const [cluster, setCluster] = useRecoilState(clusterState);
3738
const [search] = useSearchParams();
3839
const [extensibilityRoutes, setExtensibilityRoutes] = useState(null);
40+
const { clusterUrl } = useUrl();
3941

4042
useEffect(() => {
4143
if (extensions?.length) {
@@ -76,7 +78,7 @@ export default function ClusterRoutes() {
7678
path="*"
7779
element={
7880
<IncorrectPath
79-
to="overview"
81+
to={clusterUrl('overview')}
8082
message={t('components.incorrect-path.message.cluster')}
8183
/>
8284
}

src/components/App/NamespaceRoutes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { useGet } from 'shared/hooks/BackendAPI/useGet';
1616
export default function NamespaceRoutes() {
1717
const { t } = useTranslation();
1818
const { namespaceId } = useParams();
19-
const { clusterUrl } = useUrl();
19+
const { clusterUrl, namespaceUrl } = useUrl();
2020
const language = useRecoilValue(languageAtom);
2121
const extensions = useRecoilValue(extensionsState);
2222
const [extensibilityRoutes, setExtensibilityRoutes] = useState<
@@ -62,7 +62,7 @@ export default function NamespaceRoutes() {
6262
path="*"
6363
element={
6464
<IncorrectPath
65-
to=""
65+
to={namespaceUrl('')}
6666
message={t('components.incorrect-path.message.namespace')}
6767
/>
6868
}

0 commit comments

Comments
 (0)