Skip to content

Conversation

@Seolhun
Copy link
Contributor

@Seolhun Seolhun commented Jul 24, 2022

Self Checklist

  • I wrote a PR title in English.
  • I added an appropriate label to the PR.
  • I wrote a commit message in English.
  • I wrote a commit message according to the Conventional Commits specification.
  • I added the appropriate changeset for the changes.
  • I wrote a unit test about the implementation.
  • I wrote a storybook document about the implementation.
  • I tested the implementation in various browsers.
    • Windows: Chrome, Edge, (Optional) Firefox
    • macOS: Chrome, Edge, Safari, (Optional) Firefox

Summary

  • change the toast component content props from string to react-node

Details

  • Replace the line breaking "\n" to div element in string content.
  • Changed from string to ReactNode to build a custom content toast.
  • Since ReactNode is string compatible, there is no breaking-changes.
  • Fixed a problem broader than the Close area than the Content area. (flex-shrink)
  • actionContent props is deprecated. It is used one place only in the desk application.
  • Add a CustomContent(ReactNode) storybook.

Screen Shot 2022-07-25 at 14 10 08

Screen Shot 2022-07-24 at 22 07 31

Screen.Recording.2022-07-26.at.13.34.00.mov

Browser Compatibility

OS / Engine 호환성을 반드시 확인해주세요.

Windows

  • Chrome - Blink
  • Edge - Blink
  • Firefox - Gecko (Option)

macOS

  • Chrome - Blink
  • Edge - Blink
  • Safari - WebKit
  • Firefox - Gecko (Option)

References

https://github.com/channel-io/ch-desk-web/issues/10597

@changeset-bot
Copy link

changeset-bot bot commented Jul 24, 2022

🦋 Changeset detected

Latest commit: dad5a18

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@channel.io/bezier-react Patch
bezier-figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Seolhun Seolhun force-pushed the features/toast branch 2 times, most recently from 4cfd203 to 9cba590 Compare July 24, 2022 13:33
@Seolhun Seolhun self-assigned this Jul 24, 2022
@Seolhun Seolhun force-pushed the features/toast branch 2 times, most recently from ddf8b35 to 9177c1a Compare July 25, 2022 03:40
@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #894 (dad5a18) into next-v1 (fa97b85) will increase coverage by 0.60%.
The diff coverage is 80.00%.

@@             Coverage Diff             @@
##           next-v1     #894      +/-   ##
===========================================
+ Coverage    69.01%   69.61%   +0.60%     
===========================================
  Files          205      205              
  Lines         2872     2873       +1     
  Branches       791      791              
===========================================
+ Hits          1982     2000      +18     
+ Misses         775      759      -16     
+ Partials       115      114       -1     
Impacted Files Coverage Δ
.../bezier-react/src/components/Toast/Toast.styled.ts 85.71% <ø> (ø)
...s/bezier-react/src/components/Toast/Toast.types.ts 100.00% <ø> (ø)
...ezier-react/src/components/Toast/ToastProvider.tsx 0.00% <0.00%> (ø)
.../bezier-react/src/components/Toast/ToastService.ts 0.00% <0.00%> (ø)
...ier-react/src/components/Toast/ToastController.tsx 100.00% <100.00%> (+100.00%) ⬆️
...bezier-react/src/components/Toast/ToastElement.tsx 86.66% <100.00%> (+13.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa97b85...dad5a18. Read the comment docs.

@Seolhun Seolhun force-pushed the features/toast branch 5 times, most recently from 81d8b5b to f071ff0 Compare July 25, 2022 06:36
@Seolhun Seolhun marked this pull request as ready for review July 25, 2022 06:40
@github-actions
Copy link
Contributor

github-actions bot commented Jul 25, 2022

Chromatic Report

🚀 Congratulations! Your build was successful!

@Seolhun

This comment was marked as outdated.

Copy link
Contributor

@sungik-choi sungik-choi left a comment

Choose a reason for hiding this comment

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

  • changeset을 추가해주세요(영문)! semantic-release에서 changeset으로 변경하면서, 커밋으로 릴리즈 노트를 자동으로 생성해주지 않기 때문에 버전업에 관련된 변경사항에 대해 개발자가 직접 추가해주어야합니다.
  • PR 제목을 영문으로 변경해주시면 감사하겠습니다 🙏 오픈소스임을 고려해서 PR 제목 등은 영문으로 작성하는 방식으로 맞추려고 해요(#895)

@Seolhun Seolhun force-pushed the features/toast branch 2 times, most recently from 9f1bca1 to 01630dd Compare July 26, 2022 04:27
@Seolhun Seolhun changed the title Toast에 content를 React.ReactNode로 변경 change the toast component content props from string to react-node Jul 26, 2022
@Seolhun Seolhun requested a review from sungik-choi July 26, 2022 04:35
"@channel.io/bezier-react": patch
---

refactor(toast): change toast content props "string" to "react-noe"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
refactor(toast): change toast content props "string" to "react-noe"
refactor(toast): change toast content props "string" to "react-node"

typo

Comment on lines +47 to +49
/**
* @deprecated use React.ReactNode content props instead.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

preset={preset}
appearance={appearance}
content={content}
content={content || ''}
Copy link
Contributor

Choose a reason for hiding this comment

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

ToastElement에서 default로 ''를 채워주는데, fallback이 필요한가요?
f8481ac#diff-85ac2201c8cd87922f19fcf93d3b985de850225c6ea38d267ca63ab0f4a6a99aR21

Copy link
Contributor Author

Choose a reason for hiding this comment

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

어제는 잘 안보였는데, 다시보니까 Required(ToastElementProps에서)랑 ReactNode에서 차이가 발생된거였네요.

export type ToastContent = NonNullable<React.ReactNode>

로 변경하면 될것 같습니다.

@Seolhun Seolhun merged commit ba49e2e into channel-io:next-v1 Jul 26, 2022
@Seolhun Seolhun deleted the features/toast branch July 26, 2022 05:59
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.

4 participants