Skip to content

Commit b167766

Browse files
committed
feat(time-table): Increase lock button size
1 parent 887b8b2 commit b167766

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

src/components/ui/icon-button/icon-button.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface IconButtonProps
2929
look?: Exclude<ButtonProps["look"], "link">
3030
titleSide?: TitleTooltipProps["side"]
3131
hideTitle?: boolean
32+
iconSize?: IconProps["size"]
3233
}
3334

3435
export const IconButton = ({
@@ -42,6 +43,7 @@ export const IconButton = ({
4243
hideTitle,
4344
titleSide,
4445
iconColor = "current",
46+
iconSize = size,
4547
...delegated
4648
}: IconButtonProps) => (
4749
<TitleTooltip title={hideTitle ? undefined : title} side={titleSide} asChild>
@@ -52,7 +54,7 @@ export const IconButton = ({
5254
{...delegated}
5355
>
5456
<VisuallyHidden>{title}</VisuallyHidden>
55-
<Icon icon={icon} size={size} color={iconColor} filled={filled} />
57+
<Icon icon={icon} size={iconSize} color={iconColor} filled={filled} />
5658
</Button>
5759
</TitleTooltip>
5860
)

src/features/time-table/time-table-header.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const DateDurations = ({ entries }: { entries: TimeEntry[] }) => {
6969
<Tooltip.Trigger asChild>
7070
<button className="rounded-md">{totalDuration}</button>
7171
</Tooltip.Trigger>
72-
<Tooltip.Content align="end" asChild>
72+
<Tooltip.Content align="end" side="bottom" asChild>
7373
<div className={cn(vstack({ justify: "end" }), "text-sm")}>
7474
{totalTimeByProject.map(({ duration, projectId }) => (
7575
<span
@@ -112,17 +112,20 @@ export const TimeTableHeader = ({
112112
}}
113113
className={cn(
114114
hstack({ align: "center" }),
115-
"h-10 rounded-t-lg border-b border-stroke-gentle bg-background-page",
115+
"h-11 rounded-t-lg border-b border-stroke-gentle bg-background-page",
116116
"sticky top-18 z-20",
117117
!isIntersecting && "rounded-lg"
118118
)}
119119
>
120120
<h2 className="mr-2 pl-4 text-base">{formatDate(date)}</h2>
121121
<IconButton
122122
icon={isEditable ? Unlock : Lock}
123-
title="Toggle editability"
123+
title={
124+
isEditable ? "Switch to summary mode" : "Switch to editable mode"
125+
}
126+
titleSide="right"
124127
iconColor="muted"
125-
size="sm"
128+
iconSize="sm"
126129
onClick={() => editableDatesData.actions.toggle(date)}
127130
/>
128131
<div className="flex-1" />

src/features/time-table/time-table-summary.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const summarize = (entries: TimeEntry[]): EntrySummary[] => {
5050
}
5151

5252
const SummaryBlock = ({ description, projectId, minutes }: EntrySummary) => (
53-
<div className={cn(surface({ look: "card", size: "md" }), vstack({}), "m-2")}>
53+
<div className={cn(surface({ look: "card", size: "md" }), vstack({}))}>
5454
<div className={cn("line-clamp-2", !description && "text-text-muted")}>
5555
{description || "No description"}
5656
</div>
@@ -69,8 +69,8 @@ export const TimeTableSummary = ({ entries }: { entries: TimeEntry[] }) => {
6969
const summary = useMemo(() => summarize(entries), [entries])
7070

7171
return (
72-
<div className="@container">
73-
<div className="grid grid-cols-1 @xl:grid-cols-2 @3xl:grid-cols-3">
72+
<div className="@container m-2">
73+
<div className="grid grid-cols-1 gap-4 @xl:grid-cols-2 @3xl:grid-cols-3">
7474
{summary.map(entry => (
7575
<SummaryBlock key={entry.projectId + entry.description} {...entry} />
7676
))}

0 commit comments

Comments
 (0)