1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-09 13:47:13 +02:00

chore: if flag is disabled automatically revert to showing cards (#10467)

https://linear.app/unleash/issue/2-3753/fix-if-the-flag-is-disabled-we-should-automatically-revert-back-to

If the flag is disabled we should automatically revert back to showing
cards.
This commit is contained in:
Nuno Góis 2025-08-06 11:58:07 +01:00 committed by GitHub
parent 44650e4e2f
commit 18c9ea1d7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import { UpgradeProjectCard } from '../ProjectCard/UpgradeProjectCard.tsx';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import type { ProjectsListView } from './hooks/useProjectsListState.ts';
import { ProjectsListTable } from './ProjectsListTable/ProjectsListTable.tsx';
import { useUiFlag } from 'hooks/useUiFlag.ts';
const StyledGridContainer = styled('div')(({ theme }) => ({
display: 'grid',
@ -46,10 +47,11 @@ export const ProjectGroup = ({
}: ProjectGroupProps) => {
const ProjectCard = ProjectCardComponent ?? DefaultProjectCard;
const { isOss } = useUiConfig();
const projectListViewToggleEnabled = useUiFlag('projectListViewToggle');
const projectsToRender = loading ? loadingData : projects;
if (!isOss() && view === 'list') {
if (!isOss() && projectListViewToggleEnabled && view === 'list') {
return <ProjectsListTable projects={projectsToRender} />;
}