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 video border size on About Us page #2375

Merged

Conversation

geetanjaligit
Copy link
Contributor

@geetanjaligit geetanjaligit commented Oct 24, 2024

Fixes Issue

Closes #2365

Changes proposed

This pull request fixes the video border size mismatch on the "About Us" page. The current video border is larger than the video, leading to an unbalanced and unprofessional appearance. This PR adjusts the border size to align perfectly with the video dimensions, improving the visual presentation of the page.

Specific changes:

  • Adjusted the dimensions of the video border to match the embedded video on the "About Us" page.
  • Ensured proper alignment to maintain a clean and polished look.
  • The dimension resizing is now responsive, ensuring the video and border scale smoothly across different screen sizes for a
    clear and consistent experience on all devices.

Screenshots

Here is a screenshot of the issue before the fix:
video _about us page

And here is a screenshot after applying the fix:
video _about us page

Note to reviewers

This is a minor UI fix that improves the visual consistency of the "About Us" page. The change is responsive, ensuring smooth display across different screen sizes without affecting other parts of the site.

Summary by CodeRabbit

  • New Features

    • Updated route for the privacy policy page from privacy-policy to privacy.
  • Style

    • Enhanced the styling of the AboutUs component for a more responsive iframe display.

Copy link

vercel bot commented Oct 24, 2024

@geetanjaligit is attempting to deploy a commit to the Vivek Prajapati's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Oct 24, 2024

Walkthrough

The changes involve modifications to the routing structure in the App component, specifically updating the privacy policy route from path="privacy-policy" to path="privacy". Additionally, the AboutUs component has been updated to enhance the structure and styling of an iframe displaying a YouTube video, making it more responsive. Finally, the tailwind.config.js file has been corrected to ensure proper syntax in the theme extension without introducing new properties.

Changes

File Change Summary
src/App.jsx Updated privacy policy route from path="privacy-policy" to path="privacy". Comment removed.
src/User/pages/AboutUs/Aboutus.jsx Enhanced iframe structure for responsiveness, added attributes for performance and accessibility.
tailwind.config.js Corrected syntax in theme.extend by adding a closing brace to the fontFamily object.

Assessment against linked issues

Objective Addressed Explanation
Video border should align with video dimensions (#[2365])
Ensure a clean and cohesive section for the "About Us" page (#[2365])

Suggested labels

good first issue, hacktoberfest, hacktoberfest-accepted

Poem

In the garden of code, we hop and play,
Adjusting the routes in a bright new way.
With borders aligned and styles that shine,
The "About Us" page is looking just fine!
So let’s celebrate with a joyful cheer,
For every small change brings us all near! 🐇✨


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

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

15-17: Consider using responsive width classes instead of fixed pixels

While adding a custom width class solves the immediate issue, using a fixed pixel width (316px) might not be the best approach for responsive design. The video border might not scale properly on different screen sizes.

Consider these alternatives:

  1. Use relative units (e.g., percentage, viewport units)
  2. Implement responsive breakpoints
  3. Use aspect-ratio utilities for maintaining video proportions

Example of a more responsive approach:

 width: {
-  '316': '316px',  // Add custom width class
+  'video-container': 'min(316px, 100%)',  // Responsive video container width
 },

Also, please improve the comment to explain why this specific width was chosen:

-  '316': '316px',  // Add custom width class
+  '316': '316px',  // Matches embedded video player width for About Us page
src/User/pages/AboutUs/Aboutus.jsx (2)

Line range hint 28-37: Improve iframe responsiveness and accessibility.

The iframe has mixed responsive and fixed styling approaches. Also, there are some accessibility improvements that could be made.

Consider these improvements:

 <iframe
-    className="md:w-[685px] md:h-[410px] w-[300px] h-[150px]"
-    // width="685"
-    // height="415"
+    className="w-full h-full"
     src="https://www.youtube.com/embed/F9aJdlUGd08?autoplay=1&loop=1&playlist=F9aJdlUGd08&mute=1"
     title="YouTube video player"
-    frameborder="0"
+    frameBorder="0"
     allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
     referrerpolicy="strict-origin-when-cross-origin"
-    allowfullscreen></iframe>
+    allowFullScreen
+    loading="lazy"
+    aria-label="About VigyBag"></iframe>

Changes:

  • Use w-full and h-full to fill the aspect ratio container
  • Remove commented-out dimensions
  • Fix React prop casing (frameBorder, allowFullScreen)
  • Add loading="lazy" for performance
  • Add aria-label for accessibility

Based on the search results, I can now verify the video border alignment implementation. The code shows:

  1. The video container has aspect-w-16 aspect-h-9 for maintaining aspect ratio
  2. The iframe has responsive widths with md:w-[685px] w-[300px] for desktop/mobile
  3. The container has a fixed width class w-316 (316px) defined in tailwind config
  4. The border is set with border-8 border-green-600 rounded-md

There are potential alignment issues:

  1. The fixed w-316 container width conflicts with the responsive iframe widths (685px/300px)
  2. The iframe width exceeds the container width on desktop (685px > 316px)
  3. No flex/grid layout classes to center the video container

Video container needs responsive width and proper centering

  • Replace w-316 with responsive width classes like w-full max-w-[685px]
  • Add mx-auto to center the container
  • Keep the aspect ratio and border styling
🔗 Analysis chain

Line range hint 27-37: Verify video border alignment across different screen sizes.

The current implementation might still have alignment issues on certain devices or screen sizes.

Let's verify the video border alignment:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any media query or responsive utility classes that might affect the video container
rg -A 2 'md:w-\[.*?\]|w-\[.*?\]|aspect-w-|aspect-h-' src/

# Look for any custom width utilities in Tailwind config
rg -A 5 'width:|w-316' 

Length of output: 46773

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 91bca48 and 028972e.

📒 Files selected for processing (3)
  • src/App.jsx (0 hunks)
  • src/User/pages/AboutUs/Aboutus.jsx (1 hunks)
  • tailwind.config.js (1 hunks)
💤 Files with no reviewable changes (1)
  • src/App.jsx
🔇 Additional comments (1)
tailwind.config.js (1)

15-17: Verify the impact of fixed width across different screen sizes

Let's ensure this fixed width works well across different devices and doesn't cause layout issues.

✅ Verification successful

Fixed width is properly handled with responsive design

The implementation of w-316 is used in a responsive context within AboutUs.jsx:

  • The parent container uses md:w-1/2 class for proper responsive scaling
  • The fixed width is applied to a video container that also has responsive classes for the iframe inside (md:w-[685px] and w-[300px])
  • The layout adapts appropriately for different screen sizes with proper media query breakpoints
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for responsive design patterns in the AboutUs component
# to verify if the fixed width is properly handled

# Look for media queries or responsive classes
rg -t jsx "w-316" "./src" -A 5 -B 5

# Check if there are any existing responsive patterns we should follow
rg -t jsx "(?:sm:|md:|lg:|xl:)w-" "./src"

Length of output: 131


Script:

#!/bin/bash
# Search for the usage of w-316 class without file type restriction
rg "w-316" -A 5 -B 5

# Check for responsive width patterns
rg "(sm:|md:|lg:|xl:)w-"

# Look for any files that might be using this width class
fd -e js -e jsx -e ts -e tsx | xargs grep -l "w-316"

Length of output: 7974

src/User/pages/AboutUs/Aboutus.jsx Outdated Show resolved Hide resolved
@geetanjaligit geetanjaligit changed the title Fix video border size on About Us page #2365 Fix video border size on About Us page Oct 24, 2024
@geetanjaligit
Copy link
Contributor Author

@codervivek5 I've made the requested changes. Please let me know if there's anything else.
If changes and PR is helpful. Please mark it as GSSoC-24 extd and also include the level.I am happy to make my first contribution.

@geetanjaligit
Copy link
Contributor Author

geetanjaligit commented Oct 28, 2024

issue- #2365, Adjusted the dimensions of the video border to match the embedded video on the "About Us" page successfully. Please merge this pr.

Copy link

vercel bot commented Nov 9, 2024

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

Name Status Preview Comments Updated (UTC)
vigybag ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 0:57am

@codervivek5 codervivek5 merged commit 1458917 into codervivek5:main Nov 9, 2024
1 of 2 checks passed
Copy link

github-actions bot commented Nov 9, 2024

Congratulations, Your pull request has been successfully merged 🥳🎉 Thank you for your contribution to the project 🚀 Keep Contributing!! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Video Border Size Mismatch on "About Us" Page
2 participants