Skip to content

Commit 33d89fb

Browse files
authored
Update example app for Tech challenges (#4192)
Update examples/playbook-rails-react-example to work better with tech challenges.
1 parent 6e0b0a6 commit 33d89fb

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

examples/rails-react-example/app/assets/stylesheets/application.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ $extrabold: 700;
3030

3131
@import "reset";
3232
@import "playbook";
33+
34+
// To use Playbook tokens, you must import the relevant files as shown below
35+
// To view all available tokens, visit https://github.com/powerhome/playbook/tree/master/playbook/app/pb_kits/playbook/tokens
36+
// To see the tokens visually, see our docs here: https://playbook.powerapp.cloud/visual_guidelines
37+
@import "tokens/spacing";

examples/rails-react-example/app/javascript/components/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { CircleIconButton, Title } from "playbook-ui"
44

55
import WebpackerReact from 'webpacker-react'
66

7+
// This is the main component that will be rendered in the Rails view if you choose to use React
8+
// This example showcases how to import and use Playbook components
79
const App = () => {
810
return (
911
<div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<%# If choosing to use React components in Rails views, the following `react_component` helper is already set up. %>
2+
<%# Please use the components/App.tsx file to create your React components.%>
13
<%= react_component("App") %>
24

5+
6+
<%# If you want to use the Rails components only, you can use the following example: %>
7+
<%# Line 3 above can be deleted if choosing to use Rails components only. %>
8+
39
<%= pb_rails("button", props: { text: "Button Primary", margin_right: "lg" }) %>

0 commit comments

Comments
 (0)