mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 10:13:01 +08:00
refactor(bases): rename KanbanColumn helper type to KanbanColumnData; clsx + font vars
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { IBaseProperty, IBaseRow } from "@/features/base/types/base.types";
|
||||
import classes from "@/features/base/styles/kanban.module.css";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import clsx from "clsx";
|
||||
|
||||
type KanbanCardProps = {
|
||||
row: IBaseRow;
|
||||
@@ -30,11 +31,7 @@ export function KanbanCard({ row, primaryProperty, onClick }: KanbanCardProps) {
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className={
|
||||
classes.cardTitle + (isEmpty ? " " + classes.cardTitleEmpty : "")
|
||||
}
|
||||
>
|
||||
<div className={clsx(classes.cardTitle, isEmpty && classes.cardTitleEmpty)}>
|
||||
{titleText}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KanbanColumn as KanbanColumnData } from "@/features/base/hooks/use-kanban-groups";
|
||||
import { KanbanColumnData } from "@/features/base/hooks/use-kanban-groups";
|
||||
import { IBaseProperty } from "@/features/base/types/base.types";
|
||||
import { KanbanCard } from "./kanban-card";
|
||||
import { KanbanColumnHeader } from "./kanban-column-header";
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
SelectTypeOptions,
|
||||
} from "@/features/base/types/base.types";
|
||||
|
||||
export type KanbanColumn = {
|
||||
export type KanbanColumnData = {
|
||||
key: string; // choice id or NO_VALUE_CHOICE_ID
|
||||
choiceId: string | null; // null for NO_VALUE column
|
||||
name: string;
|
||||
@@ -15,7 +15,7 @@ export type KanbanColumn = {
|
||||
};
|
||||
|
||||
export type PartitionResult = {
|
||||
columns: KanbanColumn[];
|
||||
columns: KanbanColumnData[];
|
||||
groupByPropertyId: string | null;
|
||||
};
|
||||
|
||||
@@ -87,7 +87,7 @@ export function partitionRowsByGroup(
|
||||
buckets.get(key)!.push(row);
|
||||
}
|
||||
|
||||
const columns: KanbanColumn[] = order.map((key) => {
|
||||
const columns: KanbanColumnData[] = order.map((key) => {
|
||||
if (key === NO_VALUE_CHOICE_ID) {
|
||||
return {
|
||||
key,
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
.columnCount {
|
||||
font-size: 12px;
|
||||
font-size: var(--mantine-font-size-xs);
|
||||
color: var(--mantine-color-dimmed);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
}
|
||||
|
||||
.cardTitle {
|
||||
font-size: 14px;
|
||||
font-size: var(--mantine-font-size-sm);
|
||||
line-height: 1.4;
|
||||
word-break: break-word;
|
||||
}
|
||||
@@ -84,6 +84,6 @@
|
||||
|
||||
.sortHint {
|
||||
padding: 6px 12px;
|
||||
font-size: 12px;
|
||||
font-size: var(--mantine-font-size-xs);
|
||||
color: var(--mantine-color-dimmed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user