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

Update ProFreeSubcription.js #400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 2, 2024

  1. Update ProFreeSubcription.js

    here are the some changes did to improve efficiency, readability and maintanability 
    Moved pricingPlans Outside the Component:
    
    Why: Declaring pricingPlans inside the component redefines it every time the component renders, which is unnecessary and can impact performance slightly.
    Improvement: Moving pricingPlans outside the ProFreeSubscription component ensures it’s only defined once.
    Fixed Typo in Component Name:
    
    Why: Consistent and correct naming is crucial for code readability and avoiding errors.
    Improvement: Renamed ProFreeSubcription to ProFreeSubscription to correct the typo.
    Added PropTypes for Type-Checking:
    
    Why: PropTypes help with validating props, ensuring the right data types are passed to components, which is especially helpful in larger codebases.
    Improvement: Added PropTypes to ProFreeSubscription and PriceCard, defining expected types for props and default values.
    Conditional Styling with CSS Class:
    
    Why: Instead of passing isHighlighted just to apply styling, using a conditional CSS class improves readability and modularity.
    Improvement: Added a highlighted CSS class to the PriceCard component to style highlighted cards (e.g., the PRO plan) in ProFreeSubscription.css.
    Improved CSS Modularity:
    
    Why: Styling based on class names improves modularity, and moving styles out of inline logic is cleaner.
    Improvement: Defined .highlighted and .pricing-container in the CSS file for consistent, reusable styling.
    Tanisha0708 authored Nov 2, 2024
    Configuration menu
    Copy the full SHA
    2f4bad1 View commit details
    Browse the repository at this point in the history