From 22ee20b006c31900ee60b3bc922e802b3b7023da Mon Sep 17 00:00:00 2001 From: Mav-Ivan <110425368+Mav-Ivan@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:47:09 +0200 Subject: [PATCH] refactor code --- .../categories-container/CategoriesContainer.tsx | 3 +-- .../my-resources/my-resources-table/MyResourcesTable.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/containers/my-resources/categories-container/CategoriesContainer.tsx b/src/containers/my-resources/categories-container/CategoriesContainer.tsx index 08d4a0a07..e22c6f590 100644 --- a/src/containers/my-resources/categories-container/CategoriesContainer.tsx +++ b/src/containers/my-resources/categories-container/CategoriesContainer.tsx @@ -167,8 +167,7 @@ const CategoriesContainer = () => { sort: sortOptions, itemsPerPage, resource: ResourcesTabsEnum.Categories, - sx: styles.table, - rename: true + sx: styles.table } return ( diff --git a/src/containers/my-resources/my-resources-table/MyResourcesTable.tsx b/src/containers/my-resources/my-resources-table/MyResourcesTable.tsx index af343b91c..c736267b7 100644 --- a/src/containers/my-resources/my-resources-table/MyResourcesTable.tsx +++ b/src/containers/my-resources/my-resources-table/MyResourcesTable.tsx @@ -15,7 +15,8 @@ import { ErrorResponse, TableItem, ResourcesTableData, - TableRowAction + TableRowAction, + ResourcesTabsEnum } from '~/types' import { roundedBorderTable } from '~/containers/my-cooperations/cooperations-container/CooperationContainer.styles' @@ -90,7 +91,10 @@ const MyResourcesTable = ({ const rowActions: TableRowAction[] = [ { - label: !rename ? t('common.edit') : t('common.rename'), + label: + resource === ResourcesTabsEnum.Categories + ? t('common.rename') + : t('common.edit'), func: onEdit }, {