Skip to content

Commit

Permalink
Merge pull request #1357 from mbakgun/main
Browse files Browse the repository at this point in the history
feature/speakerDetailSocialClick
  • Loading branch information
joreilly authored Jun 2, 2024
2 parents e69233c + 9ab22c2 commit 772b0a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ fun SpeakerDetailsView(
conference: String,
speaker: SpeakerDetails,
navigateToSession: (id: String) -> Unit,
popBack: () -> Unit
popBack: () -> Unit,
onSocialLinkClicked: (String) -> Unit
) {
val scrollState = rememberScrollState()

Expand Down Expand Up @@ -128,14 +129,7 @@ fun SpeakerDetailsView(
SocialIcon(
modifier = Modifier.size(24.dp),
socialItem = socialsItem,
onClick = {
// runCatching {
// val intent = Intent(Intent.ACTION_VIEW, Uri.parse(socialsItem.url))
// context.startActivity(intent)
// }.getOrElse { error ->
// error.printStackTrace()
// }
}
onClick = { onSocialLinkClicked(socialsItem.url) }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalUriHandler
import com.arkivanov.decompose.extensions.compose.subscribeAsState
import confetti.shared.generated.resources.Res
import confetti.shared.generated.resources.speakers
import dev.johnoreilly.confetti.decompose.SessionsUiState
import dev.johnoreilly.confetti.decompose.SpeakerDetailsComponent
import dev.johnoreilly.confetti.decompose.SpeakerDetailsUiState
import dev.johnoreilly.confetti.decompose.SpeakersComponent
import dev.johnoreilly.confetti.decompose.SpeakersUiState
import dev.johnoreilly.confetti.ui.ErrorView
import dev.johnoreilly.confetti.ui.LoadingView
import dev.johnoreilly.confetti.ui.SpeakerDetailsView
import dev.johnoreilly.confetti.ui.SpeakerGridView
import org.jetbrains.compose.resources.stringResource

@OptIn(ExperimentalMaterial3Api::class)
Expand All @@ -47,6 +43,7 @@ fun SpeakersUI(component: SpeakersComponent) {

@Composable
fun SpeakerDetailsUI(component: SpeakerDetailsComponent) {
val uriHandler = LocalUriHandler.current
val uiState by component.uiState.subscribeAsState()

when (val state = uiState) {
Expand All @@ -57,7 +54,7 @@ fun SpeakerDetailsUI(component: SpeakerDetailsComponent) {
state.details,
component::onSessionClicked,
component::onCloseClicked,
)
uriHandler::openUri)
}

}

0 comments on commit 772b0a3

Please sign in to comment.