1 parent 335e04e commit d19c1c3Copy full SHA for d19c1c3
3 files changed
app/src/app/components/sidebar/ConditionalScrollArea.tsx
@@ -0,0 +1,25 @@
1
+import React from 'react';
2
+import {ScrollArea} from '@radix-ui/themes';
3
+
4
+export const ConditionalScrollArea: React.FC<{
5
+ children: React.ReactNode;
6
+ shouldUseScrollableRows: boolean;
7
+ maxHeight: string;
8
+}> = ({children, shouldUseScrollableRows, maxHeight}) => {
9
+ if (shouldUseScrollableRows) {
10
+ return (
11
+ // type="always" keeps the scrollbar visible even while not scrolling — it is the
12
+ // sole affordance that more rows exist below (no fade-out effect).
13
+ <ScrollArea
14
+ scrollbars="vertical"
15
+ type="always"
16
+ size="2"
17
+ className="flex-grow-1"
18
+ style={{maxHeight}}
19
+ >
20
+ {children}
21
+ </ScrollArea>
22
+ );
23
+ }
24
+ return children;
25
+};
0 commit comments