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

fix(Flex): refactor gaps #7492

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Conversation

inomdzhon
Copy link
Contributor

@inomdzhon inomdzhon commented Aug 30, 2024


  • Unit-тесты
  • e2e-тесты

Описание

Т.к. CSS св-во gap применяется только при наличии нескольких потомков,
добавляем в наш фолбек такую же логику основываясь:

  • на передаче пропа gap;
  • на кол-ве элементов в пропе children;

@inomdzhon inomdzhon requested a review from a team as a code owner August 30, 2024 15:20
@github-actions github-actions bot added the patch Автоматизация: PR продублируется в ветку последнего минорного релиза для выпуска патча label Aug 30, 2024
@inomdzhon inomdzhon removed the patch Автоматизация: PR продублируется в ветку последнего минорного релиза для выпуска патча label Aug 30, 2024
Copy link
Contributor

github-actions bot commented Aug 30, 2024

size-limit report 📦

Path Size
JS 380.88 KB (+0.05% 🔺)
JS (gzip) 115.32 KB (+0.05% 🔺)
JS (brotli) 94.66 KB (+0.08% 🔺)
JS import Div (tree shaking) 1.45 KB (0%)
CSS 309.13 KB (+0.03% 🔺)
CSS (gzip) 39.65 KB (+0.02% 🔺)
CSS (brotli) 31.86 KB (-0.02% 🔽)

Copy link

codesandbox-ci bot commented Aug 30, 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 Aug 30, 2024

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Aug 30, 2024

👀 Docs deployed

Commit 3924fd6

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.17%. Comparing base (a67792e) to head (3924fd6).
Report is 14 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7492   +/-   ##
=======================================
  Coverage   95.17%   95.17%           
=======================================
  Files         384      384           
  Lines       11212    11221    +9     
  Branches     3674     3679    +5     
=======================================
+ Hits        10671    10680    +9     
  Misses        541      541           
Flag Coverage Δ
unittests 95.17% <100.00%> (+<0.01%) ⬆️

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.

@BlackySoul
Copy link
Contributor

Косяк с целевой веткой?)

@inomdzhon inomdzhon changed the base branch from imirdzhamolov/issue7359/feat/ToolButton-design-fix to master September 2, 2024 06:42
@inomdzhon inomdzhon force-pushed the imirdzhamolov/issue7464/fix/Flex-gaps branch from b634353 to cb6ab9f Compare September 2, 2024 06:48
Т.к. CSS св-во `gap` применяется только при наличии нескольких потомков,
добавляем в наш фолбек такую же логику основываясь на передачу пропа `gap`
и количество элементов в пропе `children`.
@inomdzhon inomdzhon force-pushed the imirdzhamolov/issue7464/fix/Flex-gaps branch from cb6ab9f to 3924fd6 Compare September 2, 2024 06:49
@inomdzhon
Copy link
Contributor Author

Косяк с целевой веткой?)

поправил, спасибо ✅

Copy link
Contributor

@SevereCloud SevereCloud left a comment

Choose a reason for hiding this comment

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

Теперь у флекса появился отступ сверху и слева

было стало
image image

@inomdzhon
Copy link
Contributor Author

Теперь у флекса появился отступ сверху и слева

было стало
image image

а скинь плиз пример с кодом

вот так не смог воспроизвести

image
код

<button>кнопка</button>
<button>кнопка</button>
  <Flex gap="xs">
    {new Array(3).fill(3).map((i) => (
      <div style={{ width: '36px', height: '36px', borderRadius: '50%', border: '1px solid red' }} key={i}>
        <Flex
          align="center"
          justify="center"
          style={{ width: '36px', height: '36px', border: '1px solid blue' }}
        >
          VKUI
        </Flex>
      </div>
    ))}
  </Flex>```

</p>
</details> 

@SevereCloud
Copy link
Contributor

Код

<Button></Button>
<Button></Button>
  <Flex gap="xs">
    {new Array(3).fill(3).map((i) => (
      <div style={{ width: '36px', height: '36px', borderRadius: '50%', border: '1px solid red' }} key={i}>
        <Flex
          align="center"
          justify="center"
          style={{ width: '36px', height: '36px', border: '1px solid blue' }}
        >
          VKUI
        </Flex>
      </div>
    ))}
  </Flex>

@inomdzhon
Copy link
Contributor Author

inomdzhon commented Sep 2, 2024

Код

Это из-за Button без текста создаёт пустое пространство, если добавить текст, то всё ок

image image

@inomdzhon inomdzhon merged commit f9c1d14 into master Sep 2, 2024
28 checks passed
@inomdzhon inomdzhon deleted the imirdzhamolov/issue7464/fix/Flex-gaps branch September 2, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants