Skip to content

Commit

Permalink
refactor: update end and both calc variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Manumartin95 committed Oct 6, 2023
1 parent a7eaadf commit 9acb32f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export const AbsenceItem: FC<Props> = ({ absence, userName, overflowType }) => {
// and subtracting the cell's padding to ensure it accounts for the same padding at the beginning and end.

if (overflowType === 'end') {
return `calc(${durationPlusLast * 100}% + ${durationPlusLast - 1}px - ${cellPadding})`
return `calc(${durationPlusLast * 100}% + ${duration}px - ${cellPadding})`
}

//The calc is based in total width plus 1px for each block present due to the margin each one has
if (overflowType === 'both') {
return `calc(${durationPlusLast * 100}% + ${durationPlusLast - 1}px)`
return `calc(${durationPlusLast * 100}% + ${duration}px)`
}

//The calculation is based on the duration of the absence plus an element to reach the end of the block, minus 1px for each block present due to the margin each one has, and subtracting the padding that we lose at the beginning.
Expand Down

0 comments on commit 9acb32f

Please sign in to comment.