fix a few more scroll areas

This commit is contained in:
Nate Kelley 2025-03-31 17:25:40 -06:00
parent 59e898edeb
commit c51fe65868
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
4 changed files with 7 additions and 8 deletions

View File

@ -177,7 +177,7 @@ export const MetricStylingApp: React.FC<{
)}
{segment === MetricStylingAppSegments.COLORS && (
<StylingAppColors className="mb-12 px-4" colors={colors} />
<StylingAppColors className="px-4" colors={colors} />
)}
</ScrollArea>
</div>

View File

@ -28,14 +28,12 @@ const options: SegmentedItem<ColorAppSegments>[] = [
export const ColorStyleSegments: React.FC<{
setSelectedSegment: (value: ColorAppSegments) => void;
initialSelectedSegment: ColorAppSegments;
}> = React.memo(({ initialSelectedSegment, setSelectedSegment }) => {
selectedSegment: ColorAppSegments;
}> = React.memo(({ selectedSegment, setSelectedSegment }) => {
const onChange = useMemoizedFn((value: SegmentedItem<ColorAppSegments>) => {
setSelectedSegment(value.value);
});
return (
<AppSegmented block options={options} value={initialSelectedSegment} onChange={onChange} />
);
return <AppSegmented block options={options} value={selectedSegment} onChange={onChange} />;
});
ColorStyleSegments.displayName = 'PaletteSegments';

View File

@ -29,7 +29,7 @@ export const ColorsApp: React.FC<{
return (
<div className="flex flex-col space-y-2">
<ColorStyleSegments
initialSelectedSegment={initialSelectedSegment}
selectedSegment={selectedSegment}
setSelectedSegment={setSelectedSegment}
/>

View File

@ -8,6 +8,7 @@ import { ColorsApp } from './ColorsApp';
import { IBusterMetricChartConfig } from '@/api/asset_interfaces';
import { useMemoizedFn, useUnmount } from '@/hooks';
import { useUpdateMetricChart } from '@/context/Metrics';
import { cn } from '@/lib/classMerge';
export const StylingAppColors: React.FC<{
className: string;
@ -27,7 +28,7 @@ export const StylingAppColors: React.FC<{
<SelectColorApp selectedTab={selectedTab} onChange={setSelectedTab} />
</div>
<div className={className}>
<div className={cn(className, 'mb-12')}>
<AnimatePresence mode="wait" initial={false}>
<motion.div
key={selectedTab}