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

landing page #63

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from
Open

landing page #63

wants to merge 2 commits into from

Conversation

wabinyai
Copy link
Collaborator

@wabinyai wabinyai commented Mar 10, 2025

steps

  • The .env should have
NEXT_PUBLIC_API_TOKEN=<token>
NEXT_PUBLIC_API_URL=https://analytics.airqo.net/api/v2/
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=<G-TOKEN>

Run
npm run dev

Localhost
http://localhost:3000

Summary by CodeRabbit

  • New Features
    • Introduced an interactive map page featuring a full-screen layout with a smooth loading experience.
    • Revamped the homepage to showcase AI-powered air quality monitoring through engaging sections, including hero, features, and process overviews.
    • Updated the navigation menu to include a new "Map" link for easy access.

Copy link

vercel bot commented Mar 10, 2025

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

Name Status Preview Comments Updated (UTC)
air-track ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2025 7:34pm
air-vista ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2025 7:34pm
breeze-mind ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2025 7:34pm
clean-aria ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2025 7:34pm
clean-stats ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2025 7:34pm
frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2025 7:34pm
pure-sphere ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2025 7:34pm

Copy link

coderabbitai bot commented Mar 10, 2025

📝 Walkthrough

Walkthrough

This pull request introduces a new MapPage component with dynamic client-side import of the LeafletMap. The homepage has been completely redesigned to feature sections such as hero, key features, how it works, a call-to-action, and footer. Additionally, the navigation component has been updated to include a new "Map" link that directs users to the new MapPage. The changes also involve component additions and minor formatting adjustments throughout the codebase.

Changes

File(s) Summary
frontend/src/app/map/page.tsx Added new MapPage component that uses dynamic import for LeafletMap with a loading indicator and flex layout for navigation and map.
frontend/src/app/page.tsx Overhauled homepage layout with multiple sections (hero, key features, how it works, CTA, footer) and introduced new FeatureCard and StepCard components.
frontend/src/components/navigation/navigation.tsx Updated navigation items to include a "Map" link and made minor formatting adjustments.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant Nav as Navigation
    participant MP as MapPage
    participant LM as LeafletMap

    U->>Nav: Click "Map" link
    Nav->>MP: Route to MapPage
    MP->>LM: Dynamically import LeafletMap (no SSR)
    LM-->>MP: Return loaded map component
    MP-->>U: Render full-screen map with navigation
Loading

Possibly related PRs

Suggested labels

ready for review

Suggested reviewers

  • Baalmart
  • Codebmk

Poem

In lines of code, a new map unfurls,
A journey begins with clicks and whirls.
Pages reborn and features now gleam,
Navigating dreams like a seamless stream.
Code sings its tune – a digital art supreme! 🚀

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
  • @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 or @coderabbitai title 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: 0

🧹 Nitpick comments (3)
frontend/src/app/map/page.tsx (1)

7-10: Ensure fallback error boundaries for dynamic imports.
This dynamic import approach is solid, especially with SSR disabled. However, consider integrating an error boundary or other graceful error-handling strategy to handle potential runtime failures more transparently.

frontend/src/app/page.tsx (2)

14-55: Reevaluate double-click navigation.
Using a double-click event (line 43) to navigate to the map can be unintuitive. A single-click or a direct link might provide better user experience and reduce accidental confusion.

Apply this small adjustment if you prefer single-click navigation:

- onDoubleClick={() => window.location.href = "/map"}
+ onClick={() => window.location.href = "/map"}

57-99: Key features section is visually clear.
Each FeatureCard is well-structured, conveys its content succinctly, and the grid layout is well-spaced. Consider using semantic elements like <article> or <section> if you want to further improve accessibility.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 55d578a and 45255f0.

⛔ Files ignored due to path filters (1)
  • frontend/public/images/homeMAP.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • frontend/src/app/map/page.tsx (1 hunks)
  • frontend/src/app/page.tsx (1 hunks)
  • frontend/src/components/navigation/navigation.tsx (5 hunks)
🔇 Additional comments (8)
frontend/src/app/map/page.tsx (1)

12-24: Layout and component structure look good.
Your usage of a flex container with a navigation header followed by the Leaflet map is well-organized. This ensures the map fills the remaining screen height. Excellent work.

frontend/src/components/navigation/navigation.tsx (3)

11-11: New "Map" link is consistent.
The added “Map” link aligns well with existing links. No concerns regarding functionality or consistency.


19-20: Mobile menu state management is straightforward.
Using a useState hook to toggle the menu is a clean approach. The button’s click handler correctly toggles the menu’s open state.

Also applies to: 30-30


43-43: Active link highlighting is properly implemented.
Applying the conditional text-gray-900 class and the bottom border effect strongly indicates the active route. Good job.

Also applies to: 62-62

frontend/src/app/page.tsx (4)

103-132: Effective “How It Works” section.
This three-step flow is straightforward and visually balanced. Great use of separate components (StepCard) for maintainability and clarity.


135-156: Call-to-action section is well-designed.
Your CTA stands out with a clear message and distinct button styles. It effectively guides users toward the most interactive parts of your platform.


158-164: Footer content is appropriate and consistently styled.
Dynamically rendering the current year is a nice detail. Overall, there are no major concerns with the footer implementation.


169-191: Encapsulated components (FeatureCard & StepCard) look excellent.
These reusable components neatly handle their own display logic, improving maintainability and clarity. Great job!

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

🧹 Nitpick comments (4)
frontend/src/app/page.tsx (4)

10-55: Hero section looks great, but consider using Next.js routing instead of direct URL manipulation

The hero section has a clean, responsive design with well-structured CTAs. However, there's an issue with the image double-click handler:

- onDoubleClick={() => window.location.href = "/map"}
+ onDoubleClick={() => router.push("/map")}

Using window.location.href bypasses Next.js routing benefits like client-side navigation. Consider importing and using the useRouter hook from next/navigation for better performance and compatibility with Next.js features.


45-50: Image URL includes unnecessary query parameters

The Image component is properly using the fill prop for responsive behavior, but the image URL contains query parameters that appear to control dimensions:

- src="/images/homeMAP.png?height=2300&width=800"
+ src="/images/homeMAP.png"

Next.js Image component already handles responsive sizing and optimization, so these parameters are likely redundant. Additionally, consider using a more descriptive alt text to improve accessibility.


57-101: Key Features section has consistent design, but duplicate icon usage

The features section is well-structured with a responsive grid layout. However, note that the MapPin icon is used for both "Optimal Site Location" (line 70) and "Interactive Mapping" (line 95). Consider using different, more specific icons for each feature to visually differentiate them.


158-164: Footer is minimal - consider enhancing with additional content

The current footer is quite basic with just a copyright notice. Consider enhancing it with navigation links, social media links, contact information, or other relevant content that would provide value to users.

Also, there's an extra whitespace on line 162 that could be removed for cleaner code.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 45255f0 and b69894b.

📒 Files selected for processing (1)
  • frontend/src/app/page.tsx (1 hunks)
🔇 Additional comments (6)
frontend/src/app/page.tsx (6)

1-7: Well-structured imports with clear organization

The imports are organized logically, with React types, Next.js components, and Lucide icons grouped appropriately. This makes the dependencies clear and maintainable.


103-132: How It Works section has clear step progression

The step cards effectively communicate the platform's workflow in a visual, numbered format. The responsive design ensures proper display across device sizes.


134-156: CTA section effectively reinforces key actions

The CTA section maintains consistent styling with the hero section and provides clear pathways for users to engage with the platform's main features.


169-178: Well-designed FeatureCard component with proper TypeScript typing

The FeatureCard component effectively encapsulates the UI logic for displaying features with explicit TypeScript prop typing, making it reusable and maintainable.


180-191: Well-designed StepCard component with proper TypeScript typing

The StepCard component is cleanly implemented with good prop typing, creating a consistent visual language for the step progression in the How It Works section.


193-195: Clean default export

The default export is clean and straightforward, following best practices for React component exports.

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.

1 participant