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

feat: Toast RN & 鸿蒙 适配 #2299

Open
wants to merge 12 commits into
base: dev-harmony
Choose a base branch
from

Conversation

xiaoyatong
Copy link
Collaborator

@xiaoyatong xiaoyatong commented May 29, 2024

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • 新功能

    • 完全替换了 Demo 组件,提高了模块化和可重用性。
    • Toast 组件添加了新的样式参数,增强了通知的外观。
    • 更新了多个页面的标题文本,提升了一致性和可读性。
  • 样式

    • 改进了 .nut-toast 组件的样式,增强了响应性和适应性。

@xiaoyatong xiaoyatong changed the title feat: Toast RN 适配 feat: Toast RN & 鸿蒙 适配 May 30, 2024
@xiaoyatong xiaoyatong requested a review from irisSong May 31, 2024 03:25
@irisSong
Copy link
Collaborator

irisSong commented May 31, 2024

鸿蒙和rn的换行截断demo未适配成功,函数调用demo需要修改一下demo样式,rn弹出样式居中偏下,

@xiaoyatong
Copy link
Collaborator Author

鸿蒙和rn的换行截断demo未适配成功,函数调用demo需要修改一下demo样式,rn弹出样式居中偏下,

1)鸿蒙和rn的换行不支持,已屏蔽;
2)函数调用demo已修改;
3)rn弹出样式居中修改已处理。

@oasis-cloud
Copy link
Collaborator

RN 下的展示换行了
image

@oasis-cloud
Copy link
Collaborator

鸿蒙下太宽了
image

<Demo5 />
</div>
{/* rn和 鸿蒙不支持 break-all */}
{Taro.getEnv() === Taro.ENV_TYPE.HARMONYHYBRID ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

需要合并下 dev- harmony 的代码,环境判断使用 harmonyAndRn() .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Copy link

coderabbitai bot commented Jul 24, 2024

Walkthrough

此次更改集中在多个组件的优化与重构,旨在提升模块化、改善可读性和增强用户交互体验。通过调整样式、更新文档及重构部分功能,整体应用的灵活性和可用性得到了显著提升,显示出对用户需求的更好响应。

Changes

文件路径 更改摘要
packages/nutui-taro-demo-rn/src/app.config.ts defineAppConfig 函数调用的格式调整,去掉空格。
packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts 更新 navigationBarTitleText 从 'Pulltorefresh' 改为 'PullToRefresh',提高可读性。
packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx Demo 组件实现被替换为从 @/packages/toast/demo.taro 导入,增强模块化。
packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts navigationBarTitleText 后添加逗号,符合对象书写风格。
src/packages/toast/Notification.tsx 重新设计 Notification 组件的渲染逻辑,优化图标处理。
src/packages/toast/demo.taro.tsx 简化环境检测逻辑,提升性能。
src/packages/toast/toast.harmony.css 更新 .nut-toast 组件样式,调整布局并新增响应式样式。
src/packages/toast/toast.scss 引入条件编译指令,增强 .nut-toast 组件的样式和响应性。
src/packages/toast/toast.taro.tsx 增强 Toast 组件,支持环境检测和 RTL 布局。

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Toast
    participant Demo
    
    User->>Toast: Show Toast Notification
    activate Toast
    Toast-->>Demo: Render Notification
    deactivate Toast
Loading

🐰 在草地上跳跃,欢呼变革来,
模块化组件,灵活又精彩!
新的样式与功能,皆为用户喜,
感谢大家的努力,共同筑梦想的未来!


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5518d85 and 1c87258.

Files selected for processing (9)
  • packages/nutui-taro-demo-rn/src/app.config.ts (2 hunks)
  • packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts (1 hunks)
  • packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx (1 hunks)
  • packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts (1 hunks)
  • src/packages/toast/Notification.tsx (4 hunks)
  • src/packages/toast/demo.taro.tsx (3 hunks)
  • src/packages/toast/toast.harmony.css (2 hunks)
  • src/packages/toast/toast.scss (5 hunks)
  • src/packages/toast/toast.taro.tsx (8 hunks)
Files skipped from review due to trivial changes (3)
  • packages/nutui-taro-demo-rn/src/app.config.ts
  • packages/nutui-taro-demo-rn/src/feedback/pages/pulltorefresh/index.config.ts
  • packages/nutui-taro-demo-rn/src/nav/pages/backtop/index.config.ts
Files skipped from review as they are similar to previous changes (5)
  • src/packages/toast/Notification.tsx
  • src/packages/toast/demo.taro.tsx
  • src/packages/toast/toast.harmony.css
  • src/packages/toast/toast.scss
  • src/packages/toast/toast.taro.tsx
Additional comments not posted (2)
packages/nutui-taro-demo-rn/src/feedback/pages/toast/index.tsx (2)

1-1: 导入语句看起来不错。

此更改通过从外部文件导入 Demo 组件,提高了代码的模块化和可维护性。


2-2: 导出语句看起来不错。

此更改通过直接导出导入的 Demo 组件,简化了代码结构。


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

Outside diff range, codebase verification and nitpick comments (1)
src/packages/watermark/doc.taro.md (1)

15-16: 优化文档描述

建议更详细地描述单行文本、多行文本和图片支持的具体用法,以便用户更容易理解。

- 包含单行文本、多行文本、支持图片。
+ 支持单行文本、多行文本和图片水印的使用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants