feat: Add ContactCard state, primitives and small components - #820
feat: Add ContactCard state, primitives and small components#820Elouan1411 wants to merge 10 commits into
Conversation
2af33ef to
74b2c73
Compare
74b2c73 to
4772e69
Compare
4772e69 to
d1fb95a
Compare
71026ed to
fdb1a22
Compare
There was a problem hiding this comment.
Pull request overview
Adds reusable state, styling defaults, and Compose primitives for the Contact Card feature.
Changes:
- Adds top-bar state and customizable colors.
- Adds editor, preview, loading, dialog, and layout components.
- Adds preview fixtures for contact-card UI tooling.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
ContactCardTopBarState.kt |
Defines top-bar modes and callbacks. |
ContactCardDefaults.kt |
Provides theme-aware card colors. |
SectionCard.kt |
Adds section container UI. |
PreviewTopBar.kt |
Adds preview navigation actions. |
PreviewData.kt |
Provides preview model fixtures. |
LoadingContent.kt |
Adds centered loading UI. |
FieldDivider.kt |
Adds field separator styling. |
EditorTopBar.kt |
Adds editor cancel/save actions. |
EditorField.kt |
Adds reusable single-line input. |
DefaultValidationErrorDialog.kt |
Adds validation error dialog. |
DefaultDeleteConfirmationDialog.kt |
Adds deletion confirmation dialog. |
ContactInfoRows.kt |
Displays available contact information. |
ContactCardTopBar.kt |
Adds shared centered top bar. |
ContactCardConstants.kt |
Defines shared card radius. |
BottomSheetAction.kt |
Adds reusable bottom-sheet action row. |
fdb1a22 to
a3fce2a
Compare
a3fce2a to
e082a8f
Compare
e082a8f to
9a91d1e
Compare
9a91d1e to
3480a38
Compare
3480a38 to
e314d75
Compare
e314d75 to
e16e4c4
Compare
| } | ||
| } | ||
| Column(modifier = modifier) { | ||
| rows.forEachIndexed { index, (label, value) -> |
There was a problem hiding this comment.
if you don't have anything in rows, no need to have an empty column ?
There was a problem hiding this comment.
There will always be at least one Row since phone is required
| import com.infomaniak.core.ui.compose.contactcard.R | ||
|
|
||
| @Composable | ||
| internal fun DefaultValidationErrorDialog( |
There was a problem hiding this comment.
You could group DefaultDeleteConfirmationDialog and DefaultValidationErrorDialog. the only thing changing are the strings.
| internal fun LoadingContent() { | ||
| Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { | ||
| CircularProgressIndicator() | ||
| } |
There was a problem hiding this comment.
Was that really necessary instead of just using the CircularProgressIndicator where you needed it ?
| import com.infomaniak.core.auth.models.user.preferences.OrganizationPreference | ||
| import com.infomaniak.core.auth.models.user.preferences.Preferences | ||
|
|
||
| internal fun previewUser(): User { |
There was a problem hiding this comment.
You could use PreviewParameterProvider for that.
| ) | ||
| } | ||
| }, | ||
| ) |
There was a problem hiding this comment.
That's not really necessary to create a Composable just for the preview. Especially here, it's not that long.
e16e4c4 to
e314d75
Compare
|



No description provided.