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

index.js file in pages directory is optimized #2390

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Conversation

m-Jawa-d
Copy link
Contributor

@m-Jawa-d m-Jawa-d commented Sep 10, 2024

- Removed Inline Styles: Moved button styles (margins, background colors, etc.) from inline style attributes to the links array. This improves maintainability and keeps the styling separate from the logic.

- Dynamic Button Rendering: Replaced repeated button code with a buttonLinks array. This array stores button properties (like to, text, and className), and the buttons are rendered dynamically using map. This reduces code duplication and improves scalability.

- Optimized useDocusaurusContext Usage: Moved the useDocusaurusContext hook to the Home component and passed the siteConfig as a prop to HomepageHeader, eliminating the need to call the hook twice. This improves performance and clarity.

- Added Accessibility for Image: Added alt, width, and height attributes to the img element. This improves accessibility, SEO, and browser layout optimizations.

- Simplified JSX Structure: Removed unnecessary nested div elements around the buttons, making the structure cleaner and more efficient.

These changes enhance the maintainability, performance, and readability of the code.

Copy link
Contributor

github-actions bot commented Sep 10, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@m-Jawa-d
Copy link
Contributor Author

I have read and hereby sign the Contributor License Agreement.

Copy link
Collaborator

@Noc2 Noc2 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and all the effort you put into this. However, this is how it looks on my screen.

Screenshot 2024-09-10 at 14 36 19

@Noc2 Noc2 added changes requested The team needs to clarify a few things first. update docs PR to update the documentation of the grants program. Not a grant application. labels Sep 10, 2024
@m-Jawa-d
Copy link
Contributor Author

Oh, my bad! I forgot to double-check my last styling modifications at the last moment, but I've fixed it now. You can verify.

@m-Jawa-d m-Jawa-d requested a review from Noc2 September 10, 2024 13:19
Copy link
Collaborator

@Noc2 Noc2 left a comment

Choose a reason for hiding this comment

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

Thanks

@Noc2 Noc2 merged commit 230c0fd into w3f:master Sep 11, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested The team needs to clarify a few things first. update docs PR to update the documentation of the grants program. Not a grant application.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants