navigation-dropdown.blade.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
  2. <!-- Primary Navigation Menu -->
  3. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  4. <div class="flex justify-between h-16">
  5. <div class="flex">
  6. <!-- Logo -->
  7. <div class="flex-shrink-0 flex items-center">
  8. <a href="{{ route('dashboard') }}">
  9. <x-jet-application-mark class="block h-9 w-auto" />
  10. </a>
  11. </div>
  12. <!-- Navigation Links -->
  13. <div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
  14. <x-jet-nav-link href="{{ route('dashboard') }}" :active="request()->routeIs('dashboard')">
  15. {{ __('Dashboard') }}
  16. </x-jet-nav-link>
  17. </div>
  18. </div>
  19. <!-- Settings Dropdown -->
  20. <div class="hidden sm:flex sm:items-center sm:ml-6">
  21. <x-jet-dropdown align="right" width="48">
  22. <x-slot name="trigger">
  23. @if (Laravel\Jetstream\Jetstream::managesProfilePhotos())
  24. <button class="flex text-sm border-2 border-transparent rounded-full focus:outline-none focus:border-gray-300 transition duration-150 ease-in-out">
  25. <img class="h-8 w-8 rounded-full object-cover" src="{{ Auth::user()->profile_photo_url }}" alt="{{ Auth::user()->name }}" />
  26. </button>
  27. @else
  28. <button class="flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out">
  29. <div>{{ Auth::user()->name }}</div>
  30. <div class="ml-1">
  31. <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
  32. <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
  33. </svg>
  34. </div>
  35. </button>
  36. @endif
  37. </x-slot>
  38. <x-slot name="content">
  39. <!-- Account Management -->
  40. <div class="block px-4 py-2 text-xs text-gray-400">
  41. {{ __('Manage Account') }}
  42. </div>
  43. <x-jet-dropdown-link href="{{ route('profile.show') }}">
  44. {{ __('Profile') }}
  45. </x-jet-dropdown-link>
  46. @if (Laravel\Jetstream\Jetstream::hasApiFeatures())
  47. <x-jet-dropdown-link href="{{ route('api-tokens.index') }}">
  48. {{ __('API Tokens') }}
  49. </x-jet-dropdown-link>
  50. @endif
  51. <div class="border-t border-gray-100"></div>
  52. <!-- Team Management -->
  53. @if (Laravel\Jetstream\Jetstream::hasTeamFeatures())
  54. <div class="block px-4 py-2 text-xs text-gray-400">
  55. {{ __('Manage Team') }}
  56. </div>
  57. <!-- Team Settings -->
  58. <x-jet-dropdown-link href="{{ route('teams.show', Auth::user()->currentTeam->id) }}">
  59. {{ __('Team Settings') }}
  60. </x-jet-dropdown-link>
  61. @can('create', Laravel\Jetstream\Jetstream::newTeamModel())
  62. <x-jet-dropdown-link href="{{ route('teams.create') }}">
  63. {{ __('Create New Team') }}
  64. </x-jet-dropdown-link>
  65. @endcan
  66. <div class="border-t border-gray-100"></div>
  67. <!-- Team Switcher -->
  68. <div class="block px-4 py-2 text-xs text-gray-400">
  69. {{ __('Switch Teams') }}
  70. </div>
  71. @foreach (Auth::user()->allTeams() as $team)
  72. <x-jet-switchable-team :team="$team" />
  73. @endforeach
  74. <div class="border-t border-gray-100"></div>
  75. @endif
  76. <!-- Authentication -->
  77. <form method="POST" action="{{ route('logout') }}">
  78. @csrf
  79. <x-jet-dropdown-link href="{{ route('logout') }}"
  80. onclick="event.preventDefault();
  81. this.closest('form').submit();">
  82. {{ __('Logout') }}
  83. </x-jet-dropdown-link>
  84. </form>
  85. </x-slot>
  86. </x-jet-dropdown>
  87. </div>
  88. <!-- Hamburger -->
  89. <div class="-mr-2 flex items-center sm:hidden">
  90. <button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
  91. <svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
  92. <path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
  93. <path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
  94. </svg>
  95. </button>
  96. </div>
  97. </div>
  98. </div>
  99. <!-- Responsive Navigation Menu -->
  100. <div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
  101. <div class="pt-2 pb-3 space-y-1">
  102. <x-jet-responsive-nav-link href="{{ route('dashboard') }}" :active="request()->routeIs('dashboard')">
  103. {{ __('Dashboard') }}
  104. </x-jet-responsive-nav-link>
  105. </div>
  106. <!-- Responsive Settings Options -->
  107. <div class="pt-4 pb-1 border-t border-gray-200">
  108. <div class="flex items-center px-4">
  109. <div class="flex-shrink-0">
  110. <img class="h-10 w-10 rounded-full" src="{{ Auth::user()->profile_photo_url }}" alt="{{ Auth::user()->name }}" />
  111. </div>
  112. <div class="ml-3">
  113. <div class="font-medium text-base text-gray-800">{{ Auth::user()->name }}</div>
  114. <div class="font-medium text-sm text-gray-500">{{ Auth::user()->email }}</div>
  115. </div>
  116. </div>
  117. <div class="mt-3 space-y-1">
  118. <!-- Account Management -->
  119. <x-jet-responsive-nav-link href="{{ route('profile.show') }}" :active="request()->routeIs('profile.show')">
  120. {{ __('Profile') }}
  121. </x-jet-responsive-nav-link>
  122. @if (Laravel\Jetstream\Jetstream::hasApiFeatures())
  123. <x-jet-responsive-nav-link href="{{ route('api-tokens.index') }}" :active="request()->routeIs('api-tokens.index')">
  124. {{ __('API Tokens') }}
  125. </x-jet-responsive-nav-link>
  126. @endif
  127. <!-- Authentication -->
  128. <form method="POST" action="{{ route('logout') }}">
  129. @csrf
  130. <x-jet-responsive-nav-link href="{{ route('logout') }}"
  131. onclick="event.preventDefault();
  132. this.closest('form').submit();">
  133. {{ __('Logout') }}
  134. </x-jet-responsive-nav-link>
  135. </form>
  136. <!-- Team Management -->
  137. @if (Laravel\Jetstream\Jetstream::hasTeamFeatures())
  138. <div class="border-t border-gray-200"></div>
  139. <div class="block px-4 py-2 text-xs text-gray-400">
  140. {{ __('Manage Team') }}
  141. </div>
  142. <!-- Team Settings -->
  143. <x-jet-responsive-nav-link href="{{ route('teams.show', Auth::user()->currentTeam->id) }}" :active="request()->routeIs('teams.show')">
  144. {{ __('Team Settings') }}
  145. </x-jet-responsive-nav-link>
  146. <x-jet-responsive-nav-link href="{{ route('teams.create') }}" :active="request()->routeIs('teams.create')">
  147. {{ __('Create New Team') }}
  148. </x-jet-responsive-nav-link>
  149. <div class="border-t border-gray-200"></div>
  150. <!-- Team Switcher -->
  151. <div class="block px-4 py-2 text-xs text-gray-400">
  152. {{ __('Switch Teams') }}
  153. </div>
  154. @foreach (Auth::user()->allTeams() as $team)
  155. <x-jet-switchable-team :team="$team" component="jet-responsive-nav-link" />
  156. @endforeach
  157. @endif
  158. </div>
  159. </div>
  160. </div>
  161. </nav>