Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[PLAY-843] Kit mashup page for handoffs #2583

Merged
merged 28 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
dd86c17
Merge branch 'master' of github.com:powerhome/playbook
nickamantia Oct 26, 2022
af9bc36
Merge branch 'master' of github.com:powerhome/playbook
nickamantia Apr 17, 2023
58b1cb4
Merge branch 'master' of github.com:powerhome/playbook
nickamantia May 15, 2023
625ccb6
Merge branch 'master' of github.com:powerhome/playbook
nickamantia May 24, 2023
a295ce1
Merge branch 'master' of github.com:powerhome/playbook
nickamantia May 30, 2023
9d4771a
wip - got mumitple kits rendering
nickamantia Jun 1, 2023
569c1f0
fixed nav
nickamantia Jun 2, 2023
5a21f1a
wip
nickamantia Jun 5, 2023
459d206
quick fix
nickamantia Jun 5, 2023
2663b45
Merge branch 'master' into play-843-kit-mashup-page
jasperfurniss Jun 6, 2023
f6b5170
Merge remote-tracking branch 'origin/master' into play-843-kit-mashup…
nickamantia Jun 7, 2023
22c4dd1
multiple kits can now render useing the kits route
nickamantia Jun 7, 2023
4a55191
Merge branch 'play-843-kit-mashup-page' of github.com:powerhome/playb…
nickamantia Jun 7, 2023
d6b657a
button fix
nickamantia Jun 7, 2023
564f7d4
fixed spacing
nickamantia Jun 7, 2023
db6cd8e
indentation
nickamantia Jun 7, 2023
dd47d85
wip feedback
nickamantia Jun 8, 2023
8c58625
feedback addressed
nickamantia Jun 12, 2023
00bdc9f
updated route name
nickamantia Jun 12, 2023
007944d
removed unused css
nickamantia Jun 12, 2023
c52b315
Merge branch 'master' into play-843-kit-mashup-page
nickamantia Jun 12, 2023
9360ed8
some UI changes - removed searchbar
nickamantia Jun 12, 2023
0bcca6e
changed route and method names
nickamantia Jun 13, 2023
a8042f9
Merge branch 'play-843-kit-mashup-page' of github.com:powerhome/playb…
nickamantia Jun 13, 2023
180a7d9
updated to match pattern
nickamantia Jun 13, 2023
eb96503
default to first kit when not passed in
nickamantia Jun 13, 2023
ba6cbf5
refactored
nickamantia Jun 14, 2023
4098fce
Merge branch 'master' into play-843-kit-mashup-page
nidaqg Jun 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions playbook-website/app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ def kit_show_swift
render "pages/kit_show"
end

def kit_collection_show_rails
handle_kit_collection("rails")
end

def kit_collection_show_react
handle_kit_collection("react")
end

def kit_collection_show
handle_kit_collection(params[:type])
end

def kit_playground_rails
@kit = "avatar"
@examples = pb_doc_kit_examples(@kit, "rails")
Expand Down Expand Up @@ -206,4 +218,14 @@ def read_kit_file(*args)
path = ::Playbook.kit_path(@kit, "docs", *args)
path.exist? ? path.read : ""
end

def handle_kit_collection(type)
@kits = params[:names].split("%26")
@kits_array = @kits.first.split("&")
params[:name] ||= @kits_array[0]
@selected_kit = params[:name]
@type = type

render template: "pages/kit_collection", layout: "layouts/fullscreen"
end
end
4 changes: 4 additions & 0 deletions playbook-website/app/javascript/site_styles/_kits_show.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
max-width: fit-content;
}
}

.multi-kits-container {
width: 100%;
}
16 changes: 16 additions & 0 deletions playbook-website/app/views/pages/kit_collection.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<%= pb_rails("flex", props: {orientation: "column", margin: "xl"}) do %>
<%= pb_rails("nav", props: { margin_bottom: "md", orientation: "horizontal" }) do %>
<%= pb_rails("flex", props: {wrap: true}) do %>
<% @kits_array.each do |kit| %>
<%= pb_rails("nav/item", props: { id: "nav-item-#{kit}", text: kit.titleize, link: kit_collection_show_path(names: params[:names], name: kit, type: @type), active: kit == @selected_kit}) %>
<% end %>
<% end %>
<% end %>
<div class="multi-kits-container">
<% if @type == "rails" %>
<%= pb_kit(kit: @selected_kit, dark_mode: dark_mode?) %>
<% elsif @type == "react" %>
<%= pb_kit(kit: @selected_kit, type: "react", dark_mode: dark_mode?) %>
<% end %>
</div>
<% end %>
3 changes: 1 addition & 2 deletions playbook-website/app/views/pages/kit_show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<% end %>
<% end %>
</a>
<% end %>f
<% end %>
<% end %>
<% end %>
<% end %>
Expand All @@ -109,5 +109,4 @@
%>
</div>
<% end %>

</div>
3 changes: 3 additions & 0 deletions playbook-website/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
get "kit_category/:name", to: "pages#kit_category_show_rails", as: "kit_category_show"
get "kit_category/:name/rails", to: "pages#kit_category_show_rails", as: "kit_category_show_rails"
get "kit_category/:name/react", to: "pages#kit_category_show_react", as: "kit_category_show_reacts"
get "kit_collection/*names/:name/rails", to: "pages#kit_collection_show_rails", as: "kit_collection_show_rails"
get "kit_collection/*names/:name/react", to: "pages#kit_collection_show_react", as: "kit_collection_show_react"
get "kit_collection/*names/(/:name)(/:type)", to: "pages#kit_collection_show_rails", defaults: { type: "rails" }, as: "kit_collection_show"

# Experiments
get "kits/:name/sandpack", to: "pages#kit_show_new", as: "kit_show_new"
Expand Down