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

Remove the active property of styled-components inside ListItem #1314

Closed
Tracked by #1800
sungik-choi opened this issue Apr 27, 2023 · 0 comments · Fixed by #1925
Closed
Tracked by #1800

Remove the active property of styled-components inside ListItem #1314

sungik-choi opened this issue Apr 27, 2023 · 0 comments · Fixed by #1925
Assignees
Labels
enhancement Issues or PR related to making existing features better

Comments

@sungik-choi
Copy link
Contributor

sungik-choi commented Apr 27, 2023

Description

ListItem 내부 styled-components의 active 속성을 제거해야합니다.

Reasons for suggestion

jest에서 아래와 같은 에러가 출력됩니다.

Warning: Received `false` for a non-boolean attribute `active`.

If you want to write it to the DOM, pass a string instead: active="false" or active={value.toString()}.

If you used to conditionally omit it with active={condition && value}, pass active={condition ? value : undefined} instead.

styled-components의 styled prop을 활용하기 위해 active prop을 컴포넌트에 전달하는데, 이 속성이 유효한 DOM attribute이기에 문제가 됩니다.

(+ 주의깊게 신경쓰지 않으면 의도치 않은 방향으로 동작할 수 있습니다. #1053 같은 이슈처럼 해결하기 어려운 문제가 될 수 있어서, 장기적으로 prop을 통한 스타일링은 지양해야한다고 생각합니다)

Proposed solution

styled prop이 아닌, classnames를 활용하여 className을 통한 스타일링으로 변경하면 불필요한 attribute 주입을 피할 수 있습니다.

References

No response

@sungik-choi sungik-choi added the enhancement Issues or PR related to making existing features better label Apr 27, 2023
@sungik-choi sungik-choi mentioned this issue Dec 15, 2023
@sungik-choi sungik-choi self-assigned this Jan 18, 2024
sungik-choi added a commit that referenced this issue Jan 19, 2024
<!--
  How to write a good PR title:
- Follow [the Conventional Commits
specification](https://www.conventionalcommits.org/en/v1.0.0/).
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

## Self Checklist

- [x] I wrote a PR title in **English** and added an appropriate
**label** to the PR.
- [x] I wrote the commit message in **English** and to follow [**the
Conventional Commits
specification**](https://www.conventionalcommits.org/en/v1.0.0/).
- [x] I [added the
**changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
about the changes that needed to be released. (or didn't have to)
- [x] I wrote or updated **documentation** related to the changes. (or
didn't have to)
- [x] I wrote or updated **tests** related to the changes. (or didn't
have to)
- [x] I tested the changes in various browsers. (or didn't have to)
  - Windows: Chrome, Edge, (Optional) Firefox
  - macOS: Chrome, Edge, Safari, (Optional) Firefox

## Related Issue
<!-- Please link to issue if one exists -->

- #1733
- Fixes #1117 
- Fixes #1314

## Summary
<!-- Please brief explanation of the changes made -->

Migrate `ListItem` component with scss

## Details
<!-- Please elaborate description of the changes -->

- 컴포넌트 인터페이스를 다른 컴포넌트보다 비교적 많이 변경했습니다. 레거시 컴포넌트이며, 사용하지 않는 속성들이 너무나 많고
현재 다른 베지어 컴포넌트의 사용 방식과 일관성이 맞지 않는 부분이 있었습니다.
- `interpolation`, `name`, `optionKey`, `leftIcon` 속성을 제외하고 채널 데스크
애플리케이션 기준 사용처는 없는 것으로 보입니다.
  - `name`, `optionKey` 는 사실상 무의미한 속성이라, 제거해도 동작은 동일합니다.
- `leftIcon` 속성은 Button 컴포넌트 등과 동일하게 `leftContent` 속성에서 `isBezierIcon`
여부를 체크하도록 변경했습니다. 라이브러리 사용자가 일관적으로 컴포넌트를 사용할 수 있도록 하는 변경입니다.
- `useAdjacentElementBorderRadius.ts` : 이제 `:has` 선택자로 해당 기능 구현이 가능해짐에따라
제거했습니다.
- #1117 을 함께 수정합니다. Breaking change 있는 김에 포함하고자 했습니다.
- XL 사이즈의 잘못된 타이포 사이즈를 수정합니다.

**기타**

- `ActivatableProps` 에서 `active` 속성을 제외하고 제거합니다. 사용하지도 않고, 불필요한 속성이 너무
많았습니다.

### Breaking change? (Yes/No)
<!-- If Yes, please describe the impact and migration path for users -->

Yes

**Breaking Changes: Property updates in `ListItem` component**

- No longer support `interpolation` property. Replace any usage of
`interpolation` property with appropriate `style` or `className`
implementations.
- No longer support `iconStyle`, `iconClassName`, `iconInterpolation`,
`contentStyle`, `contentClassName` and `contentInterpolation`. This
decision was made to reduce excessive flexibility in the interface.
- No longer support `leftIcon` property. Removed for consistency with
other component interfaces. Replace it to `leftContent`.
- No longer support `name` property. The second argument (name) of
`onClick` is also removed. If you need an identifier, combine functions
outside of the component.
- No longer support `hide`, `nested`, `optionKey` and
`disableIconActive` property. Removed because it is a legacy property.
Replace `hide` property with conditional rendering.
- The size changes according to the `ListItemSize`. This is a change to
unify the design. Please change it like below.
  - `ListItemSize.S` -> `ListItemSize.XS`
  - `ListItemSize.M` -> `ListItemSize.S`
  - `ListItemSize.L` -> `ListItemSize.M`
  - `ListItemSize.XL` -> `ListItemSize.L`

**Minor Changes:**

- Fix incorrect text size for `XL`(now `L`) size.

## References
<!-- Please list any other resources or points the reviewer should be
aware of -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues or PR related to making existing features better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant