Skip to content

Commit c812575

Browse files
committed
feat: Pass category color to TaskMetaInfo for enhanced styling
1 parent b121830 commit c812575

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

ui/src/components/task/EndTimeField.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ export const EndTimeField = ({
113113
}
114114
}}
115115
>
116-
<span style={{ color: isDisabled ? "#9ca3af" : categoryColor }}>終了: </span>
116+
<span style={{ color: isDisabled ? "#9ca3af" : categoryColor }}>
117+
終了:{" "}
118+
</span>
117119
<span style={{ color: isDisabled ? "#9ca3af" : categoryColor }}>
118120
{formatDateTime(fieldValue) || `(クリックして設定)`}
119121
</span>

ui/src/components/task/SortableTask.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ const SortableTask = ({
126126
};
127127

128128
// カテゴリの色を取得
129-
const selectedCategory = categories.find((cat) => cat.id === task.category_id);
129+
const selectedCategory = categories.find(
130+
(cat) => cat.id === task.category_id,
131+
);
130132
const categoryColor = selectedCategory?.color || "#6b7280";
131133

132134
const taskEditProps = {
@@ -156,10 +158,7 @@ const SortableTask = ({
156158
>
157159
<div className="flex items-center gap-4">
158160
<div className="cursor-grab active:cursor-grabbing">
159-
<GripVertical
160-
className="h-4 w-4"
161-
style={{ color: categoryColor }}
162-
/>
161+
<GripVertical className="h-4 w-4" style={{ color: categoryColor }} />
163162
</div>
164163

165164
<TaskTimerButton
@@ -172,7 +171,10 @@ const SortableTask = ({
172171
<TaskTitleField {...taskEditProps} categoryColor={categoryColor} />
173172

174173
<div className="flex gap-3 text-sm text-muted-foreground">
175-
<TaskEstimatedTimeField {...taskEditProps} categoryColor={categoryColor} />
174+
<TaskEstimatedTimeField
175+
{...taskEditProps}
176+
categoryColor={categoryColor}
177+
/>
176178

177179
<StartTimeField
178180
{...taskEditProps}

ui/src/components/task/TaskEstimatedTimeField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const TaskEstimatedTimeField = ({
121121
)
122122
}
123123
>
124-
<span style={{ color: categoryColor }}>見積もり:{" "}</span>
124+
<span style={{ color: categoryColor }}>見積もり: </span>
125125
<span style={{ color: categoryColor }}>
126126
{formatEstimatedTime(task.estimated_minute) || "0分 (クリックして設定)"}
127127
</span>

ui/src/components/task/TaskMetaInfo.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ interface TaskMetaInfoProps {
55
categoryColor?: string;
66
}
77

8-
export const TaskMetaInfo = ({ task, categoryColor = "#6b7280" }: TaskMetaInfoProps) => {
8+
export const TaskMetaInfo = ({
9+
task,
10+
categoryColor = "#6b7280",
11+
}: TaskMetaInfoProps) => {
912
// 所要時間を計算(分単位)
1013
const calculateDuration = (
1114
start: string | null,
@@ -32,7 +35,7 @@ export const TaskMetaInfo = ({ task, categoryColor = "#6b7280" }: TaskMetaInfoPr
3235

3336
return (
3437
<p className="text-sm p-1">
35-
<span style={{ color: categoryColor }}>所要時間:{" "}</span>
38+
<span style={{ color: categoryColor }}>所要時間: </span>
3639
<span style={{ color: categoryColor }}>
3740
{formatDuration(calculateDuration(task.start_time, task.end_time))}
3841
</span>

ui/src/components/task/TaskTimerButton.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export const TaskTimerButton = ({
2020
variant="outline"
2121
onClick={() => onTaskTimer(task.id, "start")}
2222
className="h-8 w-8 hover:bg-opacity-10"
23-
style={{
23+
style={{
2424
color: categoryColor,
2525
borderColor: categoryColor,
26-
backgroundColor: `${categoryColor}10`
26+
backgroundColor: `${categoryColor}10`,
2727
}}
2828
>
2929
<Play className="h-4 w-4" />
@@ -38,10 +38,10 @@ export const TaskTimerButton = ({
3838
variant="outline"
3939
onClick={() => onTaskTimer(task.id, "stop")}
4040
className="h-8 w-8 hover:bg-opacity-10"
41-
style={{
41+
style={{
4242
color: categoryColor,
4343
borderColor: categoryColor,
44-
backgroundColor: `${categoryColor}10`
44+
backgroundColor: `${categoryColor}10`,
4545
}}
4646
>
4747
<Square className="h-4 w-4" />
@@ -54,10 +54,10 @@ export const TaskTimerButton = ({
5454
size="icon"
5555
variant="outline"
5656
className="h-8 w-8"
57-
style={{
57+
style={{
5858
color: categoryColor,
5959
borderColor: categoryColor,
60-
backgroundColor: `${categoryColor}20`
60+
backgroundColor: `${categoryColor}20`,
6161
}}
6262
disabled
6363
>

0 commit comments

Comments
 (0)