Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#95 empty state search #96

Merged
merged 21 commits into from
Nov 30, 2024
Merged

#95 empty state search #96

merged 21 commits into from
Nov 30, 2024

Conversation

banushi-a
Copy link
Contributor

@banushi-a banushi-a commented Nov 25, 2024

Description

Adds super simple (ugly even) loading and no-results components.

Motivation and Context

So this was j bothering me, like we need to do actual designs but it was low effort so I figured why not.

Also changed the cooper logo to be a component bc i was tired of figuring out the ratio of height to width or whatever

Closes #95

How has this been tested?

You may be thinking, "Wow, Cooper has made so much progress this semester! But I wonder where there tests are?". You no longer need to fret! See, although I didn't write any tests yet, I think adding tests is a great ✨ winter break activity ✨. So you can rest assured that even though there aren't any yet, a soon-to-be PR will fill that gap and mend your worries ◡̈ .

Screenshots (if appropriate):

Screenshot 2024-11-24 at 7 32 28 PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • I have moved the ticket to "In Review"
  • I have added reviewers to this PR
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cooper ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 29, 2024 8:50pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cooper-auth ⬜️ Skipped (Inspect) Nov 29, 2024 8:50pm
cooper-docs ⬜️ Skipped (Inspect) Nov 29, 2024 8:50pm

@vercel vercel bot temporarily deployed to Preview – cooper November 25, 2024 00:18 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper-docs November 25, 2024 00:26 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper-auth November 25, 2024 00:26 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper November 25, 2024 00:27 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper-docs November 25, 2024 00:32 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper-auth November 25, 2024 00:32 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper November 25, 2024 00:33 Inactive
@banushi-a banushi-a marked this pull request as ready for review November 25, 2024 00:34
Copy link
Collaborator

@RishikeshNK RishikeshNK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIYE we needed this. I was thinking of doing it in the loading.tsx file (there's a loading skeleton ticket buried
somewhere on that board) but I think this is a better approach!

Edit: Found it! #51

@@ -106,6 +108,8 @@ export default function Roles({
</div>
</div>
)}
{reviews.isSuccess && reviews.data.length === 0 && <NoResults />}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally a nit but thoughts on doing this above the "main" return statement?

if (review.isPending) return <LoadingResult />

if (reviews.isSuccess && !reviews.data.length) return <NoResult />

So then you can remove all of the checks from Line 85.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so i lied, if we do this then the search bar isn't rendered and adding it to the above return statements duplicates like an extra 15 lines of code so I think it might be better to leave where they are?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right i didn't realize that this was a page and that we have the SearchFilter component on it

Comment on lines +22 to +29
<Button
type="button"
variant="ghost"
onClick={clearFilters}
className="text-cooper-blue-600"
>
Clear Filters
</Button>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This button might not be centered. See this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def not xD

@vercel vercel bot temporarily deployed to Preview – cooper-docs November 29, 2024 20:49 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper-auth November 29, 2024 20:49 Inactive
@vercel vercel bot temporarily deployed to Preview – cooper November 29, 2024 20:50 Inactive
@banushi-a banushi-a merged commit 01d3375 into main Nov 30, 2024
8 checks passed
@banushi-a banushi-a deleted the 95-EmptyStateSearch branch November 30, 2024 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty state message on search
2 participants