nextui icon indicating copy to clipboard operation
nextui copied to clipboard

fix(calendar): vertical appearance in mobile devices

Open awesome-pro opened this issue 1 year ago • 6 comments

Closes #3173

📝 Description

Added the logic for the vertical appearance of calendars (if more than one) in case of mobile devices

⛳️ Current behavior (updates)

https://github.com/user-attachments/assets/7ce12229-a825-4973-a114-9652581219f0

🚀 New behavior

Calendar

https://github.com/user-attachments/assets/768a234e-dde9-4edc-998d-09e06f96d8ea

Date Picker

https://github.com/user-attachments/assets/987f67d6-16af-4037-b3f6-e2426bd1d7fa

💣 Is this a breaking change (Yes/No): NO

📝 Additional Information

Summary by CodeRabbit

  • New Features

    • Enhanced responsiveness of the calendar component for mobile devices.
    • Added a new property to specify the calendar height, improving configurability for both calendar and date picker components.
  • Bug Fixes

    • Fixed navbar height issues for better visual consistency.
  • Style Improvements

    • Updated CSS styles for the calendar and date picker components to enhance layout and responsiveness across devices.

awesome-pro avatar Jul 31 '24 12:07 awesome-pro

🦋 Changeset detected

Latest commit: ee32561953838b0f8e5fc33480d59a888bb7c426

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@nextui-org/calendar Patch
@nextui-org/date-picker Patch
@nextui-org/theme Patch
@nextui-org/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jul 31 '24 12:07 changeset-bot[bot]

@awesome-pro is attempting to deploy a commit to the NextUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jul 31 '24 12:07 vercel[bot]

[!IMPORTANT]

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update enhances the responsiveness and usability of the calendar and date picker components across various devices, particularly mobile. Key improvements include the addition of a calendarHeight property for better customization, integration of the useIsMobile hook for adaptive rendering, and CSS adjustments to optimize the layout on smaller screens. These changes collectively aim to provide a more visually appealing and user-friendly interface.

Changes

Files Change Summary
.changeset/angry-brooms-unite.md Introduced a patch for mobile responsiveness in calendar components; fixed navbar height issues.
packages/components/calendar/package.json Updated dependencies; added @internationalized/date, @nextui-org/button, and @nextui-org/framer-utils.
packages/components/calendar/src/calendar-base.tsx Added useIsMobile hook to enhance mobile responsiveness in calendar rendering.
packages/components/calendar/src/use-calendar-base.ts Enhanced Props interface by adding calendarHeight for dynamic styling, improving component flexibility.
packages/components/date-picker/src/use-date-picker-base.ts Added optional calendarHeight to improve configurability of the date picker component.
packages/core/theme/src/components/calendar.ts Adjusted CSS class names and properties for better responsiveness in the calendar component.
packages/core/theme/src/components/date-picker.ts Updated styling definitions for better layout and responsiveness in the date picker component.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CalendarComponent
    participant MobileDetector
    
    User->>CalendarComponent: Open calendar
    CalendarComponent->>MobileDetector: Check if mobile
    MobileDetector-->>CalendarComponent: Return true/false
    alt If mobile
        CalendarComponent->>CalendarComponent: Adjust layout for mobile
    else Not mobile
        CalendarComponent->>CalendarComponent: Render standard layout
    end

Assessment against linked issues

Objective Addressed Explanation
It is not possible to change the calendar display on a mobile (#[3173])

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jul 31 '24 12:07 coderabbitai[bot]

@wingkwong sir, I just installed @nextui-org/use-is-mobile dependency in the package/components/calendar project vai pnpm these changes are working fine in my machine without any fail But I don't why build is failing here

awesome-pro avatar Jul 31 '24 14:07 awesome-pro

@awesome-pro because you're using pnpm@v9 which is not supported currently. I updated it back to v8 at this moment. We plan to upgrade to v9 and I made a PR for that. Supposedly you won't see there are 10K+ changes in pnpm-lock.yaml if you just add one dependency. I'll review the rest when I got time.

wingkwong avatar Aug 01 '24 13:08 wingkwong

Thanks @wingkwong

awesome-pro avatar Aug 01 '24 13:08 awesome-pro

Closing due to inactivity

wingkwong avatar Oct 06 '24 09:10 wingkwong