Skip to content

Bugfix/make-brands-perfect - #118

Merged
rahul-sinha1908 merged 12 commits into
masterfrom
bugfix/make-brands-perfect
May 2, 2025
Merged

rahul-sinha1908 merged 12 commits into
masterfrom
bugfix/make-brands-perfect

Conversation

@rahul-sinha1908

@rahul-sinha1908 rahul-sinha1908 commented May 2, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added validation to require a work email address during account creation.
    • Enhanced login and account creation screens with improved layout, styling, and clearer prompts.
  • Bug Fixes

    • Corrected nesting of login prompt text and links.
  • Refactor

    • Simplified navigation in influencer profile icons.
    • Streamlined chat context to focus on user connection and push token registration.
    • Updated cloud messaging and token management to use shared libraries.
  • Chores

    • Changed Expo server to start on port 8082.
    • Updated subproject reference for shared libraries.
  • Revert

    • Removed legacy cloud messaging providers and token utility functions.

@coderabbitai

coderabbitai Bot commented May 2, 2025 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

This set of changes restructures cloud messaging and chat context integration, updates UI layouts for authentication screens, and modifies import paths and scripts. The cloud messaging context providers for both native and web platforms are deleted, with their imports redirected to a shared library. The chat context providers are simplified to focus on user connection and push token registration. UI improvements are made to the account creation and login screens, including layout refinements and text updates. The service worker for Firebase messaging is updated to use inline configuration. The Expo start script is changed to use a specific port, and some utility functions are removed or their import paths updated.

Changes

File(s) Change Summary
app/(auth)/create-new-account.tsx, app/(auth)/login.tsx UI layout and styling improvements, updated text labels, import reordering, and minor bug fixes in text nesting; no logic changes.
app/(main)/_layout.tsx Injects authentication and streaming client props into CloudMessagingContextProvider using useAuthContext and streamClient.
app/index.tsx Reorders import statements; no functional changes.
components/explore-influencers/profile-icon.tsx Refactors navigation to use useRouter with Pressable; adjusts icon/image layering and removes Link.
contexts/auth-context.provider.tsx Adds work email validation to signUp using new isWorkEmail helper; halts sign-up with error toast for non-work emails.
contexts/chat-context.provider.tsx Exports streamClient; after user connection, registers push notification token with Stream using getToken and registerPushTokenWithStream.
contexts/chat-context.provider.web.tsx Removes all channel/member management methods; now only exposes connectUser and handles push token registration post-connection.
contexts/cloud-messaging.provider.tsx, contexts/cloud-messaging.provider.web.tsx Deleted: both native and web cloud messaging providers and hooks removed.
contexts/index.ts Changes import paths for CloudMessagingContextProvider and useCloudMessagingContext to shared-libs; reorders imports.
package.json Changes Expo start script to use port 8082.
public/firebase-messaging-sw.js Removes firebaseConfig import; initializes Firebase inline with explicit config object.
shared-libs Updates subproject commit reference.
utils/push-notification/push-notification-token.native.ts Updates import path for removeToken to shared-libs.
utils/token.ts Deleted: removes newToken and removeToken utility functions for managing push notification tokens.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AuthScreen
    participant AuthContext
    participant ChatContext
    participant CloudMessagingContext (Shared-Lib)
    participant StreamClient

    User->>AuthScreen: Submit sign-up/login form
    AuthScreen->>AuthContext: signUp/login
    AuthContext-->>AuthScreen: Auth result
    AuthScreen->>ChatContext: connectUser
    ChatContext->>StreamClient: connectUser with token
    StreamClient-->>ChatContext: User connected
    ChatContext->>CloudMessagingContext: getToken
    CloudMessagingContext-->>ChatContext: Returns push token
    ChatContext->>StreamClient: registerPushTokenWithStream
Loading

Possibly related PRs

Suggested reviewers

  • Manan-Sharma-5
  • dev-rathore

Poem

A bunny hopped through code so wide,
Tidying screens with UI pride.
Contexts merged and tokens gone,
Messaging flows now carry on.
Ports are set, imports aligned,
Chat and auth so well entwined.
🐇✨ Here's to code that runs just right—
Bugs, be gone, hop out of sight!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 978c718 and 5ed6eb1.

📒 Files selected for processing (16)
  • app/(auth)/create-new-account.tsx (2 hunks)
  • app/(auth)/login.tsx (2 hunks)
  • app/(main)/_layout.tsx (1 hunks)
  • app/index.tsx (1 hunks)
  • components/explore-influencers/profile-icon.tsx (1 hunks)
  • contexts/auth-context.provider.tsx (2 hunks)
  • contexts/chat-context.provider.tsx (3 hunks)
  • contexts/chat-context.provider.web.tsx (3 hunks)
  • contexts/cloud-messaging.provider.tsx (0 hunks)
  • contexts/cloud-messaging.provider.web.tsx (0 hunks)
  • contexts/index.ts (1 hunks)
  • package.json (2 hunks)
  • public/firebase-messaging-sw.js (1 hunks)
  • shared-libs (1 hunks)
  • utils/push-notification/push-notification-token.native.ts (1 hunks)
  • utils/token.ts (0 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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 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.

@rahul-sinha1908
rahul-sinha1908 merged commit 6e56754 into master May 2, 2025
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