mirror of https://github.com/Ashinch/ReadYou.git
feat(ui): add list and manage buttons in account switch tab dialog (#639)
This commit is contained in:
parent
6b29a810ba
commit
7a90aa3a98
|
@ -62,6 +62,7 @@ import me.ash.reader.ui.component.base.RYScaffold
|
|||
import me.ash.reader.ui.component.base.Subtitle
|
||||
import me.ash.reader.ui.ext.alphaLN
|
||||
import me.ash.reader.ui.ext.collectAsStateValue
|
||||
import me.ash.reader.ui.ext.currentAccountId
|
||||
import me.ash.reader.ui.ext.findActivity
|
||||
import me.ash.reader.ui.ext.getCurrentVersion
|
||||
import me.ash.reader.ui.page.common.RouteName
|
||||
|
@ -339,6 +340,14 @@ fun FeedsPage(
|
|||
}
|
||||
}
|
||||
},
|
||||
onClickSettings = {
|
||||
accountTabVisible = false
|
||||
navController.navigate("${RouteName.ACCOUNT_DETAILS}/${context.currentAccountId}")
|
||||
},
|
||||
onClickManage = {
|
||||
accountTabVisible = false
|
||||
navController.navigate(RouteName.ACCOUNTS)
|
||||
},
|
||||
onDismissRequest = {
|
||||
accountTabVisible = false
|
||||
},
|
||||
|
|
|
@ -9,6 +9,7 @@ import androidx.compose.material.icons.outlined.People
|
|||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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
|
||||
|
@ -36,6 +37,8 @@ fun AccountsTab(
|
|||
visible: Boolean = false,
|
||||
accounts: List<Account>,
|
||||
onAccountSwitch: (Account) -> Unit = {},
|
||||
onClickSettings: () -> Unit = {},
|
||||
onClickManage: () -> Unit = {},
|
||||
onDismissRequest: () -> Unit = {},
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
@ -99,8 +102,20 @@ fun AccountsTab(
|
|||
}
|
||||
}
|
||||
},
|
||||
confirmButton = {},
|
||||
dismissButton = {},
|
||||
confirmButton = {
|
||||
TextButton(onClick = onClickSettings) {
|
||||
Text(
|
||||
text = stringResource(R.string.settings),
|
||||
)
|
||||
}
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = onClickManage) {
|
||||
Text(
|
||||
text = stringResource(R.string.list),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue