Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] #54-링크 클릭시 웹 브라우저 호출 로직 구현 #55

Merged
merged 1 commit into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,30 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import com.strayalpaca.addlink.model.Link
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.core.ui.utils.noRippleClickable

@Composable
internal fun Link(
link: Link,
modifier: Modifier = Modifier,
openWebBrowserByClick: Boolean = true,
) {
val uriHandler = LocalUriHandler.current

Row(
modifier = modifier
.fillMaxWidth()
.clip(RoundedCornerShape(12.dp))
.noRippleClickable {
if (openWebBrowserByClick) {
uriHandler.openUri(link.url)
}
}
.height(IntrinsicSize.Min)
.border(
width = 1.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,31 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.unit.dp
import coil.compose.rememberAsyncImagePainter
import com.strayalpaca.pokitdetail.model.Link
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.core.ui.utils.noRippleClickable

@Composable
internal fun Link(
link: Link,
modifier: Modifier = Modifier,
openWebBrowserByClick: Boolean = true,
) {
val uriHandler = LocalUriHandler.current

Row(
modifier = modifier
.fillMaxWidth()
.clip(RoundedCornerShape(12.dp))
.height(IntrinsicSize.Min)
.noRippleClickable {
if (openWebBrowserByClick) {
uriHandler.openUri(link.url)
}
}
.border(
width = 1.dp,
color = PokitTheme.colors.borderTertiary,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,31 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.unit.dp
import coil.compose.rememberAsyncImagePainter
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.core.ui.utils.noRippleClickable
import pokitmons.pokit.search.model.Link

@Composable
internal fun Link(
link: Link,
modifier: Modifier = Modifier,
openWebBrowserByClick: Boolean = true,
) {
val uriHandler = LocalUriHandler.current

Row(
modifier = modifier
.fillMaxWidth()
.clip(RoundedCornerShape(12.dp))
.height(IntrinsicSize.Min)
.noRippleClickable {
if (openWebBrowserByClick) {
uriHandler.openUri(link.url)
}
}
.border(
width = 1.dp,
color = PokitTheme.colors.borderTertiary,
Expand Down
Loading