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

chore: apply styles to the correct month #4151

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Conversation

Yamico
Copy link
Contributor

@Yamico Yamico commented Nov 27, 2024

image

In the latest version, there's a small issue with the ActivityCalendar component where styles are being applied to the same date in the previous month. Here's some code to fix it.

@Yamico Yamico requested a review from boojack as a code owner November 27, 2024 05:51
Copy link
Collaborator

@johnnyjoygh johnnyjoygh left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution

@johnnyjoygh johnnyjoygh merged commit 97ef5a8 into usememos:main Nov 27, 2024
2 checks passed
isSelected && "font-bold border-zinc-400",
!isToday && !isSelected && "border-transparent",
item.isCurrentMonth && isToday && "border-zinc-400",
item.isCurrentMonth && isSelected && "bg-success font-bold",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove the bg-success from here. This is causing the date to indicate a memo is present event when there isn't one. With no memo there should only be a border set

expected:
image

this PR:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct. In my custom implementation, the logic for isSelected was modified, and the styles were also adjusted accordingly. Apologies for overlooking this and causing issues. Please review this new submission. #4153

By the way, would it be possible to modify the way selectedDate is obtained? Based on the name of this variable, my understanding is that it should be set by selecting a date via a mouse click. However, obtaining it through props instead of state seems to prevent this variable from being updated by mouse clicks.

boojack pushed a commit that referenced this pull request Nov 28, 2024
* chore: apply styles to the correct month

* chore: style fix
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.

3 participants