feat(core): replace setting content scroll with radix ScrollArea (#6787)
Use global scroll-area style 
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { cssVar } from '@toeverything/theme';
|
import { cssVar } from '@toeverything/theme';
|
||||||
import { keyframes, style } from '@vanilla-extract/css';
|
import { globalStyle, keyframes, style } from '@vanilla-extract/css';
|
||||||
export const plansLayoutRoot = style({
|
export const plansLayoutRoot = style({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
@@ -100,7 +100,6 @@ export const aiScrollTip = style({
|
|||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
padding: '12px 20px 12px 16px',
|
padding: '12px 20px 12px 16px',
|
||||||
boxShadow: cssVar('shadow1'),
|
boxShadow: cssVar('shadow1'),
|
||||||
display: 'flex',
|
|
||||||
marginBottom: -100,
|
marginBottom: -100,
|
||||||
|
|
||||||
animation: `${slideInBottom} 0.3s ease 0.5s forwards`,
|
animation: `${slideInBottom} 0.3s ease 0.5s forwards`,
|
||||||
@@ -112,6 +111,10 @@ export const aiScrollTip = style({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
// to override `display: contents !important` in `scrollable.tsx`
|
||||||
|
globalStyle(`div.${aiScrollTip}`, {
|
||||||
|
display: 'flex !important',
|
||||||
|
});
|
||||||
export const aiScrollTipLabel = style({
|
export const aiScrollTipLabel = style({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Loading } from '@affine/component';
|
import { Loading, Scrollable } from '@affine/component';
|
||||||
import { WorkspaceDetailSkeleton } from '@affine/component/setting-components';
|
import { WorkspaceDetailSkeleton } from '@affine/component/setting-components';
|
||||||
import type { ModalProps } from '@affine/component/ui/modal';
|
import type { ModalProps } from '@affine/component/ui/modal';
|
||||||
import { Modal } from '@affine/component/ui/modal';
|
import { Modal } from '@affine/component/ui/modal';
|
||||||
@@ -139,7 +139,8 @@ const SettingModalInner = ({
|
|||||||
onTabChange={onTabChange}
|
onTabChange={onTabChange}
|
||||||
selectedWorkspaceId={workspaceMetadata?.id ?? null}
|
selectedWorkspaceId={workspaceMetadata?.id ?? null}
|
||||||
/>
|
/>
|
||||||
<div
|
<Scrollable.Root>
|
||||||
|
<Scrollable.Viewport
|
||||||
data-testid="setting-modal-content"
|
data-testid="setting-modal-content"
|
||||||
className={style.wrapper}
|
className={style.wrapper}
|
||||||
ref={modalContentWrapperRef}
|
ref={modalContentWrapperRef}
|
||||||
@@ -183,7 +184,9 @@ const SettingModalInner = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<Scrollable.Scrollbar />
|
||||||
|
</Scrollable.Viewport>
|
||||||
|
</Scrollable.Root>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,13 +5,8 @@ export const wrapper = style({
|
|||||||
height: '100%',
|
height: '100%',
|
||||||
// margin: '0 auto',
|
// margin: '0 auto',
|
||||||
padding: '40px 15px 20px 15px',
|
padding: '40px 15px 20px 15px',
|
||||||
overflowX: 'hidden',
|
|
||||||
overflowY: 'auto',
|
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
'::-webkit-scrollbar': {
|
|
||||||
display: 'none',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
export const centerContainer = style({
|
export const centerContainer = style({
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
|||||||
Reference in New Issue
Block a user