Skip to content

Commit

Permalink
Update example app for Tech challenges (#4192)
Browse files Browse the repository at this point in the history
Update examples/playbook-rails-react-example to work better with tech
challenges.
  • Loading branch information
nidaqg authored Jan 29, 2025
1 parent 6e0b0a6 commit 33d89fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ $extrabold: 700;

@import "reset";
@import "playbook";

// To use Playbook tokens, you must import the relevant files as shown below
// To view all available tokens, visit https://github.com/powerhome/playbook/tree/master/playbook/app/pb_kits/playbook/tokens
// To see the tokens visually, see our docs here: https://playbook.powerapp.cloud/visual_guidelines
@import "tokens/spacing";
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { CircleIconButton, Title } from "playbook-ui"

import WebpackerReact from 'webpacker-react'

// This is the main component that will be rendered in the Rails view if you choose to use React
// This example showcases how to import and use Playbook components
const App = () => {
return (
<div>
Expand Down
6 changes: 6 additions & 0 deletions examples/rails-react-example/app/views/pages/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<%# If choosing to use React components in Rails views, the following `react_component` helper is already set up. %>
<%# Please use the components/App.tsx file to create your React components.%>
<%= react_component("App") %>


<%# If you want to use the Rails components only, you can use the following example: %>
<%# Line 3 above can be deleted if choosing to use Rails components only. %>

<%= pb_rails("button", props: { text: "Button Primary", margin_right: "lg" }) %>

0 comments on commit 33d89fb

Please sign in to comment.