diff --git a/lib/experimental/Widgets/Content/ClockIn/ClockInControls/index.stories.tsx b/lib/experimental/Widgets/Content/ClockIn/ClockInControls/index.stories.tsx index 021052c0d..5b0536783 100644 --- a/lib/experimental/Widgets/Content/ClockIn/ClockInControls/index.stories.tsx +++ b/lib/experimental/Widgets/Content/ClockIn/ClockInControls/index.stories.tsx @@ -126,6 +126,14 @@ export const Collapsed: Story = { export const WithNoLocationOrProject: Story = { args: { + remainingMinutes: 4 * 60 + 39, + data: [ + { + from: new Date("2024-03-20T09:02:00"), + to: new Date("2024-03-20T12:23:00"), + variant: "clocked-in", + }, + ], locationId: undefined, }, } diff --git a/lib/experimental/Widgets/Content/ClockIn/ClockInControls/index.tsx b/lib/experimental/Widgets/Content/ClockIn/ClockInControls/index.tsx index 16607268f..7eb0c90c1 100644 --- a/lib/experimental/Widgets/Content/ClockIn/ClockInControls/index.tsx +++ b/lib/experimental/Widgets/Content/ClockIn/ClockInControls/index.tsx @@ -44,6 +44,8 @@ export interface ClockInControlsProps { onClockOut?: () => void /** Callback when Break button is clicked */ onBreak?: () => void + canShowProject?: boolean + projectSelectorElement?: React.ReactNode } export function ClockInControls({ @@ -60,6 +62,8 @@ export function ClockInControls({ canShowBreakButton = true, // onClickProjectSelector, onChangeLocationId, + canShowProject = true, + projectSelectorElement, }: ClockInControlsProps) { const { status, statusText, subtitle, statusColor } = getInfo({ data, @@ -180,28 +184,34 @@ export function ClockInControls({
{canSelectLocation ? ( - + <> + + {canShowProject && projectSelectorElement} + ) : ( - canShowLocation && ( - <> - - - ) + <> + {canShowLocation && location && ( + <> + + + )} + {canShowProject && projectSelectorElement} + )}