Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
bug: Исправлена проблема 404 ошибки при перезагрузке страницы на gh p…
Browse files Browse the repository at this point in the history
…ages
  • Loading branch information
AndTem committed Apr 19, 2024
1 parent 9b54a74 commit f2bafe6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .env.local
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_RENDER_RADAR_URL=https://kaluga-astral.github.io/render-tech-radar
VITE_BASE_PATH=''
VITE_BASE_PATH='/technology-radar'
12 changes: 6 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import './App.css';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { HashRouter, Route, Routes } from 'react-router-dom';
import { ThemeProvider, Typography } from '@astral/ui';
import { DashboardLayout } from '@astral/ui';

import { theme } from './theme';
import { Header, Radar, SideBar } from './components';
import { BASE_PATH, TEAMS } from './config';
import { TEAMS } from './config';
import { IntroScreen } from './screens';

function App() {
return (
<ThemeProvider theme={theme}>
<BrowserRouter>
<HashRouter>
<DashboardLayout>
<Header />
<SideBar />
<DashboardLayout.Main>
<Routes>
<Route path={BASE_PATH} element={<IntroScreen />} />
<Route path="/" element={<IntroScreen />} />
{Object.entries(TEAMS).map(([id]) => (
<Route
key={id}
path={`${BASE_PATH}/${id}`}
path={`/${id}`}
element={<Radar jsonName={id} />}
/>
))}
<Route path="/*" element={<Typography>Не найдено</Typography>} />
</Routes>
</DashboardLayout.Main>
</DashboardLayout>
</BrowserRouter>
</HashRouter>
</ThemeProvider>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Link, LinkProps, useLocation } from 'react-router-dom';
import { DashboardLayout, NavMenuProps } from '@astral/ui';
import { forwardRef } from 'react';

import { BASE_PATH, TEAMS } from '../../config';
import { TEAMS } from '../../config';

export const SideBar = () => {
const { pathname } = useLocation();
Expand All @@ -14,10 +14,10 @@ export const SideBar = () => {
{
icon: <Icon />,
text: name,
active: pathname === `${BASE_PATH}/${id}`,
active: pathname === `/${id}`,
component: forwardRef<HTMLAnchorElement, LinkProps>(
({ children, ...props }, ref) => (
<Link key={id} ref={ref} {...props} to={`${BASE_PATH}/${id}`}>
<Link key={id} ref={ref} {...props} to={`/${id}`}>
{children}
</Link>
),
Expand Down
4 changes: 2 additions & 2 deletions src/screens/IntroScreen/IntroScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Typography } from '@astral/ui';
import { Link } from 'react-router-dom';

import { BASE_PATH, TEAMS } from '../../config';
import { TEAMS } from '../../config';

import { IntroScreenDivider, IntroScreenPage } from './styles';

Expand Down Expand Up @@ -108,7 +108,7 @@ export const IntroScreen = () => {
<ul>
{Object.entries(TEAMS).map(([id, { name }]) => (
<li>
<Link to={`${BASE_PATH}/${id}`}>
<Link to={`/${id}`}>
<Typography color="info">{name}</Typography>
</Link>
</li>
Expand Down

0 comments on commit f2bafe6

Please sign in to comment.