From 22ab39262ebd8758803c5d1ac0a224cb7e948265 Mon Sep 17 00:00:00 2001 From: abdulazizacc Date: Tue, 31 Mar 2026 03:33:17 +0300 Subject: [PATCH 1/6] feat: add event state to UI and entity, and remove organizer avatar from event header --- .../uni/eventbridge/data/mapper/toDomain.kt | 3 +- .../eventbridge/data/remote/dto/EventDto.kt | 4 ++- .../uni/eventbridge/domain/entity/Event.kt | 1 + .../common/component/EventCard.kt | 15 ++++++++ .../eventDetails/EventDetailsScreen.kt | 1 - .../eventDetails/component/EventHeader.kt | 34 ------------------- .../presentation/events/EventsScreen.kt | 4 +++ .../presentation/events/EventsUiState.kt | 1 + .../presentation/events/toUiState.kt | 1 + 9 files changed, 27 insertions(+), 37 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/data/mapper/toDomain.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/data/mapper/toDomain.kt index e890baf..dc4831d 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/data/mapper/toDomain.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/data/mapper/toDomain.kt @@ -25,7 +25,8 @@ fun EventDto.toDomain() = Event( maxAttendees = maxAttendees, remainingSeats = remainingSeats, longitude = longitude, - latitude = latitude + latitude = latitude, + state = state.orEmpty() ) fun CategoryDto.toDomain() = Category( diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/data/remote/dto/EventDto.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/data/remote/dto/EventDto.kt index 1473d84..250d7a8 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/data/remote/dto/EventDto.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/data/remote/dto/EventDto.kt @@ -38,5 +38,7 @@ data class EventDto( @SerialName("pin_latitude") val latitude: Double? = null, @SerialName("pin_longitude") - val longitude: Double? = null + val longitude: Double? = null, + @SerialName("status") + val state: String?= null ) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/domain/entity/Event.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/domain/entity/Event.kt index bce43e8..9766ad0 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/domain/entity/Event.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/domain/entity/Event.kt @@ -18,4 +18,5 @@ data class Event( val longitude: Double?, val maxAttendees: Int?, val remainingSeats: Int?, + val state: String ) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/common/component/EventCard.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/common/component/EventCard.kt index e9e7fa6..d6a83d0 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/common/component/EventCard.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/common/component/EventCard.kt @@ -25,6 +25,8 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import coil3.compose.AsyncImage +import com.uni.eventbridge.presentation.common.component.modifier.noRippleClickable +import com.uni.eventbridge.presentation.common.component.theme.Primary import com.uni.eventbridge.presentation.common.component.theme.Secondary import com.uni.eventbridge.presentation.common.component.theme.SlateGray import com.uni.eventbridge.presentation.common.component.theme.White @@ -40,6 +42,7 @@ fun EventCard( title: String, date: String, location: String, + state: String?, imageUrl: String? = null, imageRes: DrawableResource = Res.drawable.im_banner_image, modifier: Modifier = Modifier, @@ -81,6 +84,17 @@ fun EventCard( .padding(start = 16.dp, top = 13.dp) .align(Alignment.Top) ) { + state?.let { + Text( + text = state, + color = White, + modifier = modifier + .noRippleClickable { onClick() } + .background(color = Primary, shape = RoundedCornerShape(100)) + .padding(vertical = 4.dp, horizontal = 12.dp) + ) + } + Text( text = title, fontSize = 18.sp, @@ -129,5 +143,6 @@ private fun EventCardPreview() { title = "AI & Ethics Workshop", date = "Oct 26, 2023 • 2:30 PM", location = "sammaarra", + state = "" ) } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/eventDetails/EventDetailsScreen.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/eventDetails/EventDetailsScreen.kt index 1e348de..455f216 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/eventDetails/EventDetailsScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/eventDetails/EventDetailsScreen.kt @@ -122,7 +122,6 @@ fun EventDetailsContent( category = uiState.category, title = uiState.title.orEmpty(), organizer = uiState.organizer.orEmpty(), - organizerAvatarUrl = uiState.organizerAvatarUrl.orEmpty(), ) HorizontalDivider(color = MaterialTheme.colorScheme.outline.copy(alpha = 0.15f)) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/eventDetails/component/EventHeader.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/eventDetails/component/EventHeader.kt index 4b15003..3d08fbc 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/eventDetails/component/EventHeader.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/eventDetails/component/EventHeader.kt @@ -1,39 +1,28 @@ package com.uni.eventbridge.presentation.eventDetails.component -import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp -import coil3.compose.AsyncImage import com.uni.eventbridge.presentation.common.component.theme.Primary import com.uni.eventbridge.presentation.common.component.theme.Secondary import com.uni.eventbridge.presentation.eventDetails.EventDetailsUiState -import eventbridge.composeapp.generated.resources.Res -import eventbridge.composeapp.generated.resources.im_banner_image -import org.jetbrains.compose.resources.painterResource @Composable fun EventHeader( category: EventDetailsUiState.CategoryUiState, title: String, organizer: String, - organizerAvatarUrl: String, ) { Column(verticalArrangement = Arrangement.spacedBy(10.dp)) { if (category.name.isNotBlank()) { @@ -62,29 +51,6 @@ fun EventHeader( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp), ) { - Box( - modifier = Modifier - .size(26.dp) - .clip(CircleShape) - .background(MaterialTheme.colorScheme.secondaryContainer), - contentAlignment = Alignment.Center, - ) { - if (organizerAvatarUrl.isNotBlank()) { - AsyncImage( - model = organizerAvatarUrl, - contentDescription = "Organizer avatar", - contentScale = ContentScale.Crop, - modifier = Modifier.fillMaxSize(), - ) - } else { - Image( - painter = painterResource(Res.drawable.im_banner_image), - contentDescription = "Organizer avatar placeholder", - contentScale = ContentScale.Crop, - modifier = Modifier.fillMaxSize(), - ) - } - } Text( text = "Organized by ", style = MaterialTheme.typography.bodySmall, diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/EventsScreen.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/EventsScreen.kt index 6396f21..44efec7 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/EventsScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/EventsScreen.kt @@ -97,6 +97,7 @@ private fun EventsContent( location = event.location, imageUrl = event.imageUrl.takeIf { it.isNotBlank() }, onClick = { onEventClicked(event.id) }, + state = event.state ) } } @@ -115,6 +116,7 @@ private fun EventsContentPreview() { date = "Oct 24, 2023 • 10:00 AM", location = "Grand University Hall", imageUrl = "", + state = "Upcoming" ), EventsUiState.EventUiState( @@ -123,6 +125,7 @@ private fun EventsContentPreview() { date = "Oct 26, 2023 • 2:30 PM", location = "Innovation Tech Hub", imageUrl = "", + state = "Upcoming" ), EventsUiState.EventUiState( id = 3, @@ -130,6 +133,7 @@ private fun EventsContentPreview() { date = "Dec 12, 2023 • 6:00 PM", location = "University Stadium", imageUrl = "", + state = "" ), ) ) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/EventsUiState.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/EventsUiState.kt index 1f2ca66..025b3f2 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/EventsUiState.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/EventsUiState.kt @@ -10,5 +10,6 @@ data class EventsUiState( val date: String, val location: String, val imageUrl: String, + val state: String? = null ) } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/toUiState.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/toUiState.kt index a729dd6..87814c0 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/toUiState.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/events/toUiState.kt @@ -8,4 +8,5 @@ fun Event.toUiState() = EventsUiState.EventUiState( date = "$date • $startTime", location = location, imageUrl = bannerUrl, + state = state ) \ No newline at end of file From 148a5e27c1acab879089127026363ddbad3c88e0 Mon Sep 17 00:00:00 2001 From: abdulazizacc Date: Mon, 13 Apr 2026 11:33:22 +0300 Subject: [PATCH 2/6] feat: implement SignOutDialog and TermOfService components in profile screen --- .../profile/component/SignOutDialog.kt | 106 ++++++++++++++++++ .../profile/component/TermsOfService.kt | 50 +++++++++ 2 files changed, 156 insertions(+) create mode 100644 composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/SignOutDialog.kt create mode 100644 composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/TermsOfService.kt diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/SignOutDialog.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/SignOutDialog.kt new file mode 100644 index 0000000..586d80f --- /dev/null +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/SignOutDialog.kt @@ -0,0 +1,106 @@ +package com.uni.eventbridge.presentation.profile.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.uni.eventbridge.presentation.common.component.theme.Primary +import com.uni.eventbridge.presentation.common.component.theme.White +import eventbridge.composeapp.generated.resources.Res +import eventbridge.composeapp.generated.resources.ic_out +import org.jetbrains.compose.resources.painterResource + +@Composable +fun SignOutDialog( + onConfirm: () -> Unit, + onDismiss: () -> Unit, +) { + AlertDialog( + onDismissRequest = onDismiss, + containerColor = White, + shape = RoundedCornerShape(20.dp), + icon = { + Box( + modifier = Modifier + .size(56.dp) + .clip(CircleShape) + .background(Color(0xFFEEF2FF)), + contentAlignment = Alignment.Center, + ) { + Icon( + painter = painterResource(Res.drawable.ic_out), + contentDescription = null, + tint = Primary, + modifier = Modifier.size(28.dp), + ) + } + }, + title = { + Text( + text = "Sign Out?", + fontSize = 18.sp, + fontWeight = FontWeight.Bold, + color = Color(0xFF1A1A2E), + textAlign = TextAlign.Center, + modifier = Modifier.fillMaxWidth(), + ) + }, + text = { + Text( + text = "Are you sure you want to sign out of your account?", + fontSize = 14.sp, + color = Color(0xFF9E9E9E), + textAlign = TextAlign.Center, + modifier = Modifier.fillMaxWidth(), + ) + }, + confirmButton = { + Button( + onClick = onConfirm, + modifier = Modifier + .fillMaxWidth() + .height(48.dp), + shape = RoundedCornerShape(12.dp), + colors = ButtonDefaults.buttonColors(containerColor = Primary), + ) { + Text( + text = "Sign Out", + fontSize = 16.sp, + fontWeight = FontWeight.SemiBold, + color = White, + ) + } + }, + dismissButton = { + TextButton( + onClick = onDismiss, + modifier = Modifier.fillMaxWidth(), + ) { + Text( + text = "Cancel", + fontSize = 16.sp, + fontWeight = FontWeight.Medium, + color = Color(0xFF1A1A2E), + ) + } + }, + ) +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/TermsOfService.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/TermsOfService.kt new file mode 100644 index 0000000..17c1662 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/TermsOfService.kt @@ -0,0 +1,50 @@ +package com.uni.eventbridge.presentation.profile.component + + +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.AlertDialog +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.uni.eventbridge.presentation.common.component.theme.White + +@Composable +fun TermOfService( + onDismiss: () -> Unit, +) { + AlertDialog( + onDismissRequest = onDismiss, + containerColor = White, + shape = RoundedCornerShape(20.dp), + text = { + Text( + text = "All events here in this platform follow do follow the Iraqi lows and tikrit university lows for the types of events it have", + fontSize = 18.sp, + color = Color(0xFF4C4C4C), + textAlign = TextAlign.Center, + modifier = Modifier.fillMaxWidth(), + ) + }, + confirmButton = {}, + dismissButton = { + TextButton( + onClick = onDismiss, + modifier = Modifier.fillMaxWidth(), + ) { + Text( + text = "Cancel", + fontSize = 16.sp, + fontWeight = FontWeight.Medium, + color = Color(0xFF1A1A2E), + ) + } + }, + ) +} \ No newline at end of file From 9d2b86a3f3a31898ac1b0bf9b9610cfb1e153cc8 Mon Sep 17 00:00:00 2001 From: abdulazizacc Date: Mon, 13 Apr 2026 11:34:10 +0300 Subject: [PATCH 3/6] refactor: extract SignOutDialog and TermOfService components and implement dialog logic in ProfileScreen --- .../presentation/profile/ProfileScreen.kt | 93 ++----------------- 1 file changed, 10 insertions(+), 83 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileScreen.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileScreen.kt index 3ed9576..2a615d4 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileScreen.kt @@ -16,13 +16,9 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll -import androidx.compose.material3.AlertDialog -import androidx.compose.material3.Button -import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.Text -import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -34,7 +30,6 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -45,10 +40,11 @@ import com.uni.eventbridge.presentation.common.component.EventBridgeScaffold import com.uni.eventbridge.presentation.common.component.theme.Primary import com.uni.eventbridge.presentation.common.component.theme.Secondary import com.uni.eventbridge.presentation.common.component.theme.White +import com.uni.eventbridge.presentation.profile.component.SignOutDialog +import com.uni.eventbridge.presentation.profile.component.TermOfService import eventbridge.composeapp.generated.resources.Res import eventbridge.composeapp.generated.resources.ic_arrow_right import eventbridge.composeapp.generated.resources.ic_doc -import eventbridge.composeapp.generated.resources.ic_explore import eventbridge.composeapp.generated.resources.ic_message import eventbridge.composeapp.generated.resources.ic_out import org.jetbrains.compose.resources.painterResource @@ -77,6 +73,7 @@ fun ProfileScreen( uiState = uiState, onContactUsClicked = viewModel::onContactUsClicked, onTermsOfServiceClicked = viewModel::onTermsOfServiceClicked, + onTermsOfServiceDismissed = viewModel::onTermOfServiceDismissed, onSignOutClicked = viewModel::onSignOutClicked, onSignOutConfirmed = viewModel::onSignOutConfirmed, onSignOutDismissed = viewModel::onSignOutDismissed, @@ -88,6 +85,7 @@ private fun ProfileContent( uiState: ProfileUiState = ProfileUiState(), onContactUsClicked: () -> Unit = {}, onTermsOfServiceClicked: () -> Unit = {}, + onTermsOfServiceDismissed: () -> Unit = {}, onSignOutClicked: () -> Unit = {}, onSignOutConfirmed: () -> Unit = {}, onSignOutDismissed: () -> Unit = {}, @@ -156,6 +154,12 @@ private fun ProfileContent( } + if (uiState.showTermOfServiceDialog) { + TermOfService( + onDismiss = onTermsOfServiceDismissed, + ) + } + if (uiState.showSignOutDialog) { SignOutDialog( onConfirm = onSignOutConfirmed, @@ -295,83 +299,6 @@ private fun ProfileSignOutRow(onSignOutClicked: () -> Unit) { } } -@Composable -private fun SignOutDialog( - onConfirm: () -> Unit, - onDismiss: () -> Unit, -) { - AlertDialog( - onDismissRequest = onDismiss, - containerColor = White, - shape = RoundedCornerShape(20.dp), - icon = { - Box( - modifier = Modifier - .size(56.dp) - .clip(CircleShape) - .background(Color(0xFFEEF2FF)), - contentAlignment = Alignment.Center, - ) { - Icon( - painter = painterResource(Res.drawable.ic_explore), - contentDescription = null, - tint = Primary, - modifier = Modifier.size(28.dp), - ) - } - }, - title = { - Text( - text = "Sign Out?", - fontSize = 18.sp, - fontWeight = FontWeight.Bold, - color = Color(0xFF1A1A2E), - textAlign = TextAlign.Center, - modifier = Modifier.fillMaxWidth(), - ) - }, - text = { - Text( - text = "Are you sure you want to sign out of your account?", - fontSize = 14.sp, - color = Color(0xFF9E9E9E), - textAlign = TextAlign.Center, - modifier = Modifier.fillMaxWidth(), - ) - }, - confirmButton = { - Button( - onClick = onConfirm, - modifier = Modifier - .fillMaxWidth() - .height(48.dp), - shape = RoundedCornerShape(12.dp), - colors = ButtonDefaults.buttonColors(containerColor = Primary), - ) { - Text( - text = "Sign Out", - fontSize = 16.sp, - fontWeight = FontWeight.SemiBold, - color = White, - ) - } - }, - dismissButton = { - TextButton( - onClick = onDismiss, - modifier = Modifier.fillMaxWidth(), - ) { - Text( - text = "Cancel", - fontSize = 16.sp, - fontWeight = FontWeight.Medium, - color = Color(0xFF1A1A2E), - ) - } - }, - ) -} - @Preview @Composable private fun ProfilscreenPreview() { From efaedbbbd0888eeaf281ed8806d25b6d93cf5a66 Mon Sep 17 00:00:00 2001 From: abdulazizacc Date: Mon, 13 Apr 2026 11:34:39 +0300 Subject: [PATCH 4/6] feat: implement Terms of Service dialog state in ProfileViewModel and ProfileUiState --- .../presentation/profile/ProfileUiState.kt | 1 + .../presentation/profile/ProfileViewModel.kt | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileUiState.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileUiState.kt index 102a906..6d2558e 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileUiState.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileUiState.kt @@ -7,4 +7,5 @@ data class ProfileUiState( val attendedCount: Int = 0, val organizedCount: Int = 0, val showSignOutDialog: Boolean = false, + val showTermOfServiceDialog: Boolean = false, ) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileViewModel.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileViewModel.kt index 24d3064..fe7f167 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileViewModel.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileViewModel.kt @@ -33,14 +33,15 @@ class ProfileViewModel( sendEffect(ProfileUIEffect.NavigateToContactUs) } - fun onTermsOfServiceClicked() { - sendEffect(ProfileUIEffect.NavigateToTermsOfService) - } - fun onSignOutClicked() { updateState { it.copy(showSignOutDialog = true) } } + fun onTermsOfServiceClicked() { + updateState { it.copy(showTermOfServiceDialog = true) } + } + + fun onSignOutConfirmed() { tryToExecute( callee = { profileRepository.signOut() }, @@ -52,6 +53,9 @@ class ProfileViewModel( ) } + fun onTermOfServiceDismissed() { + updateState { it.copy(showTermOfServiceDialog = false) } + } fun onSignOutDismissed() { updateState { it.copy(showSignOutDialog = false) } } From 7d842c51f786cace134c9cefb4a891cdf8de2f7a Mon Sep 17 00:00:00 2001 From: abdulazizacc Date: Mon, 13 Apr 2026 11:35:16 +0300 Subject: [PATCH 5/6] refactor: update LocationSection title to Venue Name --- .../presentation/createEvent/component/LocationSection.kt | 2 +- .../kotlin/com/uni/eventbridge/presentation/home/HomeScreen.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/createEvent/component/LocationSection.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/createEvent/component/LocationSection.kt index 0e70be3..650b781 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/createEvent/component/LocationSection.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/createEvent/component/LocationSection.kt @@ -46,7 +46,7 @@ fun LocationSection( ) { var showMap by remember { mutableStateOf(false) } Column(verticalArrangement = Arrangement.spacedBy(12.dp)) { - SectionTitle("Location") + SectionTitle("Venue Name") EventTextField( value = location, diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/home/HomeScreen.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/home/HomeScreen.kt index 6befe57..2c8c0b2 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/home/HomeScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/home/HomeScreen.kt @@ -105,7 +105,7 @@ private fun HomeContent( selectedCategory = uiState.selectedCategoryId, onCategorySelected = { onCategorySelected(it?.id) }, listState = categoryScrollState, - modifier = Modifier.padding(top = 16.dp), + modifier = Modifier.padding(top = 14.dp), ) } From e26afd361ca837c66d1cf1833f0a5aba726dcc17 Mon Sep 17 00:00:00 2001 From: abdulazizacc Date: Mon, 13 Apr 2026 16:55:39 +0300 Subject: [PATCH 6/6] refactor: remove unused TermsOfService navigation effect and update TermsOfService text for clarity --- .../com/uni/eventbridge/presentation/profile/ProfileScreen.kt | 2 -- .../com/uni/eventbridge/presentation/profile/ProfileUIEffect.kt | 1 - .../presentation/profile/component/TermsOfService.kt | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileScreen.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileScreen.kt index 2a615d4..f44cd6e 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileScreen.kt @@ -55,7 +55,6 @@ fun ProfileScreen( viewModel: ProfileViewModel = koinViewModel(), onNavigateToSignIn: () -> Unit, onNavigateToContactUs: () -> Unit = {}, - onNavigateToTermsOfService: () -> Unit = {}, ) { val uiState by viewModel.uiState.collectAsStateWithLifecycle() @@ -64,7 +63,6 @@ fun ProfileScreen( when (effect) { is ProfileUIEffect.NavigateToSignIn -> onNavigateToSignIn() is ProfileUIEffect.NavigateToContactUs -> onNavigateToContactUs() - is ProfileUIEffect.NavigateToTermsOfService -> onNavigateToTermsOfService() } } } diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileUIEffect.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileUIEffect.kt index 7c0a159..98c96f1 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileUIEffect.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/ProfileUIEffect.kt @@ -3,5 +3,4 @@ package com.uni.eventbridge.presentation.profile sealed interface ProfileUIEffect { data object NavigateToSignIn : ProfileUIEffect data object NavigateToContactUs : ProfileUIEffect - data object NavigateToTermsOfService : ProfileUIEffect } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/TermsOfService.kt b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/TermsOfService.kt index 17c1662..e090be7 100644 --- a/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/TermsOfService.kt +++ b/composeApp/src/commonMain/kotlin/com/uni/eventbridge/presentation/profile/component/TermsOfService.kt @@ -25,7 +25,7 @@ fun TermOfService( shape = RoundedCornerShape(20.dp), text = { Text( - text = "All events here in this platform follow do follow the Iraqi lows and tikrit university lows for the types of events it have", + text = "All events on this platform comply with Iraqi laws and Tikrit University regulations regarding the types of events they may host.", fontSize = 18.sp, color = Color(0xFF4C4C4C), textAlign = TextAlign.Center,