Commit fca8393
committed
feat(ui): implement repository sharing functionality
This commit introduces a sharing feature to repository cards, allowing users to share repository links directly from the home and search screens. It also integrates snackbar notifications to provide feedback on sharing actions.
- **feat(ui)**: Added a share button to `RepositoryCard` with a new `onShareClick` callback.
- **feat(home)**: Integrated `ShareManager` into `HomeViewModel` and added `OnShareClick` action to handle repository link generation and sharing.
- **feat(search)**: Integrated `ShareManager` into `SearchViewModel` and added `OnShareClick` action to handle repository link generation and sharing.
- **feat(presentation)**: Added `SnackbarHost` to `HomeScreen` and `SearchScreen` to display success/error messages during sharing.
- **feat(presentation)**: Introduced `SearchEvent` and updated `HomeEvent` to include `OnMessage` for triggering snackbar notifications from ViewModels.
- **refactor(ui)**: Adjusted `SnackbarHost` positioning in `Scaffold` to account for bottom navigation height.
- **fix(presentation)**: Improved sharing logic to provide a "link copied" message on non-Android platforms when a link is shared.1 parent 50bdb92 commit fca8393
9 files changed
Lines changed: 138 additions & 16 deletions
File tree
- core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/components
- feature
- home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation
- search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation
core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/components/RepositoryCard.kt
Lines changed: 19 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 50 | + | |
57 | 51 | | |
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
61 | 55 | | |
62 | 56 | | |
| 57 | + | |
63 | 58 | | |
64 | 59 | | |
65 | 60 | | |
66 | 61 | | |
| 62 | + | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
263 | 259 | | |
264 | 260 | | |
265 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
266 | 276 | | |
267 | 277 | | |
268 | 278 | | |
| |||
421 | 431 | | |
422 | 432 | | |
423 | 433 | | |
| 434 | + | |
424 | 435 | | |
425 | 436 | | |
426 | 437 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
Lines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| 103 | + | |
93 | 104 | | |
94 | 105 | | |
95 | 106 | | |
| |||
125 | 136 | | |
126 | 137 | | |
127 | 138 | | |
| 139 | + | |
128 | 140 | | |
129 | 141 | | |
130 | 142 | | |
131 | 143 | | |
| 144 | + | |
132 | 145 | | |
133 | 146 | | |
134 | 147 | | |
| |||
162 | 175 | | |
163 | 176 | | |
164 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
165 | 184 | | |
166 | 185 | | |
167 | 186 | | |
| |||
213 | 232 | | |
214 | 233 | | |
215 | 234 | | |
216 | | - | |
| 235 | + | |
217 | 236 | | |
218 | | - | |
| 237 | + | |
219 | 238 | | |
220 | | - | |
| 239 | + | |
221 | 240 | | |
222 | 241 | | |
223 | 242 | | |
224 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
225 | 247 | | |
226 | 248 | | |
227 | 249 | | |
| |||
389 | 411 | | |
390 | 412 | | |
391 | 413 | | |
392 | | - | |
| 414 | + | |
| 415 | + | |
393 | 416 | | |
394 | 417 | | |
395 | 418 | | |
| |||
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
254 | 274 | | |
255 | 275 | | |
256 | 276 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 36 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
| 75 | + | |
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
| |||
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
89 | 107 | | |
90 | 108 | | |
91 | 109 | | |
| |||
101 | 119 | | |
102 | 120 | | |
103 | 121 | | |
| 122 | + | |
104 | 123 | | |
105 | 124 | | |
106 | 125 | | |
| |||
127 | 146 | | |
128 | 147 | | |
129 | 148 | | |
| 149 | + | |
130 | 150 | | |
131 | 151 | | |
132 | 152 | | |
133 | 153 | | |
134 | 154 | | |
| 155 | + | |
135 | 156 | | |
136 | 157 | | |
137 | 158 | | |
| |||
142 | 163 | | |
143 | 164 | | |
144 | 165 | | |
145 | | - | |
| 166 | + | |
| 167 | + | |
146 | 168 | | |
147 | 169 | | |
148 | 170 | | |
| |||
176 | 198 | | |
177 | 199 | | |
178 | 200 | | |
179 | | - | |
| 201 | + | |
| 202 | + | |
180 | 203 | | |
181 | 204 | | |
182 | 205 | | |
| |||
202 | 225 | | |
203 | 226 | | |
204 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
205 | 234 | | |
206 | 235 | | |
207 | 236 | | |
| |||
358 | 387 | | |
359 | 388 | | |
360 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
361 | 393 | | |
362 | 394 | | |
363 | 395 | | |
| |||
467 | 499 | | |
468 | 500 | | |
469 | 501 | | |
470 | | - | |
| 502 | + | |
| 503 | + | |
471 | 504 | | |
472 | 505 | | |
473 | 506 | | |
0 commit comments