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

chore: Table関連の内部処理を整理 #5369

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

AtsushiM
Copy link
Member

@AtsushiM AtsushiM commented Feb 6, 2025

関連URL

概要

変更内容

確認方法

@yagimushi yagimushi force-pushed the chore-format-Table branch 3 times, most recently from b972e35 to 142403c Compare February 7, 2025 00:38
Copy link

pkg-pr-new bot commented Feb 7, 2025

Open in Stackblitz

npm i https://pkg.pr.new/kufu/smarthr-ui@5369

commit: c839dee

Comment on lines +19 to +29
const actualClassName = useMemo(() => {
const base = classNameGenerator({ align, vAlign, nullable, fixed, className })

if (!fixed) {
return base
}

const shadow = reelShadowClassNameGenerator({ direction: 'right' })

return `${base} ${shadow}`
}, [align, className, contentWidth, fixed, nullable, style, vAlign])
Copy link
Member Author

Choose a reason for hiding this comment

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

classNameの生成ロジックを整理しています。
trimなどが不要になります

Comment on lines +180 to +191
upIcon: [
'shr-text-base',
'[[aria-sort="none"]_&]:shr-text-disabled',
'[[aria-sort="ascending"]_&]:shr-text-black',
'[[aria-sort="descending"]_&]:shr-text-disabled',
],
downIcon: [
'-shr-mt-em shr-text-base',
'[[aria-sort="none"]_&]:shr-text-disabled',
'[[aria-sort="ascending"]_&]:shr-text-disabled',
'[[aria-sort="descending"]_&]:shr-text-black',
],
Copy link
Member Author

Choose a reason for hiding this comment

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

sortは切り替わる可能性が高く、またaria-sortで判定できるため、tailwind-variants内にstyle切り替えロジックを完全に押し込めています

@@ -8,7 +8,7 @@ export const useReelCells = () => {
const currentRef = tableWrapperRef.current

if (!currentRef) {
return () => undefined
return
Copy link
Member Author

Choose a reason for hiding this comment

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

useEffectの早期終了時にはnoopを渡す必要はないため、削除しています

@AtsushiM AtsushiM marked this pull request as ready for review February 13, 2025 01:40
@AtsushiM AtsushiM requested a review from a team as a code owner February 13, 2025 01:40
@AtsushiM AtsushiM requested review from misako0927 and uknmr and removed request for a team February 13, 2025 01:40
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.

1 participant