Skip to content

Commit e137864

Browse files
fix: update navbar and hero to redesigned version after merge
- Fix navbar: remove merge artifacts, add proper nav structure, theme toggle on desktop - Fix footer: add missing ul wrapper, fix Connect section HTML structure - Fix intro: correct closing divs, restore hero layout - Add socials helper to ApplicationHelper for layout footer Made-with: Cursor
1 parent 529175f commit e137864

File tree

4 files changed

+46
-50
lines changed

4 files changed

+46
-50
lines changed

app/helpers/application_helper.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,24 @@
22

33
module ApplicationHelper
44
include Pagy::Frontend
5+
6+
SOCIALS = [
7+
{ alt_key: 'social_media.twitter', link: 'https://twitter.com/ruby_african', image: 'brands_twitter.png',
8+
show: true },
9+
{ alt_key: 'social_media.telegram', link: '#', image: 'brands_telegram.png',
10+
show: FeatureFlag.find_by(name: 'telegram')&.enabled },
11+
{ alt_key: 'social_media.facebook', link: 'https://www.facebook.com/rubycommunity.africa',
12+
image: 'brands_facebook.png',
13+
show: true },
14+
{ alt_key: 'social_media.instagram', link: 'https://www.instagram.com/africanruby_community/', image: 'brands_instagram.png', show: true },
15+
{ alt_key: 'social_media.linkedin', link: 'https://www.linkedin.com/company/african-ruby-community/',
16+
image: 'brands_linkedin.png', show: true },
17+
{ alt_key: 'social_media.github', link: 'https://github.com/nairuby', image: 'brands_github.png', show: true }
18+
].freeze
19+
20+
def socials
21+
SOCIALS.map do |social|
22+
social.merge(alt: I18n.t(social[:alt_key]))
23+
end
24+
end
525
end

app/views/landing/home/_intro.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
<% end %>
1414
</div>
1515
</div>
16+
</div>
1617

17-
<div class="relative z-10 mx-auto w-full max-w-7xl px-6 py-24 md:py-32">
18+
<div class="relative z-10 mx-auto w-full max-w-7xl px-6 py-24 md:py-32 -mt-32">
1819
<div class="max-w-3xl">
1920

2021
<%= link_to "https://rubyconf.africa/", target: "_blank",
@@ -76,4 +77,3 @@
7677
</div>
7778
</div>
7879
</div>
79-
</div>

app/views/layouts/_footer.html.erb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33

44
<div class="grid gap-12 md:grid-cols-4">
55

6-
<li class="hover:text-red-600 hover:underline"><%= link_to t('footer.chapters'), chapters_path %></li>
7-
8-
<% if FeatureFlag.find_by(name: 'projects')&.enabled %>
9-
<li class="hover:text-red-600 hover:underline"><%= link_to t('footer.projects'), projects_path %></li>
10-
<% end %>
11-
12-
<% if FeatureFlag.find_by(name: 'learning_materials')&.enabled %>
13-
<li class="hover:text-red-600 hover:underline"><%= link_to t('footer.learning_materials'), learning_materials_path %></li>
14-
<% end %>
15-
</ul>
6+
<ul class="flex flex-col gap-3">
7+
<li class="hover:text-red-600 hover:underline"><%= link_to t('footer.chapters'), chapters_path %></li>
8+
<% if FeatureFlag.find_by(name: 'projects')&.enabled %>
9+
<li class="hover:text-red-600 hover:underline"><%= link_to t('footer.projects'), projects_path %></li>
10+
<% end %>
11+
<% if FeatureFlag.find_by(name: 'learning_materials')&.enabled %>
12+
<li class="hover:text-red-600 hover:underline"><%= link_to t('footer.learning_materials'), learning_materials_path %></li>
13+
<% end %>
14+
</ul>
1615

17-
<ul class="flex flex-col gap-3">
16+
<ul class="flex flex-col gap-3">
1817
<li class="hover:text-red-600 hover:underline"><%= link_to t('footer.sponsor'), 'mailto:organisers@rubycommunity.africa' %></li>
1918

2019
<% if FeatureFlag.find_by(name: 'members').try(:enabled) %>
@@ -39,19 +38,20 @@
3938
</h1>
4039
<ul class="flex md:flex-row flex-col md:mt-4 md:gap-10 gap-5">
4140
<% socials.each do |social| %>
42-
<% if social[:show] === true %>
41+
<% if social[:show] %>
4342
<li class='md:border-2 border-red-600 p-5 rounded-full'>
4443
<%= link_to social[:link] do %>
4544
<%= image_tag social[:image], alt: social[:alt], class: "md:w-5 w-8 hover:scale-105" %>
4645
<% end %>
4746
</li>
4847
<% end %>
4948
<% end %>
50-
<p class="mt-4 text-sm leading-relaxed text-zinc-500 dark:text-zinc-400">
51-
African Ruby Community. Promoting computer software programming
52-
skills with the Ruby programming language across Africa since 2010.
53-
</p>
54-
</div>
49+
</ul>
50+
<p class="mt-4 text-sm leading-relaxed text-zinc-500 dark:text-zinc-400">
51+
African Ruby Community. Promoting computer software programming
52+
skills with the Ruby programming language across Africa since 2010.
53+
</p>
54+
</div>
5555

5656
<%# Community links %>
5757
<div>

app/views/layouts/_navbar.html.erb

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,9 @@
33
dark:border-zinc-800/50 dark:bg-black/80
44
backdrop-blur-xl transition-colors duration-300"
55
id="main-navbar"
6-
data-turbo-permanent
76
data-controller="navbar">
8-
9-
<% if FeatureFlag.find_by(name: 'events').try(:enabled) %>
10-
<li><%= link_to t('navigation.events'), events_path %></li>
11-
<% end %>
12-
13-
<%# Conferences removed from project %>
14-
15-
<li><%= link_to t('navigation.chapters'), chapters_path %></li>
16-
17-
<% if FeatureFlag.find_by(name: 'projects')&.enabled %>
18-
<li><%= link_to t('navigation.projects'), projects_path %></li>
19-
<% end %>
20-
21-
<% if FeatureFlag.find_by(name: 'learning_materials')&.enabled %>
22-
<li><%= link_to t('navigation.learning_materials'), learning_materials_path %></li>
23-
<% end %>
24-
25-
<% if user_signed_in? %>
26-
<li><%= button_to t('navigation.sign_out'), destroy_user_session_path, method: :delete %></li>
27-
<% else %>
28-
<li><%= link_to t('navigation.sign_up'), new_user_registration_path %></li>
29-
<li><%= link_to t('navigation.sign_in'), new_user_session_path %></li>
30-
<% end %>
31-
</ul>
32-
</div>
7+
<nav class="mx-auto flex max-w-7xl items-center justify-between px-4 sm:px-6 lg:px-8">
8+
<div class="flex flex-1 items-center gap-4">
339
<div class="flex justify-start lg:w-0 lg:flex-1">
3410
<%= link_to root_path do %>
3511
<span class="sr-only"><%= t('navigation.community_name') %></span>
@@ -91,9 +67,9 @@
9167
<% end %>
9268
</div>
9369

94-
<%# Mobile right side: theme toggle + hamburger %>
95-
<div class="flex items-center gap-1 md:hidden">
96-
<%# Theme toggle (mobile) %>
70+
<%# Theme toggle + hamburger (mobile) %>
71+
<div class="flex items-center gap-1">
72+
<%# Theme toggle - visible on all screen sizes (sun/moon icon) %>
9773
<button data-action="click->theme#toggle"
9874
class="rounded-md p-2 text-zinc-500 transition-colors hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800"
9975
aria-label="Toggle theme">
@@ -108,8 +84,8 @@
10884
</svg>
10985
</button>
11086

111-
<%# Hamburger %>
112-
<button class="rounded-md p-2 text-zinc-500 transition-colors hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800"
87+
<%# Hamburger (mobile only) %>
88+
<button class="rounded-md p-2 text-zinc-500 transition-colors hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800 md:hidden"
11389
data-action="click->navbar#toggle"
11490
aria-label="Toggle menu">
11591
<svg data-navbar-target="openIcon" xmlns="http://www.w3.org/2000/svg" width="22" height="22"

0 commit comments

Comments
 (0)