Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Hide TotalHours when no billed hours
  • Loading branch information
Yadro committed Jun 25, 2021
commit c22ce14fb1de0affe4b07b96d7cd05d0c85e0764
10 changes: 9 additions & 1 deletion src/screens/hours/components/TotalHours/TotalHours.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ interface TotalHoursProps {
timeItems: TaskTimeItemModel[];
}

export default observer(function TotalHours({ timeItems }: TotalHoursProps) {
const TotalHours = observer((props: TotalHoursProps) => {
const { timeItems } = props;

const { durationMs, gapsMs } = TaskHooks.useTimeItemsDuration(timeItems);
const startWorkingTime = TaskHooks.useStartWorkingTime(timeItems);
const estimatedWorkingTimeEnd = estimateWorkingTimeEnd(
startWorkingTime,
gapsMs
);

if (!timeItems.length) {
return null;
}

return (
<Space>
<span>{getTime(startWorkingTime)}</span>
Expand All @@ -31,3 +37,5 @@ export default observer(function TotalHours({ timeItems }: TotalHoursProps) {
</Space>
);
});

export default TotalHours;