Skip to content

Commit

Permalink
feat(ui): add list and manage buttons in account switch tab dialog (A…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashinch authored Mar 8, 2024
1 parent 6b29a81 commit 7a90aa3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
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

0 comments on commit 7a90aa3

Please sign in to comment.