pref(ExplorePage): 未登录时不显示“关注”
This commit is contained in:
parent
e18259e232
commit
dc987babe5
|
|
@ -30,17 +30,19 @@ import com.huanchengfly.tieba.post.ui.widgets.compose.ActionItem
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.PagerTabIndicator
|
import com.huanchengfly.tieba.post.ui.widgets.compose.PagerTabIndicator
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.Toolbar
|
import com.huanchengfly.tieba.post.ui.widgets.compose.Toolbar
|
||||||
import com.huanchengfly.tieba.post.ui.widgets.compose.accountNavIconIfCompact
|
import com.huanchengfly.tieba.post.ui.widgets.compose.accountNavIconIfCompact
|
||||||
|
import com.huanchengfly.tieba.post.utils.AccountUtil.LocalAccount
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
|
||||||
@OptIn(ExperimentalPagerApi::class)
|
@OptIn(ExperimentalPagerApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun ExplorePage() {
|
fun ExplorePage() {
|
||||||
|
val account = LocalAccount.current
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val pages = listOf<Pair<String, (@Composable () -> Unit)>>(
|
val pages = listOfNotNull<Pair<String, (@Composable () -> Unit)>>(
|
||||||
stringResource(id = R.string.title_concern) to @Composable {
|
if (account != null) stringResource(id = R.string.title_concern) to @Composable {
|
||||||
ConcernPage()
|
ConcernPage()
|
||||||
},
|
} else null,
|
||||||
stringResource(id = R.string.title_personalized) to @Composable {
|
stringResource(id = R.string.title_personalized) to @Composable {
|
||||||
PersonalizedPage()
|
PersonalizedPage()
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue