Commit 2a51aa3
authored
fix: spacing between message in MessageList (#3429)
This pull request introduces several improvements and refactors to the
message components, focusing on simplifying message grouping styles,
cleaning up the `MessageFooter` logic, and updating the pinned message
header. The changes enhance maintainability, improve style handling, and
remove unnecessary complexity from the codebase.
**Message Grouping and Styling Refactor:**
* Refactored `MessageSimple` component to use a new `useStyles` hook for
dynamic style calculation based on message grouping and alignment,
replacing static style objects and simplifying style logic.
[[1]](diffhunk://#diff-6c4943fcf0d32148b663091935ac039195d602cef7654b16bb93514ca2b3ba83L22-R158)
[[2]](diffhunk://#diff-6c4943fcf0d32148b663091935ac039195d602cef7654b16bb93514ca2b3ba83L126-R239)
[[3]](diffhunk://#diff-6c4943fcf0d32148b663091935ac039195d602cef7654b16bb93514ca2b3ba83R249-R264)
* Removed unused style properties and consolidated style handling in
`MessageSimple`, eliminating redundant container and grouping styles.
**Message Footer Logic Simplification:**
* Removed the `OnlyVisibleToYouComponent` and related props
(`otherAttachments`, `deletedMessagesVisibilityType`, `isDeleted`) from
`MessageFooter`, streamlining its logic and prop interface.
[[1]](diffhunk://#diff-e83a4be8d03b1ae25525ce8d7eb287d33a5ad7eb49a63c2aa31de3c6d86b5ff1L21-L91)
[[2]](diffhunk://#diff-e83a4be8d03b1ae25525ce8d7eb287d33a5ad7eb49a63c2aa31de3c6d86b5ff1L110-L120)
[[3]](diffhunk://#diff-e83a4be8d03b1ae25525ce8d7eb287d33a5ad7eb49a63c2aa31de3c6d86b5ff1L129-L131)
[[4]](diffhunk://#diff-e83a4be8d03b1ae25525ce8d7eb287d33a5ad7eb49a63c2aa31de3c6d86b5ff1L152)
[[5]](diffhunk://#diff-e83a4be8d03b1ae25525ce8d7eb287d33a5ad7eb49a63c2aa31de3c6d86b5ff1L162)
[[6]](diffhunk://#diff-e83a4be8d03b1ae25525ce8d7eb287d33a5ad7eb49a63c2aa31de3c6d86b5ff1L181-L186)
[[7]](diffhunk://#diff-e83a4be8d03b1ae25525ce8d7eb287d33a5ad7eb49a63c2aa31de3c6d86b5ff1L201-L207)
[[8]](diffhunk://#diff-e83a4be8d03b1ae25525ce8d7eb287d33a5ad7eb49a63c2aa31de3c6d86b5ff1L242-L265)
* Updated `MessageDeleted` to no longer pass the `isDeleted` prop to
`MessageFooter`, reflecting the simplified footer logic.
**Pinned Message Header Updates:**
* Renamed and moved `MessagePinnedHeader` to a new directory, updated
icon size, and adjusted font weight for improved appearance and code
organization.
[[1]](diffhunk://#diff-c42cee148dd3f2dba08dc7b7acc9507cf41a2f073d955c45c37c7683f18d0fb2L4-R12)
[[2]](diffhunk://#diff-c42cee148dd3f2dba08dc7b7acc9507cf41a2f073d955c45c37c7683f18d0fb2L33-R33)
[[3]](diffhunk://#diff-c42cee148dd3f2dba08dc7b7acc9507cf41a2f073d955c45c37c7683f18d0fb2L64-R64)
* Fixed import paths for `MessagePinnedHeader` in `Channel.tsx`.
[[1]](diffhunk://#diff-f7139f4cdb523365cfc277d72b827a3432325b9c6460cf14628f9df67d0e4d85R143)
[[2]](diffhunk://#diff-f7139f4cdb523365cfc277d72b827a3432325b9c6460cf14628f9df67d0e4d85L151)
**Equality Checks Optimization:**
* Simplified equality checks for `groupStyles` in both `Message` and
`MessageContent` components, improving performance and reducing
unnecessary renders.
[[1]](diffhunk://#diff-4234b2ddfee0f9e29e7b465026e851cf75f5d16f03a175c86374168589335d8eL972-R972)
[[2]](diffhunk://#diff-2a29e74fd66f9ef94ef76086ce6594fde5dee0f20f1532c7a3b5667fc5cf46aaL426-R426)
**Minor UI Adjustments:**
* Adjusted padding and map view size in `MessageLocation` for better
visual consistency.
* Removed top margin from message wrapper in `MessageWithContext` for
improved layout.1 parent 5c473d3 commit 2a51aa3
20 files changed
Lines changed: 313 additions & 290 deletions
File tree
- examples/SampleApp/src/components/LocationSharing
- package/src
- components
- Channel
- MessageList
- __tests__
- utils
- Message
- MessageSimple
- Headers
- __tests__
- hooks
- Thread/__tests__/__snapshots__
- contexts
- messagesContext
- themeContext/utils
- icons
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 163 | + | |
166 | 164 | | |
167 | | - | |
168 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
169 | 168 | | |
170 | 169 | | |
171 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
824 | | - | |
| 824 | + | |
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
972 | | - | |
973 | | - | |
| 972 | + | |
974 | 973 | | |
975 | 974 | | |
976 | 975 | | |
| |||
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | | - | |
428 | | - | |
| 426 | + | |
429 | 427 | | |
430 | 428 | | |
431 | 429 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
Lines changed: 4 additions & 82 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
37 | | - | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 39 | + | |
46 | 40 | | |
47 | 41 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 42 | | |
79 | 43 | | |
80 | 44 | | |
81 | 45 | | |
82 | | - | |
83 | 46 | | |
84 | | - | |
85 | 47 | | |
86 | 48 | | |
87 | 49 | | |
88 | 50 | | |
89 | 51 | | |
90 | | - | |
91 | | - | |
92 | 52 | | |
93 | 53 | | |
94 | 54 | | |
| |||
107 | 67 | | |
108 | 68 | | |
109 | 69 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 70 | | |
122 | 71 | | |
123 | 72 | | |
| |||
126 | 75 | | |
127 | 76 | | |
128 | 77 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 78 | | |
133 | 79 | | |
134 | 80 | | |
| |||
149 | 95 | | |
150 | 96 | | |
151 | 97 | | |
152 | | - | |
153 | 98 | | |
154 | 99 | | |
155 | 100 | | |
| |||
159 | 104 | | |
160 | 105 | | |
161 | 106 | | |
162 | | - | |
163 | 107 | | |
164 | 108 | | |
165 | 109 | | |
| |||
178 | 122 | | |
179 | 123 | | |
180 | 124 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | 125 | | |
188 | 126 | | |
189 | 127 | | |
| |||
198 | 136 | | |
199 | 137 | | |
200 | 138 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | 139 | | |
209 | 140 | | |
210 | 141 | | |
| |||
239 | 170 | | |
240 | 171 | | |
241 | 172 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 173 | + | |
| 174 | + | |
251 | 175 | | |
252 | | - | |
| 176 | + | |
253 | 177 | | |
254 | 178 | | |
255 | 179 | | |
256 | 180 | | |
257 | 181 | | |
258 | | - | |
259 | 182 | | |
260 | 183 | | |
261 | 184 | | |
262 | 185 | | |
263 | 186 | | |
264 | 187 | | |
265 | | - | |
266 | 188 | | |
267 | 189 | | |
268 | 190 | | |
| |||
0 commit comments