mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
adjust header styles
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
gap: var(--theme-spacing-md);
|
gap: var(--theme-spacing-md);
|
||||||
padding: 0 var(--theme-spacing-md);
|
padding: 0 var(--theme-spacing-md);
|
||||||
font-size: var(--theme-font-size-sm);
|
font-size: var(--theme-font-size-sm);
|
||||||
color: var(--theme-colors-foreground-muted);
|
user-select: none;
|
||||||
background-color: var(--theme-colors-background);
|
background-color: var(--theme-colors-background);
|
||||||
border-bottom: 1px solid var(--theme-colors-border);
|
border-bottom: 1px solid var(--theme-colors-border);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -610,6 +610,18 @@ interface DetailListHeaderProps {
|
|||||||
trackTableSize: 'compact' | 'default' | 'large';
|
trackTableSize: 'compact' | 'default' | 'large';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const colTypeToAlignMap = {
|
||||||
|
center: 'center',
|
||||||
|
end: 'right',
|
||||||
|
start: 'left',
|
||||||
|
};
|
||||||
|
|
||||||
|
const colTypeToJustifyContentMap = {
|
||||||
|
center: 'center',
|
||||||
|
end: 'flex-end',
|
||||||
|
start: 'flex-start',
|
||||||
|
};
|
||||||
|
|
||||||
const DetailListHeader = memo(
|
const DetailListHeader = memo(
|
||||||
({
|
({
|
||||||
columnWidthPercents,
|
columnWidthPercents,
|
||||||
@@ -633,16 +645,17 @@ const DetailListHeader = memo(
|
|||||||
const percent = columnWidthPercents[colIndex] ?? 0;
|
const percent = columnWidthPercents[colIndex] ?? 0;
|
||||||
const { fixedWidth, isFixedColumn } = getTrackColumnFixed(col.id);
|
const { fixedWidth, isFixedColumn } = getTrackColumnFixed(col.id);
|
||||||
const isLastColumn = colIndex === trackColumns.length - 1;
|
const isLastColumn = colIndex === trackColumns.length - 1;
|
||||||
|
|
||||||
const style: React.CSSProperties = {
|
const style: React.CSSProperties = {
|
||||||
flex: isFixedColumn ? `0 0 ${fixedWidth}px` : `${percent} 1 0`,
|
flex: isFixedColumn ? `0 0 ${fixedWidth}px` : `${percent} 1 0`,
|
||||||
|
justifyContent: colTypeToJustifyContentMap[col.align],
|
||||||
minWidth: isFixedColumn ? fixedWidth : 0,
|
minWidth: isFixedColumn ? fixedWidth : 0,
|
||||||
textAlign:
|
textAlign: colTypeToAlignMap[col.align] as
|
||||||
col.align === 'start'
|
| 'center'
|
||||||
? 'left'
|
| 'left'
|
||||||
: col.align === 'end'
|
| 'right',
|
||||||
? 'right'
|
|
||||||
: 'center',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx(styles.trackHeaderCell, {
|
className={clsx(styles.trackHeaderCell, {
|
||||||
|
|||||||
Reference in New Issue
Block a user