PWA Fundvelo der Caritas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NavMenu.razor 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <MatAppBarContainer>
  2. <MatAppBar Fixed="true">
  3. <MatAppBarRow>
  4. <MatAppBarSection>
  5. <MatIconButton Icon="menu" OnClick="@((e) => ButtonClicked())"></MatIconButton>
  6. <MatAppBarTitle>CaritasPWA</MatAppBarTitle>
  7. </MatAppBarSection>
  8. @*<MatAppBarSection Align="@MatAppBarSectionAlign.Start">
  9. <NavLink class="text-white nav-link" href="" Match="NavLinkMatch.All">
  10. Home
  11. </NavLink>
  12. <NavLink class="text-white nav-link" href="counter">
  13. Counter
  14. </NavLink>
  15. <NavLink class="text-white nav-link" href="fetchdata">
  16. Fetch Data
  17. </NavLink>
  18. </MatAppBarSection>*@
  19. <MatAppBarSection Align="@MatAppBarSectionAlign.End">
  20. <NavLink class="text-white" href="http://blazor.net" Align="@MatAppBarSectionAlign.End" Style="padding-right:1em">About</NavLink>
  21. </MatAppBarSection>
  22. </MatAppBarRow>
  23. </MatAppBar>
  24. <MatAppBarContent>
  25. <MatDrawerContainer>
  26. <MatDrawer @bind-Opened="@Opened" Mode="@MatDrawerMode.Modal">
  27. <MatList>
  28. <MatListItem Class="@((Index == 1)?"bg-primary-color text-white" : "")"
  29. href=""
  30. Match="NavLinkMatch.All"
  31. @onclick="@((e) => ButtonClicked(1))">
  32. <MatIcon Icon="@MatIconNames.Apps"></MatIcon>
  33. <MatListItemText Style="padding-left:0.5em">Caritas Dienste</MatListItemText>
  34. </MatListItem>
  35. <MatListItem Class="@((Index == 2)?"bg-primary-color text-white" : "")"
  36. Href="counter"
  37. @onclick="@((e) => ButtonClicked(2))">
  38. <MatIcon Icon="@MatIconNames.Person_outline"></MatIcon>
  39. <MatListItemText Style="padding-left:0.5em">Konto</MatListItemText>
  40. </MatListItem>
  41. <MatListItem Class="@((Index == 3)?"bg-primary-color text-white" : "")"
  42. Href="fetchdata"
  43. @onclick="@((e) => ButtonClicked(3))">
  44. <MatIcon Icon="@MatIconNames.Error_outline" Style="transform: rotate(180deg)"></MatIcon>
  45. <MatListItemText Style="padding-left:0.5em">Info</MatListItemText>
  46. </MatListItem>
  47. <MatListItem Class="@((Index == 4)?"bg-primary-color text-white" : "")"
  48. Href="counter"
  49. @onclick="@((e) => ButtonClicked(4))">
  50. <MatIcon Icon="@MatIconNames.Exit_to_app"></MatIcon>
  51. <MatListItemText Style="padding-left:0.5em">Logout</MatListItemText>
  52. </MatListItem>
  53. </MatList>
  54. </MatDrawer>
  55. </MatDrawerContainer>
  56. </MatAppBarContent>
  57. </MatAppBarContainer>
  58. @code
  59. {
  60. bool Opened = false;
  61. int Index = 0;
  62. void ButtonClicked() {
  63. Opened = !Opened;
  64. }
  65. void ButtonClicked(int _Index) {
  66. Index = _Index;
  67. ButtonClicked();
  68. }
  69. }