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(Popover): add usePopover hook to select anchor of popover #7969

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

EldarMuhamethanov
Copy link
Contributor


  • Unit-тесты
  • Release notes

Описание

Нужно реализовать возможность управлять якорным элементом для поповера, не прокидывая его в children

Изменения

  • Реализовал хук usePopover, который принимает все пропсы, которые принимает Popover, кроме children, и возвращает:
    • anchorRef - реф, который нужно навесить на нужный якорный элемент
    • anchorProps - пропсы, которые нужно навесить на якорный элемент
    • popover - готовый ReactNode , который нужно отрендерить в DOM, чтобы поповер появился
  • Добавил пример использования нового хука в документацию про Popover. Добавил пример с динамическим изменением якорного элемента.

Release notes

Улучшения

  • Popover: добавлена возможность установки своего якорного элемента для Popover снаружи

@EldarMuhamethanov EldarMuhamethanov requested a review from a team as a code owner November 20, 2024 15:46
Copy link
Contributor

github-actions bot commented Nov 20, 2024

size-limit report 📦

Path Size
JS 384.84 KB (+0.05% 🔺)
JS (gzip) 116.38 KB (+0.04% 🔺)
JS (brotli) 95.84 KB (+0.08% 🔺)
JS import Div (tree shaking) 1.56 KB (0%)
CSS 337.07 KB (0%)
CSS (gzip) 42.75 KB (0%)
CSS (brotli) 33.77 KB (0%)

Copy link

codesandbox-ci bot commented Nov 20, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

github-actions bot commented Nov 20, 2024

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Nov 20, 2024

👀 Docs deployed

Commit 006c44c

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.48%. Comparing base (1234239) to head (006c44c).
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7969      +/-   ##
==========================================
- Coverage   95.49%   95.48%   -0.02%     
==========================================
  Files         393      394       +1     
  Lines       11188    11195       +7     
  Branches     3708     3708              
==========================================
+ Hits        10684    10689       +5     
- Misses        504      506       +2     
Flag Coverage Δ
unittests 95.48% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vkcom-publisher vkcom-publisher added the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Nov 29, 2024
@EldarMuhamethanov EldarMuhamethanov removed the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Nov 29, 2024
@EldarMuhamethanov EldarMuhamethanov requested a review from a team November 29, 2024 12:04
@EldarMuhamethanov EldarMuhamethanov merged commit 4fe261b into master Dec 3, 2024
28 checks passed
@EldarMuhamethanov EldarMuhamethanov deleted the e.muhamethanov/6891/add-use-popover-hook branch December 3, 2024 11:27
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.

[Feature][Popover]: Возможность установки своего ref извне
4 participants