-
Notifications
You must be signed in to change notification settings - Fork 142
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
base: master
Are you sure you want to change the base?
chore: Table関連の内部処理を整理 #5369
Conversation
b972e35
to
142403c
Compare
142403c
to
294837c
Compare
commit: |
be8b018
to
0587711
Compare
0587711
to
c839dee
Compare
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]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classNameの生成ロジックを整理しています。
trimなどが不要になります
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', | ||
], |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useEffectの早期終了時にはnoopを渡す必要はないため、削除しています
関連URL
概要
変更内容
確認方法