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

feat(ui): add list and manage buttons in account switch tab dialog #639

Merged
merged 1 commit into from
Mar 8, 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 @@ -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
Expand Down Expand Up @@ -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
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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),
)
}
},
)
}

Expand Down
Loading