Skip to content

Commit

Permalink
updates and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpaul committed Jul 13, 2023
1 parent 8040896 commit f3c3dc9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 28 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
fixed inset-x-0 top-0 z-40 flex
h-14
items-center justify-between
gap-12 px-4 sm:px-6 lg:left-72 lg:z-30 lg:px-8 lg:left-72
gap-6 px-4 sm:px-6 lg:left-72 lg:z-30 lg:px-8 lg:left-72
transition-opacity
backdrop-blur-sm dark:backdrop-blur
bg-card/90 dark:bg-card-dark/80;
Expand Down
43 changes: 16 additions & 27 deletions app/views/components/app/top_navigation_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def template
end

div(class: "flex items-center gap-x-4 lg:gap-x-6") do
a(href: "#", class: "button text-neutral-400 hover:text-neutral-500 h-6 w-6 lg:hidden") do
unsafe_raw heroicon("magnifying-glass")
end

div(class: "flex h-6 w-6 items-center justify-center button") do
render DarkModeButtonComponent.new
end
Expand All @@ -47,7 +51,7 @@ def open_sidebar_button
"@click": "sidebarOpen = !sidebarOpen"
) do
span(class: "sr-only") { "Open sidebar" }
unsafe_raw heroicon("bars-3", options: {class: "h-6 w-6"})
unsafe_raw heroicon("bars-3", options: { class: "h-6 w-6" })
end
end

Expand All @@ -58,38 +62,23 @@ def seperator(classes: "")
def search_bar
div(
class:
"flex px-2 w-full"
"px-2 w-full lg:w-3/5 hidden lg:flex"
) do
div(class: "w-full") do
whitespace
label(for: "search", class: "sr-only") { "Search" }
div(class: "relative") do
div(
class:
"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"
) do
whitespace
svg(
class: "h-5 w-5 text-gray-400",
viewbox: "0 0 20 20",
fill: "currentColor",
aria_hidden: "true"
) do |s|
s.path(
fill_rule: "evenodd",
d:
"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",
clip_rule: "evenodd"
)
end
unsafe_raw heroicon("magnifying-glass", options: { class: "h-5 w-5 text-neutral-400" })
end
whitespace
input(
id: "search",
name: "search",
class:
"block w-full rounded-md border-0 bg-card dark:bg-[#27262b] py-1.5 pl-10 pr-3 text-slate-800 dark:text-neutral-50 ring-1 ring-inset ring-neutral-300 dark:ring-neutral-750 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6",
placeholder: "Search",
"text-input w-full rounded-full py-1.5 pl-10 pr-3 shadow-none ring-neutral-300/50 dark:ring-neutral-750",
placeholder: "Search...",
type: "search"
)
end
Expand All @@ -103,7 +92,7 @@ def user_display
type: "button",
id: "user-menu-button",
class: "flex items-center -m-1.5 p-1.5",
aria: {expanded: "false", haspopup: "true"},
aria: { expanded: "false", haspopup: "true" },
"@click": "dropdownOpen = !dropdownOpen"
) do
span(class: "sr-only") { "Open user menu" }
Expand All @@ -112,12 +101,12 @@ def user_display
span(class: "hidden lg:flex lg:items-center") do
span(
class: "ml-4 text-sm font-semibold leading-6 text-heading",
aria: {hidden: "true"}
aria: { hidden: "true" }
) do
@current_user.first_name.capitalize.truncate(20)
end

unsafe_raw heroicon("chevron-down", options: {class: "ml-2 h-5 w-5 button"})
unsafe_raw heroicon("chevron-down", options: { class: "ml-2 h-5 w-5 button" })
end
end

Expand All @@ -128,10 +117,10 @@ def user_display
def user_dropdown_items
[
[
{label: "Support", path: "#"}
{ label: "Support", path: "#" }
],
[
{label: "Account Settings", path: edit_user_registration_path}
{ label: "Account Settings", path: edit_user_registration_path }
]
]
end
Expand All @@ -140,7 +129,7 @@ def user_dropdown
div(
role: "menu",
class: "absolute right-0 z-50 w-64 origin-top-right card shadow-lg mt-4 ring-neutral-900/5",
aria: {labelledby: "user-menu-button", orientation: "vertical"},
aria: { labelledby: "user-menu-button", orientation: "vertical" },
tabindex: "-1",
"x-show": "dropdownOpen",
"@click.away": "dropdownOpen = false",
Expand All @@ -167,7 +156,7 @@ def user_dropdown
end
end

link_to "Sign Out", destroy_user_session_path, data: {turbo_method: :delete}, class: item_link_classes
link_to "Sign Out", destroy_user_session_path, data: { turbo_method: :delete }, class: item_link_classes
end
end
end

0 comments on commit f3c3dc9

Please sign in to comment.