update css for grid

This commit is contained in:
Nate Kelley 2025-03-13 15:34:58 -06:00
parent 3ecdf641d3
commit bab2de680f
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
5 changed files with 21 additions and 12 deletions

View File

@ -7,11 +7,8 @@ export default async function MetricPage(props: {
searchParams: Promise<{ embed?: string }>; searchParams: Promise<{ embed?: string }>;
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const { embed } = searchParams;
const params = await props.params; const params = await props.params;
const { embed } = searchParams;
const { metricId } = params; const { metricId } = params;
const embedView = embed === 'true'; const embedView = embed === 'true';

View File

@ -10,6 +10,7 @@ import {
import { useMemoizedFn } from '@/hooks'; import { useMemoizedFn } from '@/hooks';
import { useChartWrapperContextSelector } from '../chartHooks/useChartWrapperProvider'; import { useChartWrapperContextSelector } from '../chartHooks/useChartWrapperProvider';
import AppDataGrid from '@/components/ui/table/AppDataGrid/AppDataGrid'; import AppDataGrid from '@/components/ui/table/AppDataGrid/AppDataGrid';
import './TableChart.css';
export interface BusterTableChartProps extends BusterTableChartConfig, BusterChartPropsBase {} export interface BusterTableChartProps extends BusterTableChartConfig, BusterChartPropsBase {}
@ -80,6 +81,7 @@ const BusterTableChartBase: React.FC<
return ( return (
<AppDataGrid <AppDataGrid
className={'buster-table-chart'}
key={data.length} key={data.length}
rows={data} rows={data}
initialWidth={containerWidth} initialWidth={containerWidth}

View File

@ -0,0 +1,8 @@
.buster-table-chart {
.rdg-row:not(:has(+ .rdg-row)) {
@apply border-b-0;
.rdg-cell {
@apply border-b-0;
}
}
}

View File

@ -36,6 +36,7 @@ import {
defaultHeaderFormat, defaultHeaderFormat,
MIN_WIDTH MIN_WIDTH
} from './helpers'; } from './helpers';
import { cn } from '@/lib/classMerge';
type Row = Record<string, string | number | null | Date>; type Row = Record<string, string | number | null | Date>;
@ -46,6 +47,7 @@ const DEFAULT_COLUMN_WIDTH = {
}; };
export interface AppDataGridProps { export interface AppDataGridProps {
className?: string;
initialWidth?: number; initialWidth?: number;
animate?: boolean; animate?: boolean;
resizable?: boolean; resizable?: boolean;
@ -68,6 +70,7 @@ export interface AppDataGridProps {
export const AppDataGrid: React.FC<AppDataGridProps> = React.memo( export const AppDataGrid: React.FC<AppDataGridProps> = React.memo(
({ ({
className = '',
resizable = true, resizable = true,
draggable = true, draggable = true,
sortable = true, sortable = true,
@ -341,10 +344,11 @@ export const AppDataGrid: React.FC<AppDataGridProps> = React.memo(
<ErrorBoundary onError={handleErrorBoundary}> <ErrorBoundary onError={handleErrorBoundary}>
<div <div
ref={containerRef} ref={containerRef}
className={'bg-background flex h-full w-full flex-col'} className={cn(
style={{ 'bg-background flex h-full w-full flex-col',
transition: animate ? 'opacity 0.25s' : undefined // animate && 'animate-in fade-in',
}}> className
)}>
<DataGrid <DataGrid
className={styles.dataGrid} className={styles.dataGrid}
columns={reorderedColumns} columns={reorderedColumns}
@ -393,7 +397,7 @@ const HeaderCell: React.FC<
</Text> </Text>
{sortable && sortDirection && ( {sortable && sortDirection && (
<div <div
className="text-icon-color text-xs transition" className="text-icon-color text-2xs ml-1 transition"
style={{ style={{
transform: `rotate(${sortDirection === 'ASC' ? 0 : 180}deg)` transform: `rotate(${sortDirection === 'ASC' ? 0 : 180}deg)`
}}> }}>

View File

@ -31,9 +31,7 @@ export const useSelectedFileAndLayout = ({
return 'chat'; return 'chat';
} }
if (selectedFile) return 'file'; return 'file';
return 'chat';
}, [selectedFile]); }, [selectedFile]);
const [renderViewLayoutKey, setRenderViewLayoutKey] = useState<ChatLayoutView>( const [renderViewLayoutKey, setRenderViewLayoutKey] = useState<ChatLayoutView>(