mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	This PR removes the previous "my projects" filter in favor always
splitting projects, but showing both on the main screen.
To make it a bit easier to work with, it also moves the project group
component into its own file, causing some extra lines of code change. My
apologies 🙇🏼
		
	
			
		
			
				
	
	
		
			19 lines
		
	
	
		
			506 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			506 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import type { IProjectCard } from 'interfaces/project';
 | |
| 
 | |
| export const groupProjects = (
 | |
|     myProjectIds: Set<string>,
 | |
|     filteredProjects: IProjectCard[],
 | |
| ) => {
 | |
|     const mine: IProjectCard[] = [];
 | |
|     const other: IProjectCard[] = [];
 | |
| 
 | |
|     for (const project of filteredProjects) {
 | |
|         if (project.favorite || myProjectIds.has(project.id)) {
 | |
|             mine.push(project);
 | |
|         } else {
 | |
|             other.push(project);
 | |
|         }
 | |
|     }
 | |
|     return { myProjects: mine, otherProjects: other };
 | |
| };
 |