@@ -10,10 +10,23 @@ import { TimelineActivity } from '@/activities/timelineActivities/types/Timeline
10
10
import { getTimelineActivityAuthorFullName } from '@/activities/timelineActivities/utils/getTimelineActivityAuthorFullName' ;
11
11
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState' ;
12
12
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem' ;
13
- import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile' ;
14
13
import { beautifyPastDateRelativeToNow } from '~/utils/date-utils' ;
15
14
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull' ;
16
15
16
+ const StyledTimelineItemContainer = styled . div `
17
+ display: flex;
18
+ gap: ${ ( { theme } ) => theme . spacing ( 4 ) } ;
19
+ height: 'auto';
20
+ justify-content: space-between;
21
+ overflow: hidden;
22
+ white-space: nowrap;
23
+ ` ;
24
+
25
+ const StyledLeftContainer = styled . div `
26
+ display: flex;
27
+ flex-direction: column;
28
+ ` ;
29
+
17
30
const StyledIconContainer = styled . div `
18
31
display: flex;
19
32
align-items: center;
@@ -25,62 +38,50 @@ const StyledIconContainer = styled.div`
25
38
user-select: none;
26
39
text-decoration-line: underline;
27
40
z-index: 2;
28
- align-self: normal;
29
- ` ;
30
-
31
- const StyledItemContainer = styled . div `
32
- display: flex;
33
- align-items: center;
34
- gap: ${ ( { theme } ) => theme . spacing ( 1 ) } ;
35
- flex: 1;
36
- overflow: hidden;
37
- ` ;
38
-
39
- const StyledItemTitleDate = styled . div `
40
- align-items: center;
41
- color: ${ ( { theme } ) => theme . font . color . tertiary } ;
42
- display: flex;
43
- gap: ${ ( { theme } ) => theme . spacing ( 2 ) } ;
44
- justify-content: flex-end;
45
- margin-left: auto;
46
- align-self: baseline;
47
41
` ;
48
42
49
43
const StyledVerticalLineContainer = styled . div `
50
- align-items: center;
51
- align-self: stretch;
52
44
display: flex;
53
- gap: ${ ( { theme } ) => theme . spacing ( 2 ) } ;
45
+ flex-shrink: 0 ;
54
46
justify-content: center;
55
- width: 26px;
56
47
z-index: 2;
48
+ height: 100%;
57
49
` ;
58
50
59
51
const StyledVerticalLine = styled . div `
60
- align-self: stretch;
61
52
background: ${ ( { theme } ) => theme . border . color . light } ;
62
- flex-shrink: 0;
63
53
width: 2px;
54
+ height: 100%;
64
55
` ;
65
56
66
- const StyledTimelineItemContainer = styled . div < { isGap ?: boolean } > `
67
- display: flex;
57
+ const StyledSummary = styled . summary `
68
58
align-items: center;
69
- justify-content: space-between;
70
- gap: ${ ( { theme } ) => theme . spacing ( 4 ) } ;
71
- height: ${ ( { isGap, theme } ) =>
72
- isGap ? ( useIsMobile ( ) ? theme . spacing ( 6 ) : theme . spacing ( 3 ) ) : 'auto' } ;
73
- overflow: hidden;
74
- white-space: nowrap;
59
+ display: flex;
60
+ flex: 1;
61
+ flex-direction: row;
62
+ gap: ${ ( { theme } ) => theme . spacing ( 1 ) } ;
75
63
` ;
76
64
77
- const StyledSummary = styled . summary `
65
+ const StyledItemContainer = styled . div < { isMarginBottom ?: boolean } > `
66
+ align-items: flex-start;
78
67
display: flex;
79
68
flex: 1;
80
- flex-direction: row ;
69
+ flex-direction: column ;
81
70
gap: ${ ( { theme } ) => theme . spacing ( 1 ) } ;
82
- align-items: center;
83
71
overflow: hidden;
72
+ margin-bottom: ${ ( { isMarginBottom, theme } ) =>
73
+ isMarginBottom ? theme . spacing ( 3 ) : 0 } ;
74
+ min-height: 26px;
75
+ ` ;
76
+
77
+ const StyledItemTitleDate = styled . div `
78
+ align-items: flex-start;
79
+ padding-top: ${ ( { theme } ) => theme . spacing ( 1 ) } ;
80
+ color: ${ ( { theme } ) => theme . font . color . tertiary } ;
81
+ display: flex;
82
+ gap: ${ ( { theme } ) => theme . spacing ( 1 ) } ;
83
+ justify-content: flex-end;
84
+ margin-left: auto;
84
85
` ;
85
86
86
87
type EventRowProps = {
@@ -118,13 +119,20 @@ export const EventRow = ({
118
119
return (
119
120
< >
120
121
< StyledTimelineItemContainer >
121
- < StyledIconContainer >
122
- < EventIconDynamicComponent
123
- event = { event }
124
- linkedObjectMetadataItem = { linkedObjectMetadataItem }
125
- />
126
- </ StyledIconContainer >
127
- < StyledItemContainer >
122
+ < StyledLeftContainer >
123
+ < StyledIconContainer >
124
+ < EventIconDynamicComponent
125
+ event = { event }
126
+ linkedObjectMetadataItem = { linkedObjectMetadataItem }
127
+ />
128
+ </ StyledIconContainer >
129
+ { ! isLastEvent && (
130
+ < StyledVerticalLineContainer >
131
+ < StyledVerticalLine />
132
+ </ StyledVerticalLineContainer >
133
+ ) }
134
+ </ StyledLeftContainer >
135
+ < StyledItemContainer isMarginBottom = { ! isLastEvent } >
128
136
< StyledSummary >
129
137
< EventRowDynamicComponent
130
138
authorFullName = { authorFullName }
@@ -134,18 +142,11 @@ export const EventRow = ({
134
142
linkedObjectMetadataItem = { linkedObjectMetadataItem }
135
143
/>
136
144
</ StyledSummary >
137
- < StyledItemTitleDate id = { `id-${ event . id } ` } >
138
- { beautifiedCreatedAt }
139
- </ StyledItemTitleDate >
140
145
</ StyledItemContainer >
146
+ < StyledItemTitleDate id = { `id-${ event . id } ` } >
147
+ { beautifiedCreatedAt }
148
+ </ StyledItemTitleDate >
141
149
</ StyledTimelineItemContainer >
142
- { ! isLastEvent && (
143
- < StyledTimelineItemContainer isGap >
144
- < StyledVerticalLineContainer >
145
- < StyledVerticalLine />
146
- </ StyledVerticalLineContainer >
147
- </ StyledTimelineItemContainer >
148
- ) }
149
150
</ >
150
151
) ;
151
152
} ;
0 commit comments