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

refactor: simplify Banner component structure #50

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

charlottewiltshire0
Copy link
Collaborator

@charlottewiltshire0 charlottewiltshire0 commented Jan 14, 2025

PR Content:

Old

image

New

image

@charlottewiltshire0 charlottewiltshire0 added the enhancement New feature or request label Jan 14, 2025
@charlottewiltshire0 charlottewiltshire0 marked this pull request as ready for review January 14, 2025 15:37
Copy link

Deploying redot-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3d93eca
Status: ✅  Deploy successful!
Preview URL: https://aa1e7302.redot-website.pages.dev
Branch Preview URL: https://chore-banner-background.redot-website.pages.dev

View logs

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Simplified the Banner component by removing motion animations and replacing them with CSS transitions, while adding a gradient background and hover effects.

  • Removed framer-motion dependency and "use client" directive from /components/Banner.tsx
  • Added gradient background styling (from-pink-500 via-amber-500 to-orange-500) in /components/Banner.tsx
  • Made link prop required and removed conditional rendering of subMessage for simpler implementation
  • Implemented smooth hover animation using CSS transition-transform and group-hover:translate-x-1 classes

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 5 to +7
readonly mainMessage?: string;
readonly subMessage?: string;
readonly link?: string;
readonly link: string;
Copy link

Choose a reason for hiding this comment

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

logic: mainMessage is marked optional but required in the implementation (line 15 returns null if !mainMessage). Consider making it required in the interface

</div>
<Link href={link} target="_blank" rel="noopener noreferrer">
<div className="group flex select-none items-center justify-center gap-2 bg-gradient-to-r from-pink-500 via-amber-500 to-orange-500 py-2 font-sans text-sm font-medium tracking-tight text-white">
<p className="hidden md:block">{subMessage}</p>
Copy link

Choose a reason for hiding this comment

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

logic: subMessage is rendered unconditionally now - could show empty space if undefined

@charlottewiltshire0 charlottewiltshire0 merged commit 6e535ce into master Jan 14, 2025
5 checks passed
@charlottewiltshire0 charlottewiltshire0 deleted the chore/banner-background branch January 14, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants