From c4e7701ef188e7c70e8224ea7d9991ce498e2684 Mon Sep 17 00:00:00 2001 From: janpaulo Date: Fri, 18 Feb 2022 10:06:54 +0800 Subject: [PATCH] Initial setup navBar --- .../sidenav_component.html.erb | 146 +++++++++++------- app/javascript/src/application.scss | 1 + app/javascript/src/application/nav-bar.scss | 3 + app/views/layouts/application.html.erb | 9 +- 4 files changed, 98 insertions(+), 61 deletions(-) create mode 100644 app/javascript/src/application/nav-bar.scss diff --git a/app/components/sidenav_component/sidenav_component.html.erb b/app/components/sidenav_component/sidenav_component.html.erb index 3a9df63..5113372 100644 --- a/app/components/sidenav_component/sidenav_component.html.erb +++ b/app/components/sidenav_component/sidenav_component.html.erb @@ -1,74 +1,114 @@ <% if current_user.present? %> <% if opts[:is_sidenav].present? %> - + <% elsif opts[:is_nav_bar].present? %> + + + <% end %> <% end %> diff --git a/app/javascript/src/application.scss b/app/javascript/src/application.scss index 6091053..fb38700 100644 --- a/app/javascript/src/application.scss +++ b/app/javascript/src/application.scss @@ -3,6 +3,7 @@ @import "./application/sessions"; @import "./application/pagination"; @import "./application/table"; +@import "./application/nav-bar"; .tableFixHead { overflow: auto; diff --git a/app/javascript/src/application/nav-bar.scss b/app/javascript/src/application/nav-bar.scss new file mode 100644 index 0000000..51c6197 --- /dev/null +++ b/app/javascript/src/application/nav-bar.scss @@ -0,0 +1,3 @@ +img.nav-bar-app-logo { + width: 220px; +} \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8d2a90a..99eb901 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,15 +12,8 @@ - + <%= render(SidenavComponent.new(current_user: current_user, opts: { is_nav_bar: true }))%>
- - <% if current_user.present? %> -
- <%= render(SidenavComponent.new(current_user: current_user, opts: { is_sidenav: true }))%> -
- <% end %> -