-
+
+
+ {when(
+ searchQuery !== '',
+
+
+ {
+ setSearchQuery('')
+ clearSearchInput()
+ }}
+ style={{ cursor: 'pointer' }}
+ >
+ ←{' '}
+ {' '}
+ Search results for
+
+ "{searchQuery}"
+ ,
+ )}
+ {when(
+ searchQuery === '',
+
{categories[selectedCategory].name}
,
+ )}
+
+ {when(
+ projects.length > 0 && searchQuery === '',
+
+
+
,
+ )}
+
+
{when(
- searchQuery !== '',
-
-
- {
- setSearchQuery('')
- const inputElement = document.getElementById('search-input') as HTMLInputElement
- if (inputElement) {
- inputElement.value = ''
- }
+ projects.length > 1,
+
+
+
- ←{' '}
- {' '}
- Search results for
-
-
"{searchQuery}"
- ,
+
{convertToTitleCase(sortCriteria)}
+
{sortAscending ? '↑' : '↓'}
+
+
+
+ ,
)}
{when(
- searchQuery === '',
- {categories[selectedCategory].name}
,
+ projects.length > 0,
+
+ {
+ setGridView(false)
+ }}
+ className={button({
+ size: 'square',
+ color: !gridView ? 'selected' : 'transparent',
+ })}
+ />
+ {
+ setGridView(true)
+ }}
+ className={button({
+ size: 'square',
+ color: gridView ? 'selected' : 'transparent',
+ })}
+ />
+
,
)}
- {when(
- projects.length > 0,
-
-
-
,
- )}
- {when(
- projects.length > 1,
-
-
-
-
-
{convertToTitleCase(sortCriteria)}
-
{sortAscending ? '↑' : '↓'}
-
-
-
-
-
- {
- setGridView(false)
- }}
- className={button({
- size: 'square',
- color: !gridView ? 'selected' : 'transparent',
- })}
- />
- {
- setGridView(true)
- }}
- className={button({
- size: 'square',
- color: gridView ? 'selected' : 'transparent',
- })}
- />
-
-
,
- )}
+ {when(projects.length === 0,
)}
)
})
@@ -488,7 +504,7 @@ const CategoryTrashActions = React.memo(({ projects }: { projects: ProjectWithou
})
CategoryTrashActions.displayName = 'CategoryTrashActions'
-const ProjectCards = React.memo(
+const Projects = React.memo(
({
projects,
collaborators,
@@ -500,7 +516,6 @@ const ProjectCards = React.memo(
const selectedProjectId = useProjectsStore((store) => store.selectedProjectId)
const setSelectedProjectId = useProjectsStore((store) => store.setSelectedProjectId)
- const selectedCategory = useProjectsStore((store) => store.selectedCategory)
const handleProjectSelect = React.useCallback(
(project: ProjectWithoutContent) =>
@@ -510,33 +525,6 @@ const ProjectCards = React.memo(
return (
<>
- {when(
- projects.length === 0 && selectedCategory === 'trash',
-
-
-
Your trash is empty!
-
- Deleted projects are kept here until you destroy them for good.
-
-
,
- )}
{when(
projects.length > 0 && !gridView,
{
+ const selectedCategory = useProjectsStore((store) => store.selectedCategory)
+ const searchQuery = useProjectsStore((store) => store.searchQuery)
+
+ function getCategorySubtitle(cat: Category) {
+ switch (cat) {
+ case 'allProjects':
+ return 'Projects you create or open will show up here.'
+ case 'trash':
+ return 'Deleted projects are kept here until you destroy them for good.'
+ default:
+ assertNever(cat)
+ }
+ }
+
+ const subtitle = searchQuery !== '' ? 'No projects found.' : getCategorySubtitle(selectedCategory)
+
+ return
{subtitle}
+})
+NoProjectsMessage.displayName = 'NoProjectsMessage'
const ProjectCard = React.memo(
({
diff --git a/utopia-remix/public/assets/trash-can.png b/utopia-remix/public/assets/trash-can.png
index 8b40221d91a0..4d580c64e743 100644
Binary files a/utopia-remix/public/assets/trash-can.png and b/utopia-remix/public/assets/trash-can.png differ
diff --git a/utopia-remix/public/assets/utopium.png b/utopia-remix/public/assets/utopium.png
new file mode 100644
index 000000000000..f0f7a80ecb25
Binary files /dev/null and b/utopia-remix/public/assets/utopium.png differ