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: adjust mrt_dentsitystate according to the doc #494

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from

Conversation

mr-pinzhang
Copy link

Hey MRT developers, this PR is made to adjust the definition of type MRT_DensityState to what we have on docs.

image

Copy link

vercel bot commented Feb 20, 2025

@mr-pinzhang is attempting to deploy a commit to the Kevin Vandy OSS Team on Vercel.

A member of the Team first needs to authorize it.

@@ -13,7 +13,9 @@ interface Props<TData extends MRT_RowData>
table: MRT_TableInstance<TData>;
}

const next: Record<MRT_DensityState, MRT_DensityState> = {
type TogglableDensityState = Exclude<MRT_DensityState, 'lg' | 'sm'>;
Copy link
Author

Choose a reason for hiding this comment

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

I am trying not to touch the density toggle function here.

Comment on lines +124 to +130
const defaultRowHeightByDensity: Record<MRT_DensityState, number> = {
lg: 61,
md: 53,
sm: 45,
xl: 69,
xs: 37,
};
Copy link
Author

Choose a reason for hiding this comment

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

I find this pattern by myself, noticing the row height increase by 8 per each density. let me know if I'm doing it in a wrong way.

Comment on lines +44 to +50
const defaultRowHeightByDensity: Record<MRT_DensityState, number> = {
lg: 62.7,
md: 54.7,
sm: 48.7,
xl: 70.7,
xs: 42.7,
};
Copy link
Author

Choose a reason for hiding this comment

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

not sure how this number gets calculated. from xs to md, it's a number gap of 12. For md to xl, it's 16. so I put 6+ for sm, and 8+ for 'lg` here.

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