Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 48f8798

Browse files
chore: reorganized empty states to use new isEmpty boolean
1 parent 158e154 commit 48f8798

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

src/renderer/pages/FavoriteCookbooks.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ export default function FavoriteCookbooks() {
4242
return <CookbookTableLoading />;
4343
}
4444

45-
if (userCookbooks.length === 0) {
46-
return <CookbookTableEmpty />;
45+
if (filteredCookbooks.length === 0 && !filters.isEmpty) {
46+
return <CookbookTableEmptyFiltered />;
4747
}
4848

4949
if (filteredCookbooks.length === 0) {
50-
return <CookbookTableEmptyFiltered />;
50+
return <CookbookTableEmpty />;
5151
}
5252

5353
return <CookbookTable page="favorite" cookbooks={filteredCookbooks} />;

src/renderer/pages/FavoriteSnippets.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export default function MySnippets() {
4444
return <SnippetTableLoading />;
4545
}
4646

47-
if (userFavoriteRecipes.length === 0) {
48-
return <SnippetTableEmpty />;
47+
if (filteredRecipes.length === 0 && !filters.isEmpty) {
48+
return <SnippetTableEmptyFiltered />;
4949
}
5050

5151
if (filteredRecipes.length === 0) {
52-
return <SnippetTableEmptyFiltered />;
52+
return <SnippetTableEmpty />;
5353
}
5454

5555
return <SnippetTable page="favorite" recipes={filteredRecipes} />;

src/renderer/pages/MyCookbooks.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ export default function MyCookbooks() {
4242
return <CookbookTableLoading />;
4343
}
4444

45-
if (userCookbooks.length === 0) {
46-
return <CookbookTableEmpty />;
45+
if (filteredCookbooks.length === 0 && !filters.isEmpty) {
46+
return <CookbookTableEmptyFiltered />;
4747
}
4848

4949
if (filteredCookbooks.length === 0) {
50-
return <CookbookTableEmptyFiltered />;
50+
return <CookbookTableEmpty />;
5151
}
5252

5353
return <CookbookTable page="my" cookbooks={filteredCookbooks} />;

src/renderer/pages/MySnippets.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export default function MySnippets() {
4444
return <SnippetTableLoading />;
4545
}
4646

47-
if (userRecipes.length === 0) {
48-
return <SnippetTableEmpty />;
47+
if (filteredRecipes.length === 0 && !filters.isEmpty) {
48+
return <SnippetTableEmptyFiltered />;
4949
}
5050

5151
if (filteredRecipes.length === 0) {
52-
return <SnippetTableEmptyFiltered />;
52+
return <SnippetTableEmpty />;
5353
}
5454

5555
return <SnippetTable page="my" recipes={filteredRecipes} />;

src/renderer/pages/TeamCookbooks.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export default function TeamCookbooks() {
4141
return <CookbookTableLoading />;
4242
}
4343

44-
if (userCookbooks.length === 0) {
45-
return <CookbookTableEmpty />;
44+
if (filteredCookbooks.length === 0 && !filters.isEmpty) {
45+
return <CookbookTableEmptyFiltered />;
4646
}
4747

4848
if (filteredCookbooks.length === 0) {
49-
return <CookbookTableEmptyFiltered />;
49+
return <CookbookTableEmpty />;
5050
}
5151

5252
return <CookbookTable page="team" cookbooks={filteredCookbooks} />;

src/renderer/pages/TeamSnippets.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export default function TeamSnippets() {
4444
return <SnippetTableLoading />;
4545
}
4646

47-
if (teamRecipes.length === 0) {
48-
return <SnippetTableEmpty />;
47+
if (filteredRecipes.length === 0 && !filters.isEmpty) {
48+
return <SnippetTableEmptyFiltered />;
4949
}
5050

5151
if (filteredRecipes.length === 0) {
52-
return <SnippetTableEmptyFiltered />;
52+
return <SnippetTableEmpty />;
5353
}
5454

5555
return <SnippetTable page="team" recipes={filteredRecipes} />;

0 commit comments

Comments
 (0)