Commit b935bbe
feat: replace colors from theme with semantics (#3494)
This pull request refactors several UI components to improve theme
consistency and maintainability. The main change is replacing inline
style definitions and direct color references with a `useStyles` hook
that leverages theme primitives and semantic values. This ensures a more
consistent look and feel across the app and simplifies style management.
**Theme and Style Refactoring**
* Replaced inline `StyleSheet.create` style definitions and direct color
references with a `useStyles` hook in multiple components
(`AITypingIndicatorView.tsx`, `AutoCompleteSuggestionHeader.tsx`,
`AutoCompleteSuggestionItem.tsx`, `Channel.tsx`,
`ChannelListHeaderErrorIndicator.tsx`,
`ChannelListHeaderNetworkDownIndicator.tsx`, and
`ChannelListMessenger.tsx`). The new hook uses theme primitives and
semantic values for colors, typography, and spacing, improving
consistency and maintainability.
[[1]](diffhunk://#diff-aeaea0f9815187563af3206aaa50ba5c56b6b7451dda0ef5a076d6c22b42c206L27-R63)
[[2]](diffhunk://#diff-14f7c5e1822d3e2c5cb9ccbc7640ee23f22c04a46ee68c503fe5f0524d421ed4R25)
[[3]](diffhunk://#diff-a4f2ceb110b81b30f42c543fc864dc3ffee1cedcd45eb92c434292d3fc82752dL220-R221)
[[4]](diffhunk://#diff-f7139f4cdb523365cfc277d72b827a3432325b9c6460cf14628f9df67d0e4d85R2168-R2188)
[[5]](diffhunk://#diff-000521785a651a6155bc977e73c05c1a65215f80f66ab8101e5a8aa1b60b3c19R27-R55)
[[6]](diffhunk://#diff-10acc569ea31efee66b73f4ded73d9c969dc185ba4583013a253ca40191dbdc1L1-R49)
[[7]](diffhunk://#diff-3e4a3e88d671a515eb1ccb29c38764f56daa521f3baa28f1dd0a6fc01e790c1fR36)
* Removed direct usage of color variables (e.g., `black`, `grey_dark`,
`white`) in favor of semantic theme values throughout the affected
components.
[[1]](diffhunk://#diff-a4f2ceb110b81b30f42c543fc864dc3ffee1cedcd45eb92c434292d3fc82752dL38-R37)
[[2]](diffhunk://#diff-a4f2ceb110b81b30f42c543fc864dc3ffee1cedcd45eb92c434292d3fc82752dL50)
[[3]](diffhunk://#diff-a4f2ceb110b81b30f42c543fc864dc3ffee1cedcd45eb92c434292d3fc82752dL62-R63)
[[4]](diffhunk://#diff-f7139f4cdb523365cfc277d72b827a3432325b9c6460cf14628f9df67d0e4d85L2083-R2075)
[[5]](diffhunk://#diff-000521785a651a6155bc977e73c05c1a65215f80f66ab8101e5a8aa1b60b3c19R27-R55)
[[6]](diffhunk://#diff-10acc569ea31efee66b73f4ded73d9c969dc185ba4583013a253ca40191dbdc1L1-R49)
**Component-Specific Improvements**
* Updated `AITypingIndicatorView`, `AutoCompleteSuggestionHeader`, and
`AutoCompleteSuggestionItem` to use theme-based spacing, font sizes,
font weights, and line heights, ensuring visual consistency.
[[1]](diffhunk://#diff-aeaea0f9815187563af3206aaa50ba5c56b6b7451dda0ef5a076d6c22b42c206L27-R63)
[[2]](diffhunk://#diff-14f7c5e1822d3e2c5cb9ccbc7640ee23f22c04a46ee68c503fe5f0524d421ed4R123-R127)
[[3]](diffhunk://#diff-a4f2ceb110b81b30f42c543fc864dc3ffee1cedcd45eb92c434292d3fc82752dL220-R221)
* Improved error and network status indicators
(`ChannelListHeaderErrorIndicator.tsx`,
`ChannelListHeaderNetworkDownIndicator.tsx`) with semantic background
and text colors, and theme-based padding and font styles.
[[1]](diffhunk://#diff-000521785a651a6155bc977e73c05c1a65215f80f66ab8101e5a8aa1b60b3c19R27-R55)
[[2]](diffhunk://#diff-10acc569ea31efee66b73f4ded73d9c969dc185ba4583013a253ca40191dbdc1L1-R49)
* Updated `Channel.tsx` and `ChannelListMessenger.tsx` to use theme
primitives for typography and spacing, and moved style logic into the
`useStyles` hook.
[[1]](diffhunk://#diff-f7139f4cdb523365cfc277d72b827a3432325b9c6460cf14628f9df67d0e4d85R2168-R2188)
[[2]](diffhunk://#diff-3e4a3e88d671a515eb1ccb29c38764f56daa521f3baa28f1dd0a6fc01e790c1fL93-R95)
**General Code Cleanup**
* Removed redundant imports and style definitions, replacing them with
memoized hooks for improved performance and readability.
[[1]](diffhunk://#diff-aeaea0f9815187563af3206aaa50ba5c56b6b7451dda0ef5a076d6c22b42c206L1-R1)
[[2]](diffhunk://#diff-14f7c5e1822d3e2c5cb9ccbc7640ee23f22c04a46ee68c503fe5f0524d421ed4L1-R1)
[[3]](diffhunk://#diff-3e4a3e88d671a515eb1ccb29c38764f56daa521f3baa28f1dd0a6fc01e790c1fL1-R1)
**Minor Theming Adjustments**
* Fixed header text color in Giphy attachment to use semantic outgoing
chat text.
These changes collectively make the UI more robust and easier to
maintain by centralizing style management and improving theme
integration across components.
---------
Co-authored-by: Ivan Sekovanikj <ivan.sekovanikj@getstream.io>1 parent 8b55d62 commit b935bbe
File tree
35 files changed
+573
-554
lines changed- package/src
- components
- AITypingIndicatorView
- Attachment/Giphy
- AutoCompleteInput
- ChannelList
- Channel
- ImageGallery
- components
- Indicators
- MessageInput
- components/AudioRecorder
- MessageList
- __tests__/__snapshots__
- MessageMenu
- Message
- MessageSimple
- __tests__/__snapshots__
- utils
- Thread/__tests__/__snapshots__
- UIComponents
- ui/Badge
- contexts/themeContext/utils
35 files changed
+573
-554
lines changedLines changed: 30 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 28 | + | |
33 | 29 | | |
34 | 30 | | |
35 | | - | |
36 | | - | |
| 31 | + | |
| 32 | + | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| |||
Lines changed: 27 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | | - | |
53 | | - | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| |||
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
62 | | - | |
| 60 | + | |
63 | 61 | | |
64 | 62 | | |
65 | | - | |
| 63 | + | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
| |||
217 | 215 | | |
218 | 216 | | |
219 | 217 | | |
220 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | 236 | | |
240 | 237 | | |
241 | 238 | | |
| |||
794 | 791 | | |
795 | 792 | | |
796 | 793 | | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
| 794 | + | |
803 | 795 | | |
804 | 796 | | |
805 | 797 | | |
| |||
2080 | 2072 | | |
2081 | 2073 | | |
2082 | 2074 | | |
2083 | | - | |
| 2075 | + | |
2084 | 2076 | | |
2085 | 2077 | | |
2086 | 2078 | | |
| |||
2173 | 2165 | | |
2174 | 2166 | | |
2175 | 2167 | | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
Lines changed: 34 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 6 | + | |
19 | 7 | | |
20 | 8 | | |
21 | 9 | | |
22 | 10 | | |
23 | 11 | | |
24 | 12 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 13 | + | |
31 | 14 | | |
32 | 15 | | |
33 | 16 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 17 | + | |
| 18 | + | |
39 | 19 | | |
40 | 20 | | |
41 | 21 | | |
| |||
44 | 24 | | |
45 | 25 | | |
46 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments