Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
- add hash router
  • Loading branch information
elrouss committed Apr 12, 2024
1 parent 07d413b commit cb67e75
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const App = () => {
return (
<AnimatePresence mode="wait" initial>
<Routes key={location.pathname} location={location}>
<Route path="/at-work" element={<Root />} />
<Route path="/at-work/:id" element={<UserProfile />} />
<Route path="/" element={<Root />} />
<Route path="/:id" element={<UserProfile />} />
</Routes>
</AnimatePresence>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/blocks/user-card/user-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const UserCard = (data: IUserCardProps) => {
label: 'Редактировать',
onClick: () => {
dispatch(setInitialUserData(data));
navigate(`/at-work/${id}`);
navigate(`/${id}`);
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const Logo = () => {
return (
<Link
className={styles.logo}
to="/at-work"
to="/"
aria-label="Перейти на главную страницу"
>
<Svg name="logo" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/sections/layout-inner/layout-inner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const LayoutInner = ({
extraClass={styles.backBtn}
iconName="arrow-left"
label="Назад"
onClick={() => navigate('/at-work')}
onClick={() => navigate('/')}
/>
)}
{title && <TitleWithBorder title={title} tag="h2" />}
Expand Down
6 changes: 3 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { HashRouter as Router } from 'react-router-dom';
import { App } from './App';
import { store } from './services/app/store';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Provider store={store}>
<BrowserRouter>
<Router>
<App />
</BrowserRouter>
</Router>
</Provider>
</React.StrictMode>
);

0 comments on commit cb67e75

Please sign in to comment.