Skip to content

Commit

Permalink
Always show own specialties
Browse files Browse the repository at this point in the history
  • Loading branch information
joemasilotti committed Apr 11, 2024
1 parent 0c5cf69 commit 75182b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions app/components/developers/specialties_component.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module Developers
class SpecialtiesComponent < ApplicationComponent
private attr_reader :specialties
private attr_reader :specialties, :force_show

def initialize(specialties)
def initialize(specialties, force_show: false)
@specialties = specialties
@force_show = force_show
end

def render?
Feature.enabled?(:developer_specialty_querying)
force_show || Feature.enabled?(:developer_specialty_querying)
end
end
end
4 changes: 2 additions & 2 deletions app/views/developers/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="pt-6 pb-8 xl:pb-10">
<div class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 lg:max-w-5xl lg:grid lg:grid-cols-3">
<div class="lg:col-span-2 lg:pr-8 lg:border-r lg:border-gray-200">
<div class="space-y-6">
<div class="space-y-4">
<div class="md:flex md:items-start md:justify-between md:space-x-4 lg:border-b lg:pb-6">
<div class="w-full">
<h1 class="text-2xl font-bold text-gray-900"><%= @developer.hero %></h1>
Expand All @@ -31,7 +31,7 @@
</div>

<%= render Developers::BadgesComponent.new(@developer) %>
<%= render Developers::SpecialtiesComponent.new(@developer.specialties) %>
<%= render Developers::SpecialtiesComponent.new(@developer.specialties, force_show: current_user == @developer.user) %>

<aside class="mt-8 lg:hidden">
<%= render "details", developer: @developer, public_key: @public_key %>
Expand Down

0 comments on commit 75182b6

Please sign in to comment.