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: create header, categoryBar, and categoryButton components #9

Merged
merged 4 commits into from
Nov 28, 2024

Conversation

gurtatiLND
Copy link
Collaborator

@gurtatiLND gurtatiLND commented Nov 27, 2024

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

1. Header Component

  • Adds a Header component with:
    • An app name (<h1>) and a question mark button on the left (reserved for future functionality).
    • An image on the right side.
    • Full integration of the reusable ImageComponent into the Header.
    • Ensuring compatibility with the latest next/image API.
    • Adding explicit parent dimensions for proper fill behavior.

2. Styling Improvements

  • Refactors long Tailwind class strings into reusable variables for cleaner and more maintainable styling.

3. Create and then Delete CategoryButton Component

4. CategoryBar Component

  • Implements a CategoryBar component that uses the Button component to render a list of category buttons dynamically and now they can be chosen

5. Global CSS Updates

  • Adds a reusable header class in global.css with:
    • background: Defines the header background styling.
    • border-bottom: Adds a bottom border to the header for visual separation.

6. Create ImageComponent:

  • Refactored to align with the updated next/image API:
    • Replaced legacy properties like objectFit with style={{ objectFit: 'cover' }}.
    • Added support for the sizes prop to enhance image loading efficiency.
  • Implemented conditional styling for rounded images via the rounded prop.

Screenshots

Screenshot 2024-11-27 at 17 43 48

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Semantic HTML implemented?
  • Checked with axe DevTools and addressed Critical and Serious issues?
  • Color contrast tested?

Added/updated tests?

Please aim to keep the code coverage percentage at 80% and above.

  • Yes
  • No, and this is why: I still don't have(don't know how) any test in my code
  • I need help with writing tests

What gif best describes this PR or how it makes you feel?

alt_text

Copy link
Collaborator

@maxitect maxitect left a comment

Choose a reason for hiding this comment

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

Suggest a few minor changes and discussion points

src/ui/CategoryBar/CategoryButtons.tsx Outdated Show resolved Hide resolved
src/ui/layout/Header.tsx Outdated Show resolved Hide resolved
src/ui/CategoryBar/CategoryBar.tsx Outdated Show resolved Hide resolved
src/ui/layout/Header.tsx Outdated Show resolved Hide resolved
@gurtatiLND gurtatiLND requested a review from maxitect November 27, 2024 17:50
Copy link
Collaborator

@maxitect maxitect left a comment

Choose a reason for hiding this comment

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

Sorry a few more changes, I think there are a few instances of redundant comments, I've marked them up and you can commit them directly from github if you agree. Also there is a merge conflict that needs to be resolved, as soon as those are all addressed I can approve and merge! :)

src/ui/CategoryBar/CategoryBar.tsx Outdated Show resolved Hide resolved
src/ui/CategoryBar/CategoryBar.tsx Outdated Show resolved Hide resolved
src/ui/layout/Header.tsx Outdated Show resolved Hide resolved
src/ui/layout/Header.tsx Outdated Show resolved Hide resolved
src/ui/layout/Header.tsx Outdated Show resolved Hide resolved
src/ui/shared/Button.tsx Outdated Show resolved Hide resolved
src/ui/shared/Image.tsx Outdated Show resolved Hide resolved
gurtatiLND and others added 2 commits November 28, 2024 09:53
delete all redundant comments and delete 'const CategoryBar: React.FC'

Co-authored-by: Maxime Downe <[email protected]>
@gurtatiLND gurtatiLND requested a review from maxitect November 28, 2024 09:55
@maxitect maxitect merged commit 4fb5143 into main Nov 28, 2024
1 check failed
@maxitect maxitect deleted the build/category_bar branch November 28, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants