Begin support for container queries with css modules

This commit is contained in:
jeffvli 2023-07-23 05:18:08 -07:00
parent 84bec824f2
commit 0a13d047bb
3 changed files with 15 additions and 23 deletions

View file

@ -10,8 +10,8 @@ export const useFixedTableHeader = ({ enabled }: { enabled: boolean }) => {
const topMargin =
windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS
? '-128px'
: '-98px';
? '-130px'
: '-100px';
const isTableHeaderInView = useInView(tableHeaderRef, {
margin: `${topMargin} 0px 0px 0px`,
@ -30,21 +30,12 @@ export const useFixedTableHeader = ({ enabled }: { enabled: boolean }) => {
const root = document.querySelector('main .ag-root');
if (!isTableHeaderInView && isTableInView) {
if (windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS) {
header?.classList.add('window-frame');
}
header?.classList.add('ag-header-fixed');
root?.classList.add('ag-header-fixed-margin');
} else if (!isTableInView) {
if (windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS) {
header?.classList.remove('window-frame');
}
header?.classList.remove('ag-header-fixed');
root?.classList.remove('ag-header-fixed-margin');
} else if (isTableHeaderInView) {
if (windowBarStyle === Platform.WINDOWS || windowBarStyle === Platform.MACOS) {
header?.classList.remove('window-frame');
}
header?.classList.remove('ag-header-fixed');
root?.classList.remove('ag-header-fixed-margin');
}