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