feat: more items in sidebar when inside an account
This commit is contained in:
parent
4298890d68
commit
0fc1fe371c
5 changed files with 54 additions and 4 deletions
|
|
@ -27,7 +27,7 @@ templ SpaceAccountPage(props SpaceAccountPageProps) {
|
|||
balanceTextClasses = append(balanceTextClasses, "text-red-600 dark:text-red-400")
|
||||
}
|
||||
}}
|
||||
@layouts.App("Space Account", spaceOverviewSidebarContent(), spaceSpecificSidebarContent(props.SpaceID)) {
|
||||
@layouts.App("Space Account", spaceOverviewSidebarContent(), spaceSpecificSidebarContent(props.SpaceID), spaceAccountSidebarContent(props.SpaceID, props.AccountID, props.AccountName)) {
|
||||
<div class="container px-6 py-8 mx-auto space-y-8">
|
||||
<div class="grid gap-4 grid-cols-1 md:grid-cols-12">
|
||||
@card.Card(card.Props{
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ type SpaceAccountTransactionsPageProps struct {
|
|||
}
|
||||
|
||||
templ SpaceAccountTransactionsPage(props SpaceAccountTransactionsPageProps) {
|
||||
@layouts.App("Transactions", spaceOverviewSidebarContent(), spaceSpecificSidebarContent(props.SpaceID)) {
|
||||
@layouts.App("Transactions", spaceOverviewSidebarContent(), spaceSpecificSidebarContent(props.SpaceID), spaceAccountSidebarContent(props.SpaceID, props.AccountID, props.AccountName)) {
|
||||
<div class="container px-6 py-8 mx-auto space-y-8">
|
||||
<div class="flex items-start justify-between flex-wrap gap-4">
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ type SpaceCreateBillPageProps struct {
|
|||
}
|
||||
|
||||
templ SpaceCreateBillPage(props SpaceCreateBillPageProps) {
|
||||
@layouts.App("Pay Bills", spaceOverviewSidebarContent(), spaceSpecificSidebarContent(props.SpaceID)) {
|
||||
@layouts.App("Pay Bills", spaceOverviewSidebarContent(), spaceSpecificSidebarContent(props.SpaceID), spaceAccountSidebarContent(props.SpaceID, props.AccountID, props.AccountName)) {
|
||||
<div class="container max-w-3xl px-6 py-8 mx-auto space-y-8">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold">Pay Bills</h1>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ type SpaceCreateDepositPageProps struct {
|
|||
}
|
||||
|
||||
templ SpaceCreateDepositPage(props SpaceCreateDepositPageProps) {
|
||||
@layouts.App("Deposit Funds", spaceOverviewSidebarContent(), spaceSpecificSidebarContent(props.SpaceID)) {
|
||||
@layouts.App("Deposit Funds", spaceOverviewSidebarContent(), spaceSpecificSidebarContent(props.SpaceID), spaceAccountSidebarContent(props.SpaceID, props.AccountID, props.AccountName)) {
|
||||
<div class="container max-w-3xl px-6 py-8 mx-auto space-y-8">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold">Deposit Funds</h1>
|
||||
|
|
|
|||
|
|
@ -56,3 +56,53 @@ templ spaceSpecificSidebarContent(spaceID string) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
templ spaceAccountSidebarContent(spaceID, accountID, accountName string) {
|
||||
@sidebar.Group() {
|
||||
@sidebar.GroupLabel() {
|
||||
{ accountName }
|
||||
}
|
||||
@sidebar.Menu() {
|
||||
@sidebar.MenuItem() {
|
||||
@sidebar.MenuButton(sidebar.MenuButtonProps{
|
||||
Href: routeurl.URL("page.app.spaces.space.accounts.account.overview", "spaceID", spaceID, "accountID", accountID),
|
||||
IsActive: ctxkeys.URLPath(ctx) == routeurl.URL("page.app.spaces.space.accounts.account.overview", "spaceID", spaceID, "accountID", accountID),
|
||||
Tooltip: "Account Overview",
|
||||
}) {
|
||||
@icon.Wallet()
|
||||
<span>Overview</span>
|
||||
}
|
||||
}
|
||||
@sidebar.MenuItem() {
|
||||
@sidebar.MenuButton(sidebar.MenuButtonProps{
|
||||
Href: routeurl.URL("page.app.spaces.space.accounts.account.transactions", "spaceID", spaceID, "accountID", accountID),
|
||||
IsActive: ctxkeys.URLPath(ctx) == routeurl.URL("page.app.spaces.space.accounts.account.transactions", "spaceID", spaceID, "accountID", accountID),
|
||||
Tooltip: "Transactions",
|
||||
}) {
|
||||
@icon.ReceiptText()
|
||||
<span>Transactions</span>
|
||||
}
|
||||
}
|
||||
@sidebar.MenuItem() {
|
||||
@sidebar.MenuButton(sidebar.MenuButtonProps{
|
||||
Href: routeurl.URL("page.app.spaces.space.accounts.account.bills.create", "spaceID", spaceID, "accountID", accountID),
|
||||
IsActive: ctxkeys.URLPath(ctx) == routeurl.URL("page.app.spaces.space.accounts.account.bills.create", "spaceID", spaceID, "accountID", accountID),
|
||||
Tooltip: "Pay Bills",
|
||||
}) {
|
||||
@icon.HandCoins()
|
||||
<span>Pay Bills</span>
|
||||
}
|
||||
}
|
||||
@sidebar.MenuItem() {
|
||||
@sidebar.MenuButton(sidebar.MenuButtonProps{
|
||||
Href: routeurl.URL("page.app.spaces.space.accounts.account.deposits.create", "spaceID", spaceID, "accountID", accountID),
|
||||
IsActive: ctxkeys.URLPath(ctx) == routeurl.URL("page.app.spaces.space.accounts.account.deposits.create", "spaceID", spaceID, "accountID", accountID),
|
||||
Tooltip: "Deposit Funds",
|
||||
}) {
|
||||
@icon.BanknoteArrowDown()
|
||||
<span>Deposit Funds</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue