-
Notifications
You must be signed in to change notification settings - Fork 0
feature/add-404-not-found-page #30
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA new NotFound React component and its props interface were added; the component renders a centered title, message, and an optional CTA button that calls a provided click handler. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant C as NotFound Component
participant H as onButtonClick handler
U->>C: Render with props (title,message,showButton,...)
C->>U: Display title and message
alt showButton == true
U->>C: Click CTA button
C->>H: Invoke onButtonClick()
H-->>U: Handler action (e.g., navigate)
else showButton == false
note right of C #f0f4c3: No CTA rendered
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Comment |
There was a problem hiding this 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
🧹 Nitpick comments (3)
src/components/NotFound/NotFoundProps.ts (2)
1-1: Add space before opening brace.The interface declaration is missing a space before the opening brace, which is inconsistent with standard TypeScript formatting conventions.
Apply this diff:
-export default interface NotFoundProps{ +export default interface NotFoundProps {
4-4: Add missing semicolon for consistency.Line 4 is missing a semicolon, while all other property declarations in the interface have semicolons (lines 2, 3, 5, 6).
Apply this diff:
- showButton: boolean + showButton: boolean;src/components/NotFound/NotFound.tsx (1)
12-18: Update JSDoc example to includeshowButtonprop.The JSDoc example doesn't demonstrate the
showButtonprop, which may confuse developers about its purpose and usage.Apply this diff to include the
showButtonprop in the example:* @example * <NotFound * title="404 - Page Not Found" * message="Sorry, the page you are looking for does not exist." + * showButton={true} * cardButtonLabel="Go to Homepage" * onButtonClick={() => navigate('/')} * />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/NotFound/NotFound.tsx(1 hunks)src/components/NotFound/NotFoundProps.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/NotFound/NotFound.tsx (1)
src/components/NotFound/NotFoundProps.ts (1)
NotFoundProps(1-7)
|
Fix the issues caught by CodeRabbit (AI Code Reviewer)
|
dbc2201
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make changes suggested by CodeRabbit
use showButton prop and conditional rendering syntax to render the button HTML element conditionally to showButton
Description
This pull request introduces a new, reusable
NotFoundcomponent. This component is designed to be a flexible and customizable way to display "not found" (e.g., 404) pages or other general error states to the user. It includes a title, a message, and a call-to-action button, all of which can be configured via props.Type of Change
Changes Made
NotFound.tsxcomponent file.title,message,cardButtonLabel, andonButtonClickas props.Testing Done
onButtonClickhandler is triggered when the button is clicked.Screenshots (if applicable)
A screenshot of the
NotFoundcomponent rendered in the browser.Related Issues
Closes #issue_number (if applicable)
Checklist
Summary by CodeRabbit