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: removed dark mode from cards (pathway-success-page) #94

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

yashcrest
Copy link
Contributor

@yashcrest yashcrest commented Oct 8, 2024

This PR fixes the background color issue of cards on Pathway to success page.

image

Summary by CodeRabbit

  • New Features

    • Introduced a new dark mode configuration option, allowing users to toggle dark mode styles based on a CSS selector.
  • Bug Fixes

    • Preserved existing configurations and functionality, ensuring no disruptions to current styles.

Copy link

vercel bot commented Oct 8, 2024

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

Name Status Preview Comments Updated (UTC)
xplorers-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 11:49am

Copy link

sonarqubecloud bot commented Oct 8, 2024

Copy link

github-actions bot commented Oct 8, 2024

Snyk Test Results

�[1m�[37m�[39m�[22m
�[1m�[37mTesting /github/workspace...�[39m�[22m
�[1m�[37m�[39m�[22m
�[1m�[37m�[39m�[22m�[1mOrganization:      �[22mxplorers
�[1mPackage manager:   �[22mnpm
�[1mTarget file:       �[22mpackage.json
�[1mProject name:      �[22mwebsite
�[1mOpen source:       �[22mno
�[1mProject path:      �[22m/github/workspace
�[1mLicenses:          �[22m�[32menabled�[39m

�[32m✔ Tested 15 dependencies for known issues, no vulnerable paths found.�[39m



Copy link

coderabbitai bot commented Oct 8, 2024

Walkthrough

The changes introduce a new property darkMode set to "selector" in the tailwind.config.ts file. This modification enables the configuration of dark mode styles based on a CSS selector, enhancing the flexibility of dark mode implementation. The existing configuration, including content paths, theme extensions, and plugins, remains unchanged.

Changes

File Change Summary
tailwind.config.ts Added darkMode: "selector" to the configuration object.

Possibly related issues

Suggested reviewers

  • boltdynamics
  • Aaasisss
  • 20was

Poem

🐇 In the garden where shadows play,
A new mode dances, bright and gray.
With a flick of a switch, the night takes flight,
Tailwind whispers, "Let there be light!"
Hopping through styles, both dark and bright,
Our website glows, a beautiful sight! 🌙✨


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 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.

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.

Copy link

@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 UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6466b78 and 62792e9.

📒 Files selected for processing (1)
  • src/components/ui/card.tsx (5 hunks)
🧰 Additional context used
🔇 Additional comments (7)
src/components/ui/card.tsx (7)

12-13: LGTM: Improved formatting in Card component.

The addition of a trailing comma in the cn function call and a semicolon after the displayName assignment enhances code readability and consistency. These changes are beneficial for maintainability.

Also applies to: 17-18


29-30: LGTM: Consistent semicolon usage.

The addition of a semicolon after the displayName assignment maintains consistency with other components.


40-40: LGTM: Consistent formatting in CardTitle component.

The addition of a trailing comma in the cn function call and a semicolon after the displayName assignment maintains consistency with other components.

Also applies to: 44-45


51-53: LGTM: Removed dark mode styling from CardDescription.

The changes in the CardDescription component successfully remove the dark mode styling (dark:text-slate-400 class), aligning with the PR objective. The component definition has been simplified, and semicolon usage is consistent with other components.


60-61: LGTM: Consistent semicolon usage in CardContent and CardFooter.

The addition of semicolons after the displayName assignments for CardContent and CardFooter components maintains consistency with other components.

Also applies to: 72-73


75-82: LGTM: Improved export statement readability.

The export statement has been reformatted to a multi-line structure, which enhances readability and makes it easier to maintain the list of exported components in the future. This change is beneficial for code organization and maintainability.


Line range hint 1-82: Summary: PR objectives achieved with improved code quality.

This PR successfully removes the dark mode styling from the card components, specifically addressing the background color issue mentioned in the PR objectives. Additionally, the changes introduce consistent formatting across the file, including:

  1. Consistent semicolon usage
  2. Trailing commas in multi-line function calls
  3. Improved export statement readability

These modifications enhance code consistency and maintainability without introducing any functional changes or issues.

Comment on lines 1 to 3
import * as React from "react";

import { cn } from "@/lib/utils"
import { cn } from "@/lib/utils";
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistent semicolon usage detected in import statements.

The project predominantly uses semicolons after import statements. However, src/components/ui/card.tsx contains import statements without semicolons. Please add the missing semicolons to ensure consistency across the codebase.

🔗 Analysis chain

LGTM: Semicolon addition for consistency.

The addition of semicolons to import statements improves code style consistency. This change is acceptable.

To ensure project-wide consistency, please run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check semicolon usage in import statements across the project

# Test: Count files with and without semicolons after import statements
echo "Files with semicolons after imports:"
rg --type typescript '^\s*import.*;\s*$' | wc -l

echo "Files without semicolons after imports:"
rg --type typescript '^\s*import.*[^;]\s*$' | wc -l

Length of output: 350


Script:

#!/bin/bash
# Description: Check semicolon usage in import statements across TypeScript files

# Test: Count files with semicolons after import statements
echo "Files with semicolons after imports:"
rg '^\s*import.*;\s*$' --glob '*.ts' --glob '*.tsx' | wc -l

# Test: Count files without semicolons after import statements
echo "Files without semicolons after imports:"
rg '^\s*import.*[^;]\s*$' --glob '*.ts' --glob '*.tsx' | wc -l

Length of output: 304


const CardDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
<p
ref={ref}
className={cn("text-sm text-slate-500 dark:text-slate-400", className)}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should remove dark mode, instead change the dark mode strategy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm...right. The reason I removed is because dark mode was not implemented website wide (as of now) . Do you think we should implement this now ? If yes, then I will create a ticket for it 👍

Copy link

Snyk Test Results

�[1m�[37m�[39m�[22m
�[1m�[37mTesting /github/workspace...�[39m�[22m
�[1m�[37m�[39m�[22m
�[1m�[37m�[39m�[22m�[1mOrganization:      �[22mxplorers
�[1mPackage manager:   �[22mnpm
�[1mTarget file:       �[22mpackage.json
�[1mProject name:      �[22mwebsite
�[1mOpen source:       �[22mno
�[1mProject path:      �[22m/github/workspace
�[1mLicenses:          �[22m�[32menabled�[39m

�[32m✔ Tested 17 dependencies for known issues, no vulnerable paths found.�[39m



Copy link

Snyk Test Results

�[1m�[37m�[39m�[22m
�[1m�[37mTesting /github/workspace...�[39m�[22m
�[1m�[37m�[39m�[22m
�[1m�[37m�[39m�[22m�[1mOrganization:      �[22mxplorers
�[1mPackage manager:   �[22mnpm
�[1mTarget file:       �[22mpackage.json
�[1mProject name:      �[22mwebsite
�[1mOpen source:       �[22mno
�[1mProject path:      �[22m/github/workspace
�[1mLicenses:          �[22m�[32menabled�[39m

�[32m✔ Tested 17 dependencies for known issues, no vulnerable paths found.�[39m



Copy link

@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

🧹 Outside diff range and nitpick comments (1)
tailwind.config.ts (1)

7-7: Consider dark mode implementation strategy

While using selector-based dark mode provides more granular control, consider these architectural recommendations:

  1. Document the chosen selector pattern for team consistency
  2. Consider implementing a central dark mode management system
  3. Ensure accessibility guidelines are met for color contrast in both light and dark modes
  4. Add comments in the config file explaining the rationale for using selector-based dark mode
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 62792e9 and 600ecef.

📒 Files selected for processing (1)
  • tailwind.config.ts (1 hunks)
🔇 Additional comments (1)
tailwind.config.ts (1)

7-7: Verify the dark mode selector implementation

The change to darkMode: "selector" will require explicit selectors to trigger dark mode styles. Please ensure that:

  1. The corresponding CSS selector is properly implemented where dark mode is desired
  2. Existing dark mode styles are updated to work with the new selector-based approach
  3. The change doesn't unintentionally affect other components using dark mode

@yashcrest
Copy link
Contributor Author

@aaasisss
Added darkmode:selector in tailwind.config.ts file, which will prevent the site to not dynamically change its theme based on OS setup.

@yashcrest yashcrest removed the request for review from 20was November 20, 2024 11:53
@aaasisss aaasisss merged commit db8696f into main Nov 26, 2024
8 checks passed
@aaasisss aaasisss deleted the fix/issue-93_pwts-page-card-background branch November 26, 2024 07:22
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