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

#18 Simplify SessionGroups and SessionMessages for basic implementation #36

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

steppy452
Copy link
Contributor

@steppy452 steppy452 commented Aug 10, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Previously, it was necessary to always manually loop through Sessions and Conversations, even if you were just using the included components from Reachat.

For example,

<SessionGroups>
  {groups =>
    groups.map(({ heading, sessions }) => (
      <SessionsGroup heading={heading} key={heading}>
        {sessions.map(s => (
          <SessionListItem key={s.id} session={s} />
        ))}
      </SessionsGroup>
    ))
  }
</SessionGroups>

<SessionMessages>
  {conversations =>
    conversations.map((conversation, index) => (
      <SessionMessage
        key={conversation.id}
        conversation={conversation}
        isLast={index === conversations.length - 1}
      />
    ))
  }
</SessionMessages>

Issue Number: #18

What is the new behavior?

No longer need to manually loop through Sessions and Conversations. Now, it's only necessary if user wants to use custom designed components.

New API looks like this, though old way of doing it still works:

<SessionGroups />
<SessionMessages />

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Also, fixed the custom component story that broke when <MessageFiles /> was moved into <MessageQuestion />

@steppy452 steppy452 requested a review from amcdnl August 10, 2024 23:45
Copy link

netlify bot commented Aug 10, 2024

Deploy Preview for reachat-storybook failed. Why did it fail? →

Name Link
🔨 Latest commit 7a39525
🔍 Latest deploy log https://app.netlify.com/sites/reachat-storybook/deploys/66b7fd0fe7e34c0008df5a36

Copy link
Member

@amcdnl amcdnl left a comment

Choose a reason for hiding this comment

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

We need to update the docs on the site too.

@amcdnl amcdnl merged commit 4973e2e into master Aug 12, 2024
1 of 5 checks passed
@amcdnl amcdnl deleted the easy-mode branch August 12, 2024 10:51
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