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

Front End: Resolve hydration error found in Conversation Header #932

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

ezawadski
Copy link
Collaborator

@ezawadski ezawadski commented Feb 3, 2025

Hydration Error caused by client side and server side content rendering not aligning because the client side content depends on data coming from the API and therefore not available during server side rendering. Using useEffect hook to resolve this.

AI Description

This pull request introduces changes to the Header.tsx component in the src/interfaces/assistants_web/src/components/Conversation directory. The modifications primarily focus on enhancing the rendering of the header section, ensuring a more dynamic and responsive user interface.

Changes:

  • The useEffect hook is added to resolve a hydration error related to server-side and client-side content alignment.
  • A new useState hook is introduced, initializing a state variable init to false.
  • The rendering of the header section is now conditional, depending on the value of init.
  • The header section displays the agent's name or the Cohere AI logo, along with a label indicating whether the agent is private or public.
  • The share button and kebab menu button are now wrapped in a section element.

Copy link
Collaborator

@EugeneLightsOn EugeneLightsOn left a comment

Choose a reason for hiding this comment

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

Looks good to me

@ezawadski ezawadski merged commit f460a8c into main Feb 3, 2025
4 checks passed
@ezawadski ezawadski deleted the eric/tlk-2609-assistants_web-hydration-error branch February 3, 2025 17:37
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