From 04c25c1dadf4e1cfe12d8fcdb518ddf00fd19a51 Mon Sep 17 00:00:00 2001 From: Gitar Date: Mon, 23 Sep 2024 08:07:07 +0000 Subject: [PATCH] [Gitar] Updating TSX files --- .../ProjectCardFooter/ProjectCardFooter.tsx | 16 +------- .../ProjectModeBadge/ProjectModeBadge.tsx | 38 +++---------------- .../project/ProjectList/ProjectGroup.tsx | 12 +----- .../project/ProjectList/ProjectList.tsx | 9 +---- 4 files changed, 11 insertions(+), 64 deletions(-) diff --git a/frontend/src/component/project/ProjectCard/ProjectCardFooter/ProjectCardFooter.tsx b/frontend/src/component/project/ProjectCard/ProjectCardFooter/ProjectCardFooter.tsx index 8c286ddb1e8e..293fa5839cce 100644 --- a/frontend/src/component/project/ProjectCard/ProjectCardFooter/ProjectCardFooter.tsx +++ b/frontend/src/component/project/ProjectCard/ProjectCardFooter/ProjectCardFooter.tsx @@ -1,13 +1,8 @@ import type React from 'react'; import type { FC } from 'react'; import { Box, styled } from '@mui/material'; -import { - type IProjectOwnersProps, - ProjectOwners as LegacyProjectOwners, -} from '../LegacyProjectOwners/LegacyProjectOwners'; +import { type IProjectOwnersProps } from '../LegacyProjectOwners/LegacyProjectOwners'; import { ProjectOwners } from './ProjectOwners/ProjectOwners'; -import { useUiFlag } from 'hooks/useUiFlag'; -import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; interface IProjectCardFooterProps { id?: string; @@ -31,20 +26,13 @@ const StyledFooter = styled(Box)<{ disabled: boolean }>( ); export const ProjectCardFooter: FC = ({ - id, children, owners, disabled = false, }) => { - const projectListImprovementsEnabled = useUiFlag('projectListImprovements'); - return ( - } - elseShow={} - /> + {children} ); diff --git a/frontend/src/component/project/ProjectCard/ProjectModeBadge/ProjectModeBadge.tsx b/frontend/src/component/project/ProjectCard/ProjectModeBadge/ProjectModeBadge.tsx index d2796b265748..92bc99ef36f0 100644 --- a/frontend/src/component/project/ProjectCard/ProjectModeBadge/ProjectModeBadge.tsx +++ b/frontend/src/component/project/ProjectCard/ProjectModeBadge/ProjectModeBadge.tsx @@ -1,11 +1,7 @@ import type { FC } from 'react'; -import LockIcon from '@mui/icons-material/Lock'; import ProtectedProjectIcon from '@mui/icons-material/LockOutlined'; -import VisibilityOffIcon from '@mui/icons-material/VisibilityOff'; import PrivateProjectIcon from '@mui/icons-material/VisibilityOffOutlined'; import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip'; -import { Badge } from 'component/common/Badge/Badge'; -import { useUiFlag } from 'hooks/useUiFlag'; import { styled } from '@mui/material'; interface IProjectModeBadgeProps { @@ -19,50 +15,28 @@ const StyledIcon = styled('div')(({ theme }) => ({ })); export const ProjectModeBadge: FC = ({ mode }) => { - const projectListImprovementsEnabled = useUiFlag('projectListImprovements'); - if (mode === 'private') { - if (projectListImprovementsEnabled) { - return ( - - - - - - ); - } return ( - } /> + + + ); } if (mode === 'protected') { - if (projectListImprovementsEnabled) { - return ( - - - - - - ); - } return ( - } /> + + + ); } diff --git a/frontend/src/component/project/ProjectList/ProjectGroup.tsx b/frontend/src/component/project/ProjectList/ProjectGroup.tsx index 001666e51fbc..8cd469c02847 100644 --- a/frontend/src/component/project/ProjectList/ProjectGroup.tsx +++ b/frontend/src/component/project/ProjectList/ProjectGroup.tsx @@ -1,13 +1,11 @@ import type { ComponentType, ReactNode } from 'react'; import { Link } from 'react-router-dom'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { ProjectCard as LegacyProjectCard } from '../ProjectCard/LegacyProjectCard'; import { ProjectCard as NewProjectCard } from '../ProjectCard/ProjectCard'; import type { ProjectSchema } from 'openapi'; import loadingData from './loadingData'; import { TablePlaceholder } from 'component/common/Table'; import { styled, Typography } from '@mui/material'; -import { useUiFlag } from 'hooks/useUiFlag'; import { useSearchHighlightContext } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext'; import { flexColumn } from 'themes/themeStyles'; @@ -72,10 +70,7 @@ export const ProjectGroup = ({ ProjectCardComponent, link = true, }: ProjectGroupProps) => { - const projectListImprovementsEnabled = useUiFlag('projectListImprovements'); - const ProjectCard = - ProjectCardComponent ?? - (projectListImprovementsEnabled ? NewProjectCard : LegacyProjectCard); + const ProjectCard = ProjectCardComponent ?? NewProjectCard; const { searchQuery } = useSearchHighlightContext(); return ( @@ -91,10 +86,7 @@ export const ProjectGroup = ({ } /> {sectionSubtitle} diff --git a/frontend/src/component/project/ProjectList/ProjectList.tsx b/frontend/src/component/project/ProjectList/ProjectList.tsx index 4c3acbb40fb3..427729976bb7 100644 --- a/frontend/src/component/project/ProjectList/ProjectList.tsx +++ b/frontend/src/component/project/ProjectList/ProjectList.tsx @@ -13,7 +13,6 @@ import { useUiFlag } from 'hooks/useUiFlag'; import { ProjectsListSort } from './ProjectsListSort/ProjectsListSort'; import { useProjectsListState } from './hooks/useProjectsListState'; import { SearchHighlightProvider } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext'; -import { ProjectList as LegacyProjectList } from './LegacyProjectList'; import { ProjectCreationButton } from './ProjectCreationButton/ProjectCreationButton'; import { useGroupedProjects } from './hooks/useGroupedProjects'; import { useProjectsSearchAndSort } from './hooks/useProjectsSearchAndSort'; @@ -146,11 +145,5 @@ const NewProjectList = () => { }; export const ProjectList: FC = () => { - const projectListImprovementsEnabled = useUiFlag('projectListImprovements'); - - if (projectListImprovementsEnabled) { - return ; - } - - return ; + return ; };