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

[FIX] Events Page Violates The Figma Style Guide #3280

Open
wants to merge 11 commits into
base: develop-postgres
Choose a base branch
from

Conversation

hustlernik
Copy link
Contributor

@hustlernik hustlernik commented Jan 15, 2025

What kind of change does this PR introduce?

UI fix according to figma.

Issue Number:

#3180

Snapshots/Videos:

Screen-Recording.1.mp4

Does this PR introduce a breaking change?

No

Checklist

CodeRabbit AI Review

  • I have reviewed and addressed all critical issues flagged by CodeRabbit AI
  • I have implemented or provided justification for each non-critical suggestion
  • I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

Test Coverage

  • I have written tests for all new changes/features
  • I have verified that test coverage meets or exceeds 95%
  • I have run the test suite locally and all tests pass

Other information

Have you read the contributing guide?

Yes

Summary by CodeRabbit

Release Notes

  • UI/UX Changes

    • Removed the "Today" button functionality from the calendar, impacting quick navigation to the current date.
    • Updated calendar weekday display to use full day names.
    • Modified event header with new search and create event icons.
  • Styling Updates

    • Introduced new CSS variables for colors and card styling.
    • Adjusted holiday card and event card styling.
    • Updated calendar day and event header styles.
    • Refined component layout and visual design.
  • Component Refactoring

    • Updated import paths and class names for various components.
    • Removed unused elements from the event header layout.
  • Testing

    • Added a new test file for the HolidayCard component to verify rendering functionality.
    • Updated tests for the Events component to check for full day names in the calendar view.

Copy link
Contributor

coderabbitai bot commented Jan 15, 2025

Walkthrough

This pull request introduces modifications to several components within the event calendar and holiday card systems. The changes primarily involve commenting out the functionality for navigating to today's date, updating weekday representations to full names, and restructuring CSS imports and class names. Additionally, there are enhancements in the visual presentation of the components, including new styling variables and classes. Overall, the modifications focus on refining the user interface and improving testability without altering core functionalities.

Changes

File Change Summary
src/components/EventCalendar/EventCalendar.tsx Commented out handleTodayButton function and associated button, removing current date navigation functionality.
src/components/EventCalendar/EventHeader.tsx Updated search and create event button icons, added data-testid, restructured button layout.
src/components/EventCalendar/constants.js Replaced weekday abbreviations with full day names.
src/components/HolidayCards/HolidayCard.module.css Deleted CSS module file.
src/components/HolidayCards/HolidayCard.tsx Updated CSS import path and class name.
src/screens/UserPortal/Events/Events.tsx Changed main container class name.
src/style/app.module.css Added new CSS variables, introduced new classes, modified existing styles.

Possibly related issues

Possibly related PRs

Suggested labels

refactor

Suggested reviewers

  • palisadoes

Poem

🐰 A Rabbit's Calendar Rhyme 🗓️
Weekdays stretch, no more abbrev's tight,
Buttons fade, but styles shine bright
CSS dances, variables gleam
Our calendar's evolving dream!
Hop along, code's gentle sway


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Copy link

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/components/HolidayCards/HolidayCard.tsx (1)

2-2: Consider keeping component-specific styles local.

Moving styles from a component-specific module to the global styles file could make maintenance more difficult and reduce encapsulation. Consider keeping the styles in a local module.

-import styles from './../../style/app.module.css';
+import styles from './HolidayCard.module.css';

-  return <div className={styles.holidayCard}>{props?.holidayName}</div>;
+  return <div className={styles.card}>{props?.holidayName}</div>;

Also applies to: 17-17

🧰 Tools
🪛 GitHub Actions: PR Workflow

[error] Contains code coverage disable statement. Please remove it and add the appropriate tests.

src/style/app.module.css (1)

6351-6363: Consider improvements to holiday card styles.

While the styles are functional, consider these enhancements:

  1. Use CSS variables for the background color instead of rgba
  2. Increase the font size for better readability
  3. Add hover/focus states for better interactivity
.holidayCard {
  color: var(--black-color);
- background-color: rgba(0, 0, 0, 0.15);
- font-size: 10px;
+ background-color: var(--holidays-card-background-color);
+ font-size: 12px;
  font-weight: 400;
  display: flex;
  padding: 8px 4px;
  border-radius: 5px;
  margin-bottom: 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
+ transition: background-color 0.2s ease;
}

+ .holidayCard:hover,
+ .holidayCard:focus {
+   background-color: var(--holidays-card-background-color-hover, rgba(0, 0, 0, 0.25));
+ }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 334f0f7 and f85b8ac.

📒 Files selected for processing (7)
  • src/components/EventCalendar/EventCalendar.tsx (4 hunks)
  • src/components/EventCalendar/EventHeader.tsx (4 hunks)
  • src/components/EventCalendar/constants.js (1 hunks)
  • src/components/HolidayCards/HolidayCard.module.css (0 hunks)
  • src/components/HolidayCards/HolidayCard.tsx (2 hunks)
  • src/screens/UserPortal/Events/Events.tsx (1 hunks)
  • src/style/app.module.css (22 hunks)
💤 Files with no reviewable changes (1)
  • src/components/HolidayCards/HolidayCard.module.css
✅ Files skipped from review due to trivial changes (1)
  • src/screens/UserPortal/Events/Events.tsx
🧰 Additional context used
🪛 GitHub Actions: PR Workflow
src/components/HolidayCards/HolidayCard.tsx

[error] Contains code coverage disable statement. Please remove it and add the appropriate tests.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (9)
src/components/EventCalendar/constants.js (1)

16-24: LGTM! Improved readability with full weekday names.

The change from abbreviated to full weekday names enhances the calendar's readability and user experience.

src/components/HolidayCards/HolidayCard.tsx (1)

17-17: ⚠️ Potential issue

Remove istanbul ignore comment and add tests.

The pipeline has flagged this line for containing a code coverage disable statement. Please remove the istanbul ignore comment and add appropriate tests.

✅ Verification successful

Remove unnecessary istanbul ignore comment and add basic component test

The review comment is accurate. The component contains an istanbul ignore next comment, and no test file exists. Since this is a simple component that only renders a holiday name, there's no complexity that would justify ignoring test coverage. You should:

  • Remove the /*istanbul ignore next*/ comment from line 17
  • Add a basic test file (e.g., HolidayCard.test.tsx) that verifies:
    • Component renders without crashing
    • Holiday name is correctly displayed
    • CSS class is properly applied
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for existing test file
fd "HolidayCard.test.tsx" src/components/HolidayCards/

Length of output: 54


Script:

#!/bin/bash
# Check the component file for istanbul ignore comment
cat src/components/HolidayCards/HolidayCard.tsx

# Look for test files with different naming patterns
fd "HolidayCard.*test.*" src/
fd "HolidayCard.*spec.*" src/

# Check if tests might be in a __tests__ directory
fd -t d "__tests__" src/

Length of output: 727

🧰 Tools
🪛 GitHub Actions: PR Workflow

[error] Contains code coverage disable statement. Please remove it and add the appropriate tests.

src/components/EventCalendar/EventHeader.tsx (2)

3-4: LGTM! Improved icon consistency using Material-UI icons.

The change to use Material-UI icons improves consistency with the design system.


96-114: LGTM! Enhanced create button with improved visual hierarchy.

The addition of the AddIcon and better button structure improves the visual hierarchy and user experience.

src/components/EventCalendar/EventCalendar.tsx (2)

201-205: Verify if removing the Today button aligns with UX requirements.

The removal of the Today button functionality might impact user experience by making it harder to quickly navigate to the current date. Please verify if this change aligns with the Figma design and UX requirements.


372-374: LGTM! Improved holiday indicator styling.

The holiday indicator changes align with the new design system.

src/style/app.module.css (3)

49-52: LGTM! Well-structured CSS variables.

The new color variables are semantically named and follow the existing pattern. They provide good reusability for holiday and event-related components.


4424-4431: LGTM! Well-structured calendar container styles.

The calendar container styles provide good responsive layout with appropriate spacing and overflow handling.


6366-6371: LGTM! Well-structured card title styles.

The card title styles provide good visual hierarchy with appropriate font size and weight.

src/components/EventCalendar/EventCalendar.tsx Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
@hustlernik hustlernik changed the title Figma: [FIX] Events Page Violates The Figma Style Guide Jan 15, 2025
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 8.54%. Comparing base (334f0f7) to head (c0e0005).
Report is 1 commits behind head on develop-postgres.

Files with missing lines Patch % Lines
src/components/HolidayCards/HolidayCard.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           develop-postgres   #3280      +/-   ##
===================================================
- Coverage              8.56%   8.54%   -0.02%     
===================================================
  Files                   309     309              
  Lines                  7954    7972      +18     
  Branches               1763    1766       +3     
===================================================
  Hits                    681     681              
- Misses                 7196    7214      +18     
  Partials                 77      77              
Flag Coverage Δ
jest 8.54% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9215fbf and 26fcd03.

📒 Files selected for processing (2)
  • src/components/HolidayCards/HolidayCard.spec.tsx (1 hunks)
  • src/screens/UserPortal/Events/Events.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/screens/UserPortal/Events/Events.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Test Application
  • GitHub Check: Check Python Code Style
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (3)
src/components/HolidayCards/HolidayCard.spec.tsx (3)

1-4: LGTM! All necessary imports are present.

The import statements are clean and include all required testing utilities.


1-22: Address test coverage requirements.

The PR objectives indicate that test coverage doesn't meet the 95% threshold. While this file adds basic testing, consider using tools like vitest --coverage to identify untested code paths and ensure comprehensive test coverage across all component functionality.


6-10: Verify completeness of CSS module mock.

The mock only includes the 'holidayCard' class. Please verify if the component uses any other CSS classes that should be included in the mock to ensure comprehensive testing.

Run this script to check for additional CSS classes used by the component:

✅ Verification successful

CSS module mock is correctly implemented

The component only uses the styles.holidayCard class, which is properly included in the mock. No additional CSS classes need to be mocked.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for CSS class usage in the HolidayCard component
ast-grep --pattern 'styles.$_' src/components/HolidayCards/HolidayCard.tsx

Length of output: 196

src/components/HolidayCards/HolidayCard.spec.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/style/app.module.css (1)

5418-5423: Consider using CSS Grid for better calendar layout.

The current margin and padding approach could be improved using CSS Grid for more consistent spacing and better responsiveness.

Consider this alternative:

.calendar {
  font-family: sans-serif;
  font-size: 1.2rem;
  margin-bottom: 10px;
  background: var(--white-color);
  border-radius: 10px;
- padding-left: 70px;
- padding-right: 70px;
- padding-top: 5px;
+ display: grid;
+ grid-template-columns: minmax(20px, 70px) 1fr minmax(20px, 70px);
+ padding: 5px 0;
}
src/components/HolidayCards/HolidayCard.spec.tsx (1)

6-10: Enhance the CSS module mock for comprehensive style testing.

The current mock is minimal. Consider expanding it to include all CSS classes used in the component to ensure thorough style testing.

 vi.mock('./../../style/app.module.css', () => ({
   default: {},
-  holidayCard: 'holidayCard',
+  holidayCard: 'holidayCard',
+  // Add other classes used in HolidayCard component
+  // Example:
+  // cardTitle: 'cardTitle',
+  // cardContent: 'cardContent',
 }));
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 26fcd03 and c0e0005.

📒 Files selected for processing (4)
  • src/components/EventCalendar/EventCalendar.tsx (4 hunks)
  • src/components/HolidayCards/HolidayCard.spec.tsx (1 hunks)
  • src/components/HolidayCards/HolidayCard.tsx (2 hunks)
  • src/style/app.module.css (22 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/HolidayCards/HolidayCard.tsx
  • src/components/EventCalendar/EventCalendar.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test Application
🔇 Additional comments (3)
src/style/app.module.css (2)

49-53: LGTM! Well-structured CSS variables for consistent theming.

The new CSS variables are well-named and follow a clear naming convention, making them easy to understand and maintain.


Line range hint 5689-5705: LGTM! Well-structured calendar info cards.

The calendar info cards have good spacing, consistent use of variables, and proper box-shadow implementation.

src/components/HolidayCards/HolidayCard.spec.tsx (1)

12-32: Expand test coverage to meet the 95% threshold.

While the current tests cover basic scenarios, additional test cases are needed to improve coverage and ensure robust component behavior:

  1. Style verification:

    • Test CSS class applications
    • Verify style-related props
  2. Edge cases:

    • Holiday names with special characters
    • HTML entities in names
    • Multi-line holiday names
  3. Component behavior:

    • Hover states if applicable
    • Any click handlers or interactions
    • Accessibility attributes

Let's verify the current test coverage:

#!/bin/bash
# Check test coverage for the HolidayCard component
npx vitest run --coverage src/components/HolidayCards/HolidayCard.spec.tsx

src/style/app.module.css Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 15, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
src/components/HolidayCards/HolidayCard.spec.tsx (4)

8-11: Enhance the basic rendering test assertion.

Instead of just checking if the element is defined, consider using more specific assertions:

 test('renders without crashing', () => {
   render(<HolidayCard holidayName="Christmas" />);
-  expect(screen.getByTestId('holiday-card')).toBeDefined();
+  const cardElement = screen.getByTestId('holiday-card');
+  expect(cardElement).toBeInTheDocument();
+  expect(cardElement).toBeVisible();
 });

13-19: Remove unnecessary blank line.

The test is well-structured, but there's an unnecessary blank line that can be removed for better code consistency.

 test('displays the provided holiday name', () => {
   const testHolidayName = 'New Year';
   render(<HolidayCard holidayName={testHolidayName} />);
-
   const cardElement = screen.getByTestId('holiday-card');
   expect(cardElement.textContent).toBe(testHolidayName);
 });

21-26: Make the CSS class test more flexible.

The current test might break if the component needs to support multiple classes in the future.

 test('applies the correct CSS class', () => {
   render(<HolidayCard holidayName="Easter" />);

   const cardElement = screen.getByTestId('holiday-card');
-  expect(cardElement.className).toBe(styles.holidayCard);
+  expect(cardElement.className).toContain(styles.holidayCard);
 });

43-51: Add more TypeScript validation cases.

Consider adding more type validation tests to cover additional scenarios:

 // TypeScript compile-time tests
 test('TypeScript props validation', () => {
   // @ts-expect-error - Testing TypeScript validation for missing required prop
   render(<HolidayCard />);

   // @ts-expect-error - Testing TypeScript validation for wrong prop type
   render(<HolidayCard holidayName={123} />);
+
+  // @ts-expect-error - Testing TypeScript validation for null
+  render(<HolidayCard holidayName={null} />);
+
+  // @ts-expect-error - Testing TypeScript validation for undefined
+  render(<HolidayCard holidayName={undefined} />);
 });
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0e0005 and 5ca7439.

📒 Files selected for processing (1)
  • src/components/HolidayCards/HolidayCard.spec.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test Application
🔇 Additional comments (2)
src/components/HolidayCards/HolidayCard.spec.tsx (2)

28-41: Add more edge cases as suggested in the previous review.

While the current edge cases are good, consider adding tests for holiday names with special characters as suggested in the previous review.

 test('handles long holiday names', () => {
   const longHolidayName = 'International Talk Like a Pirate Day Celebration';
   render(<HolidayCard holidayName={longHolidayName} />);

   const cardElement = screen.getByTestId('holiday-card');
   expect(cardElement.textContent).toBe(longHolidayName);
 });
+
+test('handles holiday names with special characters', () => {
+  const specialHolidayName = 'Día de los Muertos!@#$%';
+  render(<HolidayCard holidayName={specialHolidayName} />);
+
+  const cardElement = screen.getByTestId('holiday-card');
+  expect(cardElement.textContent).toBe(specialHolidayName);
+});

5-5: Verify the styles import path and class existence.

The styles are being imported from a global CSS module. Ensure that the holidayCard class exists in the global styles file.

✅ Verification successful

Styles import and class definition are correct

The holidayCard class is properly defined in the global styles file with appropriate styling properties.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the holidayCard class exists in the global styles file
rg -l 'holidayCard' 'src/style/app.module.css'

Length of output: 69


Script:

#!/bin/bash
# Check the actual content of the holidayCard class definition with context
rg -C 2 'holidayCard' 'src/style/app.module.css'

Length of output: 151

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 15, 2025
palisadoes
palisadoes previously approved these changes Jan 15, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/screens/UserPortal/Events/Events.spec.tsx (1)

Line range hint 1-900: Consider improving test documentation and readability.

While the test implementation is solid, consider these improvements:

  1. Add JSDoc comments for each mock data entry explaining its purpose
  2. Use more descriptive test case names (e.g., "should display full weekday names in calendar view" instead of "Switch to calendar view works as expected")
src/style/app.module.css (3)

5418-5432: Consider improving calendar header's responsive design.

The calendar header's margin and padding values could be more responsive:

.calendar {
-  margin-bottom: 10px;
+  margin-bottom: clamp(10px, 2vw, 20px);
   background: var(--white-color);
   border-radius: 10px;
-  padding-left: 70px;
-  padding-right: 70px;
+  padding-inline: clamp(20px, 5vw, 70px);
   padding-top: 5px;
}

.calendar__header {
   display: flex;
   align-items: center;
   justify-content: space-between;
-  margin-right: 50px;
+  margin-inline-end: clamp(20px, 4vw, 50px);
}

6345-6350: Consider using relative units for card title.

The card title's font size should use relative units for better scalability:

.card_title {
-  font-size: 20px;
+  font-size: clamp(16px, 1.25rem, 20px);
   margin-bottom: 10px;
   font-weight: bold;
   color: var(--black-color);
}

5769-5769: Inconsistent spacing and shadow values in button styles.

The button styles have hardcoded shadow values that should use CSS variables for consistency:

.space {
  flex: 1;
  display: flex;
  align-items: center;
-  gap: 10px;
+  gap: var(--spacing-md, 10px);
}

.createButtonEventHeader {
  background-color: var(--grey-bg-color);
  color: var(--brown-color);
  width: 110px;
  border: 1px solid var(--brown-color);
-  box-shadow: 2.5px 2.5px 2.5px rgba(0, 0, 0, 0.3);
+  box-shadow: var(--card-shadow);
}

.createButtonEventHeader:hover {
-  box-shadow: 2.5px 2.5px 2.5px rgba(0, 0, 0, 0.3);
+  box-shadow: var(--card-shadow);
}

Also applies to: 5774-5778, 5785-5785

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ca7439 and 6e1f485.

📒 Files selected for processing (3)
  • src/components/EventCalendar/EventCalendar.tsx (3 hunks)
  • src/screens/UserPortal/Events/Events.spec.tsx (1 hunks)
  • src/style/app.module.css (22 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/EventCalendar/EventCalendar.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test Application
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (3)
src/screens/UserPortal/Events/Events.spec.tsx (1)

653-653: LGTM! The assertion change aligns with the UI updates.

The change from 'Sun' to 'Sunday' correctly reflects the updated weekday representation in the calendar view.

src/style/app.module.css (2)

49-53: Good addition of semantic CSS variables for consistent styling.

The new CSS variables follow a clear naming convention and promote reusability. This is a good practice for maintaining a consistent design system.


6330-6342: 🛠️ Refactor suggestion

Improve accessibility of the holiday card.

The font size and background color need improvements for better accessibility:

.holidayCard {
  color: var(--black-color);
- background-color: rgba(0, 0, 0, 0.15);
- font-size: 10px;
+ background-color: var(--holidays-card-background-color);
+ font-size: 12px;
  font-weight: 400;
  display: flex;
  padding: 8px 4px;
  border-radius: 5px;
  margin-bottom: 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
  1. Font size increased to meet WCAG guidelines (minimum 12px)
  2. Using CSS variable for background color to ensure consistent contrast ratio

Likely invalid or redundant comment.

src/style/app.module.css Show resolved Hide resolved
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.

2 participants