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

Add Dark mode support to listings and also fix functionality to next/previous buttons #258

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

chennisden
Copy link
Contributor

@chennisden chennisden commented Aug 6, 2024

Resolves #251

The commit messages are self-explanatory.

commit 99700ae
Author: Dennis Chen [email protected]
Date: Mon Aug 5 17:31:03 2024 -0700

Add dark variants for Previous/Next buttons

commit cc72a0c
Author: Dennis Chen [email protected]
Date: Mon Aug 5 17:21:12 2024 -0700

Fix Listings button functionality

- the previous and next buttons took people to /browse/PAGENUMBER rather
  than /browse/?page=PAGENUMBER, where the frontend expects the latter.
  Fixed.
- having fixed that, when we go to a new page, the listings do not
  refresh because the useEffect calling handleSearch has never been
  called; the useEffect hook now updates when pageNumber changes.

commit 3c6f3fa
Author: Dennis Chen [email protected]
Date: Mon Aug 5 17:20:50 2024 -0700

Make previous/next buttons on left/right of screen

commit 7f72c07
Author: Dennis Chen [email protected]
Date: Mon Aug 5 17:09:52 2024 -0700

Make dark mode version of ListingGridCard

It may not be a bad idea to

- add a placeholder image/text when none is present for a listing (even
  something as simple as "No Image" to make it clear that this was
  intentional from the part of the listing creator, and not a network
  error)
- remove the `animate-pulse` effect in dark mode; I hesitantly kept it
  in for now but it is plausible that animate-pulse loses its magic in
  dark mode.

It may not be a bad idea to

- add a placeholder image/text when none is present for a listing (even
  something as simple as "No Image" to make it clear that this was
  intentional from the part of the listing creator, and not a network
  error)
- remove the `animate-pulse` effect in dark mode; I hesitantly kept it
  in for now but it is plausible that animate-pulse loses its magic in
  dark mode.
@chennisden chennisden force-pushed the 251-listing-dark-mode branch from 5036898 to 43a8f86 Compare August 6, 2024 00:48
@chennisden chennisden marked this pull request as draft August 6, 2024 00:49
- the previous and next buttons took people to /browse/PAGENUMBER rather
  than /browse/?page=PAGENUMBER, where the frontend expects the latter.
  Fixed.
- having fixed that, when we go to a new page, the listings do not
  refresh because the useEffect calling handleSearch has never been
  called; the useEffect hook now updates when pageNumber changes.
@chennisden chennisden force-pushed the 251-listing-dark-mode branch from 43a8f86 to c8627a8 Compare August 6, 2024 01:02
@chennisden
Copy link
Contributor Author

The GitHub action history is a bit of a mess because I screwed up rebasing. All is good now.

Here's a screenshot.
image

Before:
image

@chennisden chennisden marked this pull request as ready for review August 6, 2024 01:04
<div>
<div className="animate-pulse bg-gray-200 w-full aspect-square"></div>
</div>
<div className="animate-pulse bg-gray-200 dark:bg-gray-800 w-full aspect-square" />
Copy link
Member

Choose a reason for hiding this comment

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

i think there was a reason i wasn't doing 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.

I'm going to assume it's because backgrounds might be white

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think either way dark mode listings is going to look a little silly; it's just a question of which looks more silly. A question of personal taste, I suppose.

Copy link
Member

Choose a reason for hiding this comment

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

oh no, it had to do with getting it to actually be a square - if i removed it then the div didn't render as a square correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With #261 I think this is by far the right thing to do.

@codekansas
Copy link
Member

why does the image in your screenshot look messed up?

@chennisden
Copy link
Contributor Author

why does the image in your screenshot look messed up?

Fixed in a separate PR. This is a pre existing issue

<div>
<div className="animate-pulse bg-gray-200 w-full aspect-square"></div>
</div>
<div className="animate-pulse bg-gray-200 dark:bg-gray-800 w-full aspect-square" />
Copy link
Member

Choose a reason for hiding this comment

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

oh no, it had to do with getting it to actually be a square - if i removed it then the div didn't render as a square correctly

@chennisden chennisden merged commit b4935c3 into master Aug 6, 2024
1 of 2 checks passed
@chennisden chennisden deleted the 251-listing-dark-mode branch August 6, 2024 21:09
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.

Listings look odd when in dark mode
2 participants