Skip to content

Commit

Permalink
Add navigation bar
Browse files Browse the repository at this point in the history
  • Loading branch information
canan8 committed May 13, 2020
1 parent 6731a7c commit d916dca
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ require('jquery')
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)

$(document).on('turbolinks:load', function() {
$('.item').click(function(e) {
$('.active').removeClass('active');
$(this).addClass('active');
});
})
13 changes: 13 additions & 0 deletions app/views/layouts/_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="ui inverted segment">
<div class="ui inverted secondary pointing menu">
<a class="active item">
Home
</a>
<a class="item">
Teams
</a>
<a class="item">
Account
</a>
</div>
</div>
5 changes: 4 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
</head>

<body>
<%= yield %>
<div class="ui container">
<%= render 'layouts/navigation' %>
<%= yield %>
</div>
</body>
</html>

0 comments on commit d916dca

Please sign in to comment.