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

feat(website): add MLH banner to landing page #243

Conversation

JeremyFriesenGitHub
Copy link
Contributor

@JeremyFriesenGitHub JeremyFriesenGitHub commented Jan 8, 2025

Checklist

  • I've thoroughly read the latest contribution guidelines.
  • I've rebased my branch onto main before creating this PR.
  • I've added tests to cover my changes (if applicable).
  • I've verified that all new and existing tests have passed locally for mobile, tablet, and desktop screen sizes.
  • My commit messages follow guidelines
  • My change requires documentation updates.
  • I've updated the documentation accordingly.
  • My code follows existing patterns of this project and/or improves upon them.

Additional Comments

  • I went ahead to start the scaffolding for this feature. Since I'm unsure about required conventions and formatting of the banner, I will leave this to the core team to complete.

  • Essentially, I mirrored the socials component code to create the banner. However, I've run into issues with the mapping function and I don't know why I'm getting errors, since it runs in Storybook (see screenshots below).

  • Also, the site that I used to get the banner and the SVG is here.

  • Tests need to be added as well

Screenshots (if applicable)

Storybook Website
Screenshot 2025-01-08 161324 image

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a new Banner component to display promotional banners
    • Integrated Major League Hacking (MLH) banner into the navigation bar
    • Enhanced social links with additional metadata
  • Improvements

    • Improved accessibility for social links and banners
    • Updated Storybook configurations to better showcase component variations
  • Documentation

    • Added comprehensive Storybook stories for new components
    • Expanded component documentation with more detailed props and examples

Copy link

coderabbitai bot commented Jan 8, 2025

Warning

Rate limit exceeded

@JeremyFriesenGitHub has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 5248c33 and fd95219.

⛔ Files ignored due to path filters (1)
  • libs/shared/assets/logos/sponsors/mlh-banner.svg is excluded by !**/*.svg
📒 Files selected for processing (8)
  • libs/website/shared/ui/banner/banner.stories.tsx (1 hunks)
  • libs/website/shared/ui/banner/banner.tsx (1 hunks)
  • libs/website/shared/ui/banner/index.ts (1 hunks)
  • libs/website/shared/ui/navigation/navbar/constants/navbar.constants.ts (3 hunks)
  • libs/website/shared/ui/navigation/navbar/ui/navbar.container.tsx (3 hunks)
  • libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.stories.tsx (3 hunks)
  • libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.tsx (4 hunks)
  • libs/website/shared/ui/socials/social.stories.tsx (1 hunks)
📝 Walkthrough

Walkthrough

This pull request introduces a new Banner component to the website's shared UI library. The changes include creating a new component for displaying banners, specifically implementing an MLH (Major League Hacking) banner. The implementation spans multiple files, adding the banner to the navigation bar, updating Storybook configurations, and ensuring the component is properly exported and integrated into the existing UI structure.

Changes

File Change Summary
libs/website/shared/ui/banner/banner.tsx New Banner component created with props for rendering banner links
libs/website/shared/ui/banner/banner.stories.tsx Added Storybook configuration for the Banner component
libs/website/shared/ui/banner/index.ts Added export for the Banner component
libs/website/shared/ui/navigation/navbar/constants/navbar.constants.ts Added MLH banner constant
libs/website/shared/ui/navigation/navbar/ui/navbar.container.tsx Updated NavbarProps to include banner prop
libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.tsx Integrated Banner component into NavbarPresenter
libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.stories.tsx Updated Storybook stories with MLH banner
libs/website/shared/ui/socials/social.stories.tsx Added name property to social media objects

Sequence Diagram

sequenceDiagram
    participant NavbarContainer
    participant NavbarPresenter
    participant Banner
    
    NavbarContainer->>NavbarPresenter: Pass banner prop
    NavbarPresenter->>Banner: Render Banner component
    Banner-->>NavbarPresenter: Display banner links
Loading

Possibly related issues

Possibly related PRs

Suggested labels

frontend, released

Suggested reviewers

  • HasithDeAlwis
  • MFarabi619

Poem

🐰 A banner of hope, MLH's bright light,
Hopping through code with pixel-perfect might!
Navbar dancing, stories unfurled,
A rabbit's code paints a digital world! 🌐
Commit by commit, our banner takes flight! 🚀


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.

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

🔭 Outside diff range comments (1)
libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.stories.tsx (1)

Line range hint 59-119: Update placeholder social media URLs.

The social media links are using generic URLs (e.g., 'https://github.com') instead of the actual cuHacking URLs from navbar.constants.ts.

Apply this diff to fix the URLs:

-    link: 'https://github.com',
+    link: 'https://github.com/cuhacking/2025',
-    link: 'https://instagram.com',
+    link: 'https://www.instagram.com/cuhacking/',
-    link: 'https://linkedin.com',
+    link: 'https://ca.linkedin.com/company/cuhacking',
-    link: 'https://linktr.ee',
+    link: 'https://linktr.ee/cuhacking_',
-    link: 'mailto:[email protected]',
+    link: 'mailto:[email protected]',
-    link: 'https://discord.com',
+    link: 'https://discord.com/invite/h2cQqF9aZf',
-    link: 'https://docs.com',
+    link: 'https://docs.cuhacking.ca/',
-    link: 'https://figma.com',
+    link: 'https://www.figma.com/design/wc1JOWR48tBNkjcjwY3AzB/%E2%8C%A8%EF%B8%8F-cuHacking-Design-System?node-id=0-1&t=YTR1ET4Qw1wG1cjz-1',
🧹 Nitpick comments (4)
libs/website/shared/ui/banner/banner.tsx (1)

13-13: Remove or address TODO comment.

The TODO comment about social media names should either be addressed in this PR or tracked in a separate issue.

Would you like me to create a GitHub issue to track this improvement?

libs/website/shared/ui/banner/banner.stories.tsx (2)

45-45: Consider making MLH URL configurable.

The MLH link URL contains tracking parameters. Consider moving this to a configuration constant to make it easier to update across environments.


40-51: Add more story variants.

Consider adding additional stories to showcase different banner configurations:

  • Multiple banners
  • Different sizes/layouts
  • Error states (e.g., missing media)
libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.tsx (1)

15-17: Consider combining imports for better organization.

The React and Banner imports could be grouped with related imports for better code organization.

-import React, { useState } from 'react'
-import { ClientOnly } from 'remix-utils/client-only'
-import { Banner } from '../../../banner'
+import React, { useState } from 'react'
+import { ClientOnly } from 'remix-utils/client-only'
+import { Banner } from '../../../banner'
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a18268 and 5248c33.

⛔ Files ignored due to path filters (1)
  • libs/shared/assets/logos/sponsors/mlh-banner.svg is excluded by !**/*.svg
📒 Files selected for processing (8)
  • libs/website/shared/ui/banner/banner.stories.tsx (1 hunks)
  • libs/website/shared/ui/banner/banner.tsx (1 hunks)
  • libs/website/shared/ui/banner/index.ts (1 hunks)
  • libs/website/shared/ui/navigation/navbar/constants/navbar.constants.ts (3 hunks)
  • libs/website/shared/ui/navigation/navbar/ui/navbar.container.tsx (3 hunks)
  • libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.stories.tsx (3 hunks)
  • libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.tsx (4 hunks)
  • libs/website/shared/ui/socials/social.stories.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • libs/website/shared/ui/banner/index.ts
🔇 Additional comments (10)
libs/website/shared/ui/navigation/navbar/ui/navbar.container.tsx (1)

14-18: LGTM! Interface and prop handling look good.

The banner property is well-structured and follows existing patterns. Props are correctly typed and propagated to the presenter component.

Also applies to: 30-30, 40-40

libs/website/shared/ui/banner/banner.tsx (1)

1-29: Add tests for the Banner component.

As mentioned in the PR description, tests are missing. Please add tests to cover:

  • Rendering with different banner configurations
  • Link functionality
  • Accessibility features

Would you like me to help generate test cases for this component?

libs/website/shared/ui/socials/social.stories.tsx (1)

54-54: LGTM! Good accessibility improvement.

Adding the name property to social media objects improves accessibility and maintains consistency with the banner implementation.

Also applies to: 59-59, 64-64, 69-69, 74-74, 79-79, 84-84, 89-89

libs/website/shared/ui/navigation/navbar/constants/navbar.constants.ts (3)

13-13: LGTM!

The MLH banner import is correctly placed with other logo imports.


22-31: LGTM! Banner configuration follows best practices.

The banner configuration:

  • Uses proper UTM parameters for MLH tracking
  • Includes descriptive alt text for accessibility
  • Follows the same structure as socials for consistency

105-105: LGTM!

The MLH_BANNER is correctly exported in NAVBAR_CONSTANTS.

libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.tsx (2)

33-37: LGTM! Interface update follows TypeScript best practices.

The banner property in NavbarProps follows the same structure as socials for consistency.


69-71: Verify banner placement and responsiveness.

The banner placement between logo and navigation menu:

  1. Ensure it doesn't break layout on different screen sizes
  2. Verify it follows MLH placement guidelines
  3. Confirm the hidden/flex classes work as expected
✅ Verification successful

Banner implementation follows MLH guidelines and responsive design best practices

The banner implementation is correctly placed and follows responsive design patterns:

  • Properly positioned between logo and navigation
  • Correctly hidden on mobile and shown on desktop/tablet screens
  • Uses official MLH season URL and proper accessibility attributes
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for MLH banner placement guidelines in documentation
rg -i "mlh.*banner.*placement|banner.*placement.*guidelines" README.md docs/

# Find other responsive design patterns in the codebase
rg "hidden md:" --type ts --type tsx

Length of output: 191


Script:

#!/bin/bash
# Search for documentation files and MLH/banner content
fd -e md -e mdx | xargs rg -i "mlh|banner"

# Find the Banner component implementation
ast-grep --pattern 'const Banner = $_'

# Search for responsive patterns with correct type flags
rg "hidden.*md:" -t typescript -t typescriptreact

# Find all Banner component usage
rg "Banner" -t typescript -t typescriptreact

Length of output: 1566


Script:

#!/bin/bash
# Find and inspect navbar-related files
fd navbar libs/ | xargs cat

# Find Banner component implementation
fd -e ts -e tsx | xargs rg "Banner.*=.*{" -A 5

# Search for responsive patterns in the specific directory
fd -e ts -e tsx . libs/website/shared/ui/navigation/ | xargs rg "hidden|md:"

# Find all Banner imports and usage
fd -e ts -e tsx | xargs rg "import.*Banner|<Banner"

Length of output: 20595

libs/website/shared/ui/navigation/navbar/ui/navbar.presenter.stories.tsx (2)

46-55: LGTM! Banner configuration matches constants.

The banner configuration in stories matches the one in navbar.constants.ts.


137-137: LGTM! Story args updated correctly.

The banner is correctly added to the Default story args.

Comment on lines 18 to 23
<Link
target="_blank"
key={link}
to={link}
aria-label={name}
>
Copy link

@coderabbitai coderabbitai bot Jan 8, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add security attributes for external links.

When using target="_blank", it's important to include rel="noopener noreferrer" to prevent potential security vulnerabilities.

  <Link
    target="_blank"
    key={link}
    to={link}
    aria-label={name}
+   rel="noopener noreferrer"
  >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Link
target="_blank"
key={link}
to={link}
aria-label={name}
>
<Link
target="_blank"
key={link}
to={link}
aria-label={name}
rel="noopener noreferrer"
>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CodeRabbit, can you link this PR with #242 (by making sure that the issues closes when merging this pull request by linking this branch to the pull request)? THanks

Copy link

Choose a reason for hiding this comment

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

@JeremyFriesenGitHub I apologize, but I don't have the necessary permissions to modify the PR directly. However, you can easily link this PR to issue #242 by:

  1. Adding "Closes feat(ui/website): add MLH banner to landing page #242" or "Fixes feat(ui/website): add MLH banner to landing page #242" to your PR description
  2. Or adding it to any of your commit messages

Once you do this, the issue will automatically close when the PR is merged. Would you like me to help you with anything else?

🔗 Analysis chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# First, let's verify the issue exists and get its details
gh issue view 242

# Get current PR description
gh pr view 243 --json body -q .body

# Update PR body to include the closing keyword
# Note: We'll append "Closes #242" to the existing description
gh pr edit 243 --body "$(gh pr view 243 --json body -q .body)

Closes #242"

Length of output: 6549

⛔ Permission issue

There was a permission issue. Please ask the repository administrator to refresh CodeRabbit's permissions at https://github.com/apps/coderabbitai/installations/54504200.

@HasithDeAlwis HasithDeAlwis force-pushed the jeremy/feat/242-add-MLH-banner-to-landing-page branch from fd95219 to 569a67f Compare February 19, 2025 17:28
@anakafeel anakafeel force-pushed the jeremy/feat/242-add-MLH-banner-to-landing-page branch from 569a67f to 333cb89 Compare February 20, 2025 04:04
@HasithDeAlwis HasithDeAlwis marked this pull request as ready for review February 20, 2025 04:09
@anakafeel anakafeel force-pushed the jeremy/feat/242-add-MLH-banner-to-landing-page branch from 333cb89 to afd209a Compare February 20, 2025 04:19
@anakafeel anakafeel force-pushed the jeremy/feat/242-add-MLH-banner-to-landing-page branch from afd209a to b0a6e25 Compare February 20, 2025 04:26
@anakafeel anakafeel merged commit 6790228 into cuhacking:main Feb 20, 2025
3 of 5 checks passed
@MFarabi619
Copy link
Member

🎉 This PR is included in version 2.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants