{user?.avatar
?
diff --git a/src/features/ArticlesList/ui/ArticlesListItem/ArticlesListItem.tsx b/src/features/ArticlesList/ui/ArticlesListItem/ArticlesListItem.tsx
index aee06c1..3a4586a 100644
--- a/src/features/ArticlesList/ui/ArticlesListItem/ArticlesListItem.tsx
+++ b/src/features/ArticlesList/ui/ArticlesListItem/ArticlesListItem.tsx
@@ -1,7 +1,7 @@
import { FC, HTMLAttributeAnchorTarget, memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { ViewsIcon } from '@/shared/assets/icons';
-import { RoutePath } from '@/shared/consts/router';
+import { getRouteArticleDetails, getRouteProfile } from '@/shared/consts/router';
import { classNames } from '@/shared/lib/classNames/classNames';
import { AppLink } from '@/shared/ui/AppLink';
import { Avatar, AvatarSize } from '@/shared/ui/Avatar';
@@ -50,7 +50,7 @@ export const ArticlesListItem: FC
= memo(({ className, ar
-
+
@@ -66,7 +66,7 @@ export const ArticlesListItem: FC
= memo(({ className, ar
)}
{canEdit && (
-
+
diff --git a/src/pages/ForbiddenPage/ui/ForbiddenPage/ForbiddenPage.tsx b/src/pages/ForbiddenPage/ui/ForbiddenPage/ForbiddenPage.tsx
index bb247d4..274b0c7 100644
--- a/src/pages/ForbiddenPage/ui/ForbiddenPage/ForbiddenPage.tsx
+++ b/src/pages/ForbiddenPage/ui/ForbiddenPage/ForbiddenPage.tsx
@@ -5,7 +5,7 @@ import { VStack } from '@/shared/ui/Stack';
import { Text, TextSize, TextTheme } from '@/shared/ui/Text';
import { Button } from '@/shared/ui/Button';
import { AppLink } from '@/shared/ui/AppLink';
-import { RoutePath } from '@/shared/consts/router';
+import { getRouteMain } from '@/shared/consts/router';
interface ForbiddenPageProps {
className?: string;
@@ -22,7 +22,7 @@ const ForbiddenPage: FC = () => {
theme={TextTheme.ERROR}
size={TextSize.L}
/>
-
+
diff --git a/src/shared/consts/router.ts b/src/shared/consts/router.ts
index 131db59..7ddf105 100644
--- a/src/shared/consts/router.ts
+++ b/src/shared/consts/router.ts
@@ -12,16 +12,12 @@ export enum AppRoutes {
NOT_FOUND = 'not_found',
}
-export const RoutePath: Record = {
- [AppRoutes.MAIN]: '/',
- [AppRoutes.ABOUT]: '/about',
- [AppRoutes.PROFILE]: '/profile/', //! :id
- [AppRoutes.ARTICLES]: '/articles',
- [AppRoutes.ARTICLE_DETAILS]: '/articles/', //! :id
- [AppRoutes.ARTICLE_CREATE]: '/articles/create',
- [AppRoutes.ARTICLE_EDIT]: '/articles/:id/edit',
- [AppRoutes.ADMIN_PANEL]: '/admin-panel',
- [AppRoutes.FORBIDDEN_PAGE]: '/forbidden',
- // * Not found page
- [AppRoutes.NOT_FOUND]: '*',
-};
+export const getRouteMain = () => '/';
+export const getRouteAbout = () => '/about';
+export const getRouteProfile = (id: string) => `/profile/${id}`;
+export const getRouteArticles = () => '/articles';
+export const getRouteArticleDetails = (id: string) => `/articles/${id}`;
+export const getRouteArticleCreate = () => '/articles/create';
+export const getRouteArticleEdit = (id: string) => `/articles/${id}/edit`;
+export const getRouteAdminPanel = () => '/admin-panel';
+export const getRouteForbidden = () => '/forbidden';
diff --git a/src/widgets/Aside/model/selectors/getAsideItems/getAsideItems.ts b/src/widgets/Aside/model/selectors/getAsideItems/getAsideItems.ts
index 9185ba6..bd262fa 100644
--- a/src/widgets/Aside/model/selectors/getAsideItems/getAsideItems.ts
+++ b/src/widgets/Aside/model/selectors/getAsideItems/getAsideItems.ts
@@ -1,6 +1,6 @@
import { createSelector } from '@reduxjs/toolkit';
import { getUserAuthData } from '@/entities/User';
-import { RoutePath } from '@/shared/consts/router';
+import { getRouteAbout, getRouteArticles, getRouteMain, getRouteProfile } from '@/shared/consts/router';
import { MainPageIcon, AboutPageIcon, ProfilePageIcon, ArticlesPageIcon } from '@/shared/assets/icons';
import { AsideItemType } from '../../types/asideItems';
@@ -9,12 +9,12 @@ export const getAsideItems = createSelector(
(userData) => {
const asideItemsList: AsideItemType[] = [
{
- path: RoutePath.main,
+ path: getRouteMain(),
Icon: MainPageIcon,
text: 'main-link',
},
{
- path: RoutePath.about,
+ path: getRouteAbout(),
Icon: AboutPageIcon,
text: 'about-link',
},
@@ -23,13 +23,13 @@ export const getAsideItems = createSelector(
if (userData) {
asideItemsList.push(
{
- path: `${RoutePath.profile}${userData?.id}`,
+ path: getRouteProfile(userData.id),
Icon: ProfilePageIcon,
text: 'profile-link',
authOnly: true,
},
{
- path: RoutePath.articles,
+ path: getRouteArticles(),
Icon: ArticlesPageIcon,
text: 'articles-link',
authOnly: true,