Skip to content

Commit

Permalink
Remove else if on position calculation (#5691)
Browse files Browse the repository at this point in the history
As title

fix
  • Loading branch information
thomtrp authored and Weiko committed May 31, 2024
1 parent d9f7b18 commit 1766eb5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ const StyledMainContainer = styled.div`
height: 100%;
justify-content: center;
padding: ${({ theme }) =>
theme.spacing(6) +
' ' +
theme.spacing(6) +
' ' +
theme.spacing(16) +
' ' +
theme.spacing(6)};
padding-top: ${({ theme }) => theme.spacing(6)};
padding-right: ${({ theme }) => theme.spacing(6)};
padding-bottom: ${({ theme }) => theme.spacing(16)};
padding-left: ${({ theme }) => theme.spacing(6)};
gap: ${({ theme }) => theme.spacing(4)};
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ export const getDraggedRecordPosition = (
): number => {
if (isDefined(recordAfterPosition) && isDefined(recordBeforePosition)) {
return (recordBeforePosition + recordAfterPosition) / 2;
} else if (isDefined(recordAfterPosition)) {
}

if (isDefined(recordAfterPosition)) {
return recordAfterPosition - 1;
} else if (isDefined(recordBeforePosition)) {
}

if (isDefined(recordBeforePosition)) {
return recordBeforePosition + 1;
} else {
return 1;
}

return 1;
};
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const ShowPageRightContainer = ({
const shouldDisplayLogTab = useIsFeatureEnabled('IS_EVENT_OBJECT_ENABLED');
const shouldDisplayEmailsTab = emails && isCompanyOrPerson;

const TAB_LIST = [
const tabs = [
{
id: 'timeline',
title: 'Timeline',
Expand Down Expand Up @@ -131,7 +131,7 @@ export const ShowPageRightContainer = ({
case 'calendar':
return <Calendar targetableObject={targetableObject} />;
default:
return null;
return <></>;
}
};

Expand All @@ -141,7 +141,7 @@ export const ShowPageRightContainer = ({
<TabList
loading={loading}
tabListId={TAB_LIST_COMPONENT_ID}
tabs={TAB_LIST}
tabs={tabs}
/>
</StyledTabListContainer>
{renderActiveTabContent()}
Expand Down

0 comments on commit 1766eb5

Please sign in to comment.