Skip to content

Commit

Permalink
adding back to home buttons on all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
keigoomura committed Nov 20, 2024
1 parent 1f81988 commit 8b46f84
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
17 changes: 14 additions & 3 deletions app/assets/stylesheets/auth.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,21 @@ body {
}

/* Navigation links in header */
.left-nav {
position: absolute;
top: 10px;
left: 0px;
}

.nav-links {
position: absolute;
top: 20px;
top: 10px;
right: 20px;
display: flex;
gap: 15px;
}

.nav-links a {
.left-nav a, .nav-links a {
color: #3498db;
text-decoration: none;
font-size: 14px;
Expand All @@ -109,7 +115,7 @@ body {
transition: background-color 0.2s;
}

.nav-links a:hover {
.left-nav a:hover, .nav-links a:hover {
background-color: rgba(52, 152, 219, 0.1);
}

Expand All @@ -135,4 +141,9 @@ body {

.home-link:hover {
color: #3498db;
}

/* Add padding to main content when on profile page */
body.profile-page {
padding-top: 35px; /* Adjust this value as needed */
}
8 changes: 7 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
<%= javascript_importmap_tags %>
</head>

<body>
<body class="<%= 'profile-page' if current_page?(profile_path) || current_page?(create_listing_path) %>">
<% unless current_page?(login_path) || current_page?(register_path) %>
<% unless current_page?(root_path)%>
<div class="left-nav">
<%= link_to "Back to Home", root_path, class: "nav-link" %>
</div>
<% end %>

<div class="nav-links">
<% if @loggedin %>
<%= link_to "Log Out", "/logout" %> <%= link_to "Profile", "/profile" %>
Expand Down

0 comments on commit 8b46f84

Please sign in to comment.