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: support items & add deprecated warning #312

Merged
merged 25 commits into from
Apr 14, 2023

Conversation

Wxh16144
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Mar 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
collapse ❌ Failed (Inspect) Apr 14, 2023 9:12am

@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Merging #312 (7aa6b36) into master (ca4067a) will increase coverage by 0.27%.
The diff coverage is 100.00%.

❗ Current head 7aa6b36 differs from pull request most recent head efcd88e. Consider uploading reports for the commit efcd88e to get more accurate results

@@            Coverage Diff             @@
##           master     #312      +/-   ##
==========================================
+ Coverage   98.85%   99.12%   +0.27%     
==========================================
  Files           4        5       +1     
  Lines          87      114      +27     
  Branches       33       40       +7     
==========================================
+ Hits           86      113      +27     
  Misses          1        1              
Impacted Files Coverage Δ
src/Panel.tsx 100.00% <ø> (ø)
src/PanelContent.tsx 90.90% <ø> (ø)
src/index.tsx 100.00% <ø> (ø)
src/Collapse.tsx 100.00% <100.00%> (ø)
src/hooks/useItems.tsx 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kiner-tang
Copy link
Contributor

覆盖率掉了,看看?

docs/examples/basic.tsx Outdated Show resolved Hide resolved
@Wxh16144
Copy link
Contributor Author

src/Collapse.tsx

覆盖率掉了,看看?

属性是透传的,所以忽略了,可以考虑补一补

@Wxh16144
Copy link
Contributor Author

Wxh16144 commented Mar 29, 2023

TODOs:

  • test coverage
  • header => label

src/Collapse.tsx Outdated
@@ -114,7 +121,62 @@ const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) =>
return React.cloneElement(child, childProps);
};

const children = toArray(rawChildren).map(getNewChild);
// eslint-disable-next-line @typescript-eslint/no-shadow
const convertItemsToNodes = (items: ItemType[]) =>
Copy link
Member

Choose a reason for hiding this comment

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

这个抽成一个 hooks:

const childNodes = useItems(items, rawChildren);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里没 get 到意思呢,求指点

This comment was marked as outdated.

src/Collapse.tsx Outdated Show resolved Hide resolved
@zombieJ zombieJ merged commit fb94b44 into react-component:master Apr 14, 2023
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.

3 participants