The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix verticale line timeline activity (#5894)
Thomas Trompettedba0b28eae90
diff --git a/packages/twenty-front/src/modules/activities/timelineActivities/components/EventRow.tsx b/packages/twenty-front/src/modules/activities/timelineActivities/components/EventRow.tsxindex b1072ee5790..050b5c1b320 100644--- a/packages/twenty-front/src/modules/activities/timelineActivities/components/EventRow.tsx+++ b/packages/twenty-front/src/modules/activities/timelineActivities/components/EventRow.tsx@@ -10,10 +10,23 @@ import { TimelineActivity } from '@/activities/timelineActivities/types/Timelineimport { getTimelineActivityAuthorFullName } from '@/activities/timelineActivities/utils/getTimelineActivityAuthorFullName';import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';-import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';import { beautifyPastDateRelativeToNow } from '~/utils/date-utils';import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';+const StyledTimelineItemContainer = styled.div`+ display: flex;+ gap: ${({ theme }) => theme.spacing(4)};+ height: 'auto';+ justify-content: space-between;+ overflow: hidden;+ white-space: nowrap;+`;++const StyledLeftContainer = styled.div`+ display: flex;+ flex-direction: column;+`;+const StyledIconContainer = styled.div`display: flex;align-items: center;@@ -25,62 +38,50 @@ const StyledIconContainer = styled.div`user-select: none;text-decoration-line: underline;z-index: 2;- align-self: normal;-`;--const StyledItemContainer = styled.div`- display: flex;- align-items: center;- gap: ${({ theme }) => theme.spacing(1)};- flex: 1;- overflow: hidden;-`;--const StyledItemTitleDate = styled.div`- align-items: center;- color: ${({ theme }) => theme.font.color.tertiary};- display: flex;- gap: ${({ theme }) => theme.spacing(2)};- justify-content: flex-end;- margin-left: auto;- align-self: baseline;`;const StyledVerticalLineContainer = styled.div`- align-items: center;- align-self: stretch;display: flex;- gap: ${({ theme }) => theme.spacing(2)};+ flex-shrink: 0;justify-content: center;- width: 26px;z-index: 2;+ height: 100%;`;const StyledVerticalLine = styled.div`- align-self: stretch;background: ${({ theme }) => theme.border.color.light};- flex-shrink: 0;width: 2px;+ height: 100%;`;-const StyledTimelineItemContainer = styled.div<{ isGap?: boolean }>`- display: flex;+const StyledSummary = styled.summary`align-items: center;- justify-content: space-between;- gap: ${({ theme }) => theme.spacing(4)};- height: ${({ isGap, theme }) =>- isGap ? (useIsMobile() ? theme.spacing(6) : theme.spacing(3)) : 'auto'};- overflow: hidden;- white-space: nowrap;+ display: flex;+ flex: 1;+ flex-direction: row;+ gap: ${({ theme }) => theme.spacing(1)};`;-const StyledSummary = styled.summary`+const StyledItemContainer = styled.div<{ isMarginBottom?: boolean }>`+ align-items: flex-start;display: flex;flex: 1;- flex-direction: row;+ flex-direction: column;gap: ${({ theme }) => theme.spacing(1)};- align-items: center;overflow: hidden;+ margin-bottom: ${({ isMarginBottom, theme }) =>+ isMarginBottom ? theme.spacing(3) : 0};+ min-height: 26px;+`;++const StyledItemTitleDate = styled.div`+ align-items: flex-start;+ padding-top: ${({ theme }) => theme.spacing(1)};+ color: ${({ theme }) => theme.font.color.tertiary};+ display: flex;+ gap: ${({ theme }) => theme.spacing(1)};+ justify-content: flex-end;+ margin-left: auto;`;type EventRowProps = {@@ -118,13 +119,20 @@ export const EventRow = ({return (<><StyledTimelineItemContainer>- <StyledIconContainer>- <EventIconDynamicComponent- event={event}- linkedObjectMetadataItem={linkedObjectMetadataItem}- />- </StyledIconContainer>- <StyledItemContainer>+ <StyledLeftContainer>+ <StyledIconContainer>+ <EventIconDynamicComponent+ event={event}+ linkedObjectMetadataItem={linkedObjectMetadataItem}+ />+ </StyledIconContainer>+ {!isLastEvent && (+ <StyledVerticalLineContainer>+ <StyledVerticalLine />+ </StyledVerticalLineContainer>+ )}+ </StyledLeftContainer>+ <StyledItemContainer isMarginBottom={!isLastEvent}><StyledSummary><EventRowDynamicComponentauthorFullName={authorFullName}@@ -134,18 +142,11 @@ export const EventRow = ({linkedObjectMetadataItem={linkedObjectMetadataItem}/></StyledSummary>- <StyledItemTitleDate id={`id-${event.id}`}>- {beautifiedCreatedAt}- </StyledItemTitleDate></StyledItemContainer>+ <StyledItemTitleDate id={`id-${event.id}`}>+ {beautifiedCreatedAt}+ </StyledItemTitleDate></StyledTimelineItemContainer>- {!isLastEvent && (- <StyledTimelineItemContainer isGap>- <StyledVerticalLineContainer>- <StyledVerticalLine />- </StyledVerticalLineContainer>- </StyledTimelineItemContainer>- )}</>);};diff --git a/packages/twenty-front/src/modules/activities/timelineActivities/rows/components/EventCard.tsx b/packages/twenty-front/src/modules/activities/timelineActivities/rows/components/EventCard.tsxindex baed69eb738..67e4f78cd72 100644--- a/packages/twenty-front/src/modules/activities/timelineActivities/rows/components/EventCard.tsx+++ b/packages/twenty-front/src/modules/activities/timelineActivities/rows/components/EventCard.tsx@@ -15,7 +15,7 @@ const StyledCardContainer = styled.div`gap: ${({ theme }) => theme.spacing(2)};width: 400px;padding: ${({ theme }) => theme.spacing(2)} 0px- ${({ theme }) => theme.spacing(4)} 0px;+ ${({ theme }) => theme.spacing(1)} 0px;`;const StyledCard = styled(Card)`